46 #ifndef LEGATO_LISTWIDGET_H 47 #define LEGATO_LISTWIDGET_H 51 #if LE_LIST_WIDGET_ENABLED == 1 && LE_SCROLLBAR_WIDGET_ENABLED == 1 62 typedef struct leListWidget leListWidget;
75 typedef void (* leListWidget_SelectedItemChangedEvent)(leListWidget*,
107 typedef enum leListWidget_SelectionMode
109 LE_LIST_WIDGET_SELECTION_MODE_SINGLE,
110 LE_LIST_WIDGET_SELECTION_MODE_MULTIPLE,
111 LE_LIST_WIDGET_SELECTION_MODE_CONTIGUOUS
112 } leListWidget_SelectionMode;
131 typedef struct leListItem
145 typedef struct leListWidget leListWidget;
147 #define LE_LISTWIDGET_VTABLE(THIS_TYPE) \ 148 LE_WIDGET_VTABLE(THIS_TYPE) \ 150 leListWidget_SelectionMode (*getSelectionMode)(const THIS_TYPE* _this); \ 151 leResult (*setSelectionMode)(THIS_TYPE* _this, leListWidget_SelectionMode mode); \ 152 leBool (*getAllowEmptySelection)(const THIS_TYPE* _this); \ 153 leResult (*setAllowEmptySelection)(THIS_TYPE* _this, leBool allow); \ 154 leRelativePosition (*getIconPosition)(const THIS_TYPE* _this); \ 155 leResult (*setIconPosition)(THIS_TYPE* _this, leRelativePosition pos); \ 156 uint32_t (*getIconMargin)(const THIS_TYPE* _this); \ 157 leResult (*setIconMargin)(THIS_TYPE* _this, uint32_t mg); \ 158 uint32_t (*getItemCount)(const THIS_TYPE* _this); \ 159 int32_t (*appendItem)(THIS_TYPE* _this); \ 160 int32_t (*insertItem)(THIS_TYPE* _this, int32_t idx); \ 161 leResult (*removeItem)(THIS_TYPE* _this, int32_t idx); \ 162 leResult (*removeAllItems)(THIS_TYPE* _this); \ 163 leBool (*getItemSelected)(const THIS_TYPE* _this, int32_t idx); \ 164 leResult (*setItemSelected)(THIS_TYPE* _this, int32_t idx, leBool selected); \ 165 leResult (*toggleItemSelected)(THIS_TYPE* _this, int32_t idx); \ 166 leResult (*selectAll)(THIS_TYPE* _this); \ 167 leResult (*deselectAll)(THIS_TYPE* _this); \ 168 int32_t (*getFirstSelectedItem)(const THIS_TYPE* _this); \ 169 int32_t (*getLastSelectedItem)(const THIS_TYPE* _this); \ 170 uint32_t (*getSelectionCount)(const THIS_TYPE* _this); \ 171 leString* (*getItemString)(const THIS_TYPE* _this, int32_t idx); \ 172 leResult (*setItemString)(THIS_TYPE* _this, int32_t idx, const leString* str); \ 173 leImage* (*getItemIcon)(const THIS_TYPE* _this, int32_t idx); \ 174 leResult (*setItemIcon)(THIS_TYPE* _this, int32_t idx, const leImage* img); \ 175 leBool (*getItemEnable)(const THIS_TYPE* _this, int32_t idx); \ 176 leResult (*setItemEnable)(THIS_TYPE* _this, int32_t idx, leBool b); \ 177 leResult (*setItemVisible)(THIS_TYPE* _this, int32_t idx); \ 178 leListWidget_SelectedItemChangedEvent (*getSelectedItemChangedEventCallback)(const THIS_TYPE* _this); \ 179 leResult (*setSelectedItemChangedEventCallback)(THIS_TYPE* _this, leListWidget_SelectedItemChangedEvent cb); \ 181 typedef struct leListWidgetVTable
183 LE_LISTWIDGET_VTABLE(leListWidget)
184 } leListWidgetVTable;
199 typedef struct leListWidget
203 const leListWidgetVTable* fn;
205 leListWidget_SelectionMode mode;
216 leScrollBarWidget* scrollbar;
218 leListWidget_SelectedItemChangedEvent cb;
238 leListWidget* leListWidget_New(
void);
250 void leListWidget_Constructor(leListWidget* wgt);
253 #define THIS_TYPE struct leWidget 285 virtual leListWidget_SelectionMode getSelectionMode(
const leListWidget* _this);
319 virtual leResult setSelectionMode(leListWidget* _this,
320 leListWidget_SelectionMode mode);
352 virtual leBool getAllowEmptySelection(
const leListWidget* _this);
387 virtual leResult setAllowEmptySelection(leListWidget* _this,
455 virtual leResult setIconPosition(leListWidget* _this,
488 virtual uint32_t getIconMargin(
const leListWidget* _this);
523 virtual leResult setIconMargin(leListWidget* _this,
556 virtual uint32_t getItemCount(
const leListWidget* _this);
587 virtual int32_t appendItem(leListWidget* _this);
620 virtual int32_t insertItem(leListWidget* _this,
656 virtual leResult removeItem(leListWidget* _this,
689 virtual leResult removeAllItems(leListWidget* _this);
724 virtual leBool getItemSelected(
const leListWidget* _this,
763 virtual leResult setItemSelected(leListWidget* _this,
801 virtual leResult toggleItemSelected(leListWidget* _this,
834 virtual leResult selectAll(leListWidget* _this);
866 virtual leResult deselectAll(leListWidget* _this);
899 virtual int32_t getFirstSelectedItem(
const leListWidget* _this);
930 virtual int32_t getLastSelectedItem(
const leListWidget* _this);
961 virtual uint32_t getSelectionCount(
const leListWidget* _this);
994 virtual leString* getItemString(
const leListWidget* _this,
1035 virtual leResult setItemString(leListWidget* _this,
1071 virtual leImage* getItemIcon(
const leListWidget* _this,
1111 virtual leResult setItemIcon(leListWidget* _this,
1147 virtual leBool getItemEnable(
const leListWidget* _this,
1187 virtual leResult setItemEnable(leListWidget* _this,
1203 virtual leListWidget_SelectedItemChangedEvent getSelectedItemChangedEventCallback
1204 (
const leListWidget* _this);
1219 virtual leResult setSelectedItemChangedEventCallback(leListWidget* _this,
1220 leListWidget_SelectedItemChangedEvent cb);
1229 #endif // LE_LIST_WIDGET_ENABLED && LE_SCROLLBAR_WIDGET_ENABLED Common macros and definitions used by Legato.
Image functions and defintions.
Definition: legato_image.h:181
This struct represents a string.
Definition: legato_string.h:107
leResult
This enum represents function call results.
Definition: legato_common.h:123
This struct represents a rectangle.
Definition: legato_common.h:394
This struct represents a array.
Definition: legato_array.h:64
leRelativePosition
This enum represents the relative position modes for objects.
Definition: legato_common.h:302
leBool
This enum represents booleans.
Definition: legato_common.h:146
Fixed string functions and definitions.