  | 
  
    MPLABĀ® Harmony Graphics Suite
    
   | 
 
 
 
 
Go to the documentation of this file.
   46 #ifndef LEGATO_LISTWIDGET_H 
   47 #define LEGATO_LISTWIDGET_H 
   51 #if LE_LIST_WIDGET_ENABLED == 1 && LE_SCROLLBAR_WIDGET_ENABLED == 1 
   59 typedef struct leListWidget leListWidget;
 
   72 typedef void (*leListWidget_SelectedItemChangedEvent)(leListWidget*,
 
  104 typedef enum leListWidget_SelectionMode
 
  106     LE_LIST_WIDGET_SELECTION_MODE_SINGLE,
 
  107     LE_LIST_WIDGET_SELECTION_MODE_MULTIPLE,
 
  108     LE_LIST_WIDGET_SELECTION_MODE_CONTIGUOUS
 
  109 } leListWidget_SelectionMode;
 
  128 typedef struct leListItem
 
  142 typedef struct leListWidget leListWidget;
 
  144 #define LE_LISTWIDGET_VTABLE(THIS_TYPE) \ 
  145     LE_WIDGET_VTABLE(THIS_TYPE) \ 
  147     leListWidget_SelectionMode (*getSelectionMode)(const THIS_TYPE* _this); \ 
  148     leResult      (*setSelectionMode)(THIS_TYPE* _this, leListWidget_SelectionMode mode); \ 
  149     leBool        (*getAllowEmptySelection)(const THIS_TYPE* _this); \ 
  150     leResult      (*setAllowEmptySelection)(THIS_TYPE* _this, leBool allow); \ 
  151     leRelativePosition  (*getIconPosition)(const THIS_TYPE* _this); \ 
  152     leResult      (*setIconPosition)(THIS_TYPE* _this, leRelativePosition pos); \ 
  153     uint32_t      (*getIconMargin)(const THIS_TYPE* _this); \ 
  154     leResult      (*setIconMargin)(THIS_TYPE* _this, uint32_t mg); \ 
  155     uint32_t      (*getItemCount)(const THIS_TYPE* _this); \ 
  156     int32_t       (*appendItem)(THIS_TYPE* _this); \ 
  157     int32_t       (*insertItem)(THIS_TYPE* _this, int32_t idx); \ 
  158     leResult      (*removeItem)(THIS_TYPE* _this, int32_t idx); \ 
  159     leResult      (*removeAllItems)(THIS_TYPE* _this); \ 
  160     leBool        (*getItemSelected)(const THIS_TYPE* _this, int32_t idx); \ 
  161     leResult      (*setItemSelected)(THIS_TYPE* _this, int32_t idx, leBool selected); \ 
  162     leResult      (*toggleItemSelected)(THIS_TYPE* _this, int32_t idx); \ 
  163     leResult      (*selectAll)(THIS_TYPE* _this); \ 
  164     leResult      (*deselectAll)(THIS_TYPE* _this); \ 
  165     int32_t       (*getFirstSelectedItem)(const THIS_TYPE* _this); \ 
  166     int32_t       (*getLastSelectedItem)(const THIS_TYPE* _this); \ 
  167     uint32_t      (*getSelectionCount)(const THIS_TYPE* _this); \ 
  168     leString*     (*getItemString)(const THIS_TYPE* _this, int32_t idx); \ 
  169     leResult      (*setItemString)(THIS_TYPE* _this, int32_t idx, const leString* str); \ 
  170     leImage*      (*getItemIcon)(const THIS_TYPE* _this, int32_t idx); \ 
  171     leResult      (*setItemIcon)(THIS_TYPE* _this, int32_t idx, const leImage* img); \ 
  172     leBool        (*getItemEnable)(const THIS_TYPE* _this, int32_t idx); \ 
  173     leResult      (*setItemEnable)(THIS_TYPE* _this, int32_t idx, leBool b); \ 
  174     leResult      (*setItemVisible)(THIS_TYPE* _this, int32_t idx); \ 
  175     leListWidget_SelectedItemChangedEvent (*getSelectedItemChangedEventCallback)(const THIS_TYPE* _this); \ 
  176     leResult      (*setSelectedItemChangedEventCallback)(THIS_TYPE* _this, leListWidget_SelectedItemChangedEvent cb); \ 
  178 typedef struct leListWidgetVTable
 
  180     LE_LISTWIDGET_VTABLE(leListWidget)
 
  181 } leListWidgetVTable; 
 
  196 typedef struct leListWidget
 
  200     const leListWidgetVTable* fn;
 
  202     leListWidget_SelectionMode mode; 
 
  213     leScrollBarWidget* scrollbar; 
 
  215     leListWidget_SelectedItemChangedEvent cb; 
 
  235 LIB_EXPORT leListWidget* leListWidget_New();
 
  247 LIB_EXPORT 
void leListWidget_Constructor(leListWidget* wgt);
 
  250 #define THIS_TYPE struct leWidget 
  282 virtual leListWidget_SelectionMode getSelectionMode(
const leListWidget* _this);
 
  316 virtual leResult setSelectionMode(leListWidget* _this,
 
  317                                   leListWidget_SelectionMode mode);
 
  349 virtual leBool getAllowEmptySelection(
const leListWidget* _this);
 
  384 virtual leResult setAllowEmptySelection(leListWidget* _this,
 
  452 virtual leResult setIconPosition(leListWidget* _this,
 
  485 virtual uint32_t getIconMargin(
const leListWidget* _this);
 
  520 virtual leResult setIconMargin(leListWidget* _this,
 
  553 virtual uint32_t getItemCount(
const leListWidget* _this);
 
  584 virtual int32_t appendItem(leListWidget* _this);
 
  617 virtual int32_t insertItem(leListWidget* _this,
 
  653 virtual leResult removeItem(leListWidget* _this,
 
  686 virtual leResult removeAllItems(leListWidget* _this);
 
  721 virtual leBool getItemSelected(
const leListWidget* _this,
 
  760 virtual leResult setItemSelected(leListWidget* _this,
 
  798 virtual leResult toggleItemSelected(leListWidget* _this,
 
  831 virtual leResult selectAll(leListWidget* _this);
 
  863 virtual leResult deselectAll(leListWidget* _this);
 
  896 virtual int32_t getFirstSelectedItem(
const leListWidget* _this);
 
  927 virtual int32_t getLastSelectedItem(
const leListWidget* _this);
 
  958 virtual uint32_t getSelectionCount(
const leListWidget* _this);
 
  991 virtual leString* getItemString(
const leListWidget* _this,
 
 1032 virtual leResult setItemString(leListWidget* _this,
 
 1068 virtual leImage* getItemIcon(
const leListWidget* _this,
 
 1108 virtual leResult setItemIcon(leListWidget* _this,
 
 1144 virtual leBool getItemEnable(
const leListWidget* _this,
 
 1184 virtual leResult setItemEnable(leListWidget* _this,
 
 1200 virtual leListWidget_SelectedItemChangedEvent getSelectedItemChangedEventCallback
 
 1201                                                     (
const leListWidget* _this);
 
 1216 virtual leResult setSelectedItemChangedEventCallback(leListWidget* _this,
 
 1217                                                      leListWidget_SelectedItemChangedEvent cb);
 
 1223 #endif // LE_LIST_WIDGET_ENABLED && LE_SCROLLBAR_WIDGET_ENABLED 
  
Defines common math functions for general use.
 
Error functions, macros and definitions.
 
leResult
This enum represents function call results.
Definition: legato_common.h:134
 
leResult leArray_RemoveAt(leArray *arr, uint32_t idx)
Remove value at index.
Definition: legato_array.c:197
 
This struct represents a rectangle.
Definition: legato_common.h:405
 
Image functions and defintions.
 
Memory functions and definitions.
 
leResult leArray_PushBack(leArray *arr, void *val)
Push value on back.
Definition: legato_array.c:147
 
Definition: legato_image.h:180
 
@ LE_HALIGN_CENTER
Definition: legato_common.h:208
 
This struct represents a array.
Definition: legato_array.h:61
 
leResult leArray_Create(leArray *arr)
Create a new array.
Definition: legato_array.c:73
 
This struct represents a string.
Definition: legato_string.h:108
 
leResult leArray_InsertAt(leArray *arr, uint32_t idx, void *val)
Insert value at index.
Definition: legato_array.c:174
 
leBool
This enum represents booleans.
Definition: legato_common.h:157
 
virtual uint32_t length(const leString *_this)
Get length of the string.
 
@ LE_FALSE
Definition: legato_common.h:158
 
LIB_EXPORT leBool leRectContainsPoint(const leRect *rect, const lePoint *point)
Determines if a point is inside a rectangle.
Definition: legato_rect.c:31
 
General internal utilities for the library.
 
Fixed string functions and definitions.
 
leResult leArray_Clear(leArray *arr)
Clear array.
Definition: legato_array.c:279
 
This struct represents a c-style string render request.
Definition: legato_string_renderer.h:128
 
@ LE_RELATIVE_POSITION_RIGHTOF
Definition: legato_common.h:317
 
String utility functions and definitions.
 
The header file joins all header files used in the graphics object library.
 
void * leArray_Get(const leArray *arr, uint32_t idx)
Get entry at index.
Definition: legato_array.c:224
 
@ LE_RELATIVE_POSITION_LEFTOF
Definition: legato_common.h:314
 
leResult leStringRenderer_DrawCString(leCStringRenderRequest *req)
Draw leChar string.
Definition: legato_string_renderer.c:297
 
leColor leScheme_GetRenderColor(const leScheme *schm, leSchemeColor clr)
Gets a scheme render color for the current layer color mode.
Definition: legato_scheme.c:68
 
leRelativePosition
This enum represents the relative position modes for objects.
Definition: legato_common.h:313
 
@ LE_TRUE
Definition: legato_common.h:159
 
Common macros and definitions used by Legato.
 
const leStringVTable * fn
Definition: legato_string.h:109
 
virtual void destructor(leString *_this)
Destruct string.
 
LIB_EXPORT leResult leStringUtils_GetRectCStr(const char *str, const leFont *font, leRect *rect)
Gets the bounding rectangle for a C-style string.
Definition: legato_stringutils.c:128
 
int32_t leGetYGivenXOnLine(lePoint p1, lePoint p2, int32_t x)
Project Y give X.
Definition: legato_math.c:446
 
This structure represents a integer Cartesian point.
Definition: legato_common.h:357