MPLABĀ® Harmony Graphics Suite
legato_widget_list.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
23 
24 /*******************************************************************************
25  Module for Microchip Graphics Library - Legato User Interface Library
26 
27  Company:
28  Microchip Technology Inc.
29 
30  File Name:
31  legato_widget_list.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements list box widget functions.
38 *******************************************************************************/
39 
46 #ifndef LEGATO_LISTWIDGET_H
47 #define LEGATO_LISTWIDGET_H
48 
50 
51 #if LE_LIST_WIDGET_ENABLED == 1 && LE_SCROLLBAR_WIDGET_ENABLED == 1
52 
57 
58 
59 typedef struct leListWidget leListWidget;
60 
61 // *****************************************************************************
62 /* Function Pointer:
63  leListWidget_SelectedItemChangedEvent
64 
65  Summary:
66  Selected item changed event function callback type
67 */
72 typedef void (*leListWidget_SelectedItemChangedEvent)(leListWidget*,
73  uint32_t idx,
74  leBool selected);
75 
76 // *****************************************************************************
77 // *****************************************************************************
78 // Section: Data Types and Constants
79 // *****************************************************************************
80 // *****************************************************************************
81 
82 // *****************************************************************************
83 /* Enumeration:
84  leListWidget_SelectionMode
85 
86  Summary:
87  Defines the list selection modes
88 
89  Description:
90  Single - a single selection from the list is allowed at any one time
91  Multiple - any number of selected items is allowed at any one time
92  Contiguous - any number of selected items in a contiguous serious is allowed
93  at any one time
94 
95  Remarks:
96  None.
97 */
104 typedef enum leListWidget_SelectionMode
105 {
106  LE_LIST_WIDGET_SELECTION_MODE_SINGLE,
107  LE_LIST_WIDGET_SELECTION_MODE_MULTIPLE,
108  LE_LIST_WIDGET_SELECTION_MODE_CONTIGUOUS
109 } leListWidget_SelectionMode;
110 
111 // *****************************************************************************
112 /* Structure:
113  leListItem
114 
115  Summary:
116  Defines a list item struct
117 
118  Description:
119 
120 
121  Remarks:
122  None.
123 */
128 typedef struct leListItem
129 {
130  const leString* string; // list item string
131  const leImage* icon; // list item icon
132  leBool selected; // list item selected flag
133  leRect rowRect; // list item row rectangle
134  leBool enabled; //enable or disable the item
135 } leListItem;
136 
137 /* internal use only */
142 typedef struct leListWidget leListWidget;
143 
144 #define LE_LISTWIDGET_VTABLE(THIS_TYPE) \
145  LE_WIDGET_VTABLE(THIS_TYPE) \
146  \
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); \
177 
178 typedef struct leListWidgetVTable
179 {
180  LE_LISTWIDGET_VTABLE(leListWidget)
181 } leListWidgetVTable;
182 
188 // *****************************************************************************
196 typedef struct leListWidget
197 {
198  leWidget widget; // list base class
199 
200  const leListWidgetVTable* fn;
201 
202  leListWidget_SelectionMode mode; // list selection mode
203  leBool allowEmpty; // indicates if the list must always have at least one
204  // selected item
205 
206  leArray items; // list containing the list items
207 
208  leRelativePosition iconPos; // icon position for the list icons
209  uint32_t iconMargin; // margin for the list icons
210 
211  int32_t itemDown; // tracks whether an input event is in process
212 
213  leScrollBarWidget* scrollbar; // internal scrollbar for this widget
214 
215  leListWidget_SelectedItemChangedEvent cb; // item selected changed event
216 } leListWidget;
217 
218 // *****************************************************************************
219 // *****************************************************************************
220 // Section: Routines
221 // *****************************************************************************
222 // *****************************************************************************
223 
235 LIB_EXPORT leListWidget* leListWidget_New();
236 
247 LIB_EXPORT void leListWidget_Constructor(leListWidget* wgt);
248 
249 #ifdef _DOXYGEN_
250 #define THIS_TYPE struct leWidget
251 
252 
253 // *****************************************************************************
254 /* Virtual Member Function:
255  leListWidget_SelectionMode getSelectionMode(const leListWidget* _this)
256 
257  Summary:
258  Gets the current selection mode
259 
260  Description:
261  Gets the current selection mode
262 
263  Parameters:
264  const leListWidget* _this - The list widget to operate on
265 
266  Remarks:
267  Usage - _this->fn->getSelectionMode(_this);
268 
269  Returns:
270  leListWidget_SelectionMode -
271 */
282 virtual leListWidget_SelectionMode getSelectionMode(const leListWidget* _this);
283 
284 // *****************************************************************************
285 /* Virtual Member Function:
286  leResult setSelectionMode(leListWidget* _this,
287  leListWidget_SelectionMode mode)
288 
289  Summary:
290  Sets the current selection mode
291 
292  Description:
293  Sets the current selection mode
294 
295  Parameters:
296  leListWidget* _this - The list widget to operate on
297  leListWidget_SelectionMode mode -
298 
299  Remarks:
300  Usage - _this->fn->setSelectionMode(_this, mode);
301 
302  Returns:
303  leResult - the result of the operation
304 */
316 virtual leResult setSelectionMode(leListWidget* _this,
317  leListWidget_SelectionMode mode);
318 
319 
320 // *****************************************************************************
321 /* Virtual Member Function:
322  leBool getAllowEmptySelection(const leListWidget* _this)
323 
324  Summary:
325  Gets the allow empty setting value
326 
327  Description:
328  Gets the allow empty setting value
329 
330  Parameters:
331  const leListWidget* _this - The list widget to operate on
332 
333  Remarks:
334  Usage - _this->fn->getAllowEmptySelection(_this);
335 
336  Returns:
337  leBool - the setting value
338 */
349 virtual leBool getAllowEmptySelection(const leListWidget* _this);
350 
351 
352 // *****************************************************************************
353 /* Virtual Member Function:
354  leResult setAllowEmptySelection(leListWidget* _this,
355  leBool allow)
356 
357  Summary:
358  Sets the allow empty setting value
359 
360  Description:
361  Sets the allow empty setting value
362 
363  Parameters:
364  leListWidget* _this - The list widget to operate on
365  leBool allow - the setting value
366 
367  Remarks:
368  Usage - _this->fn->setAllowEmptySelection(_this, allow);
369 
370  Returns:
371  leResult - the result of the operation
372 */
384 virtual leResult setAllowEmptySelection(leListWidget* _this,
385  leBool allow);
386 
387 
388 // *****************************************************************************
389 /* Virtual Member Function:
390  leRelativePosition getIconPosition(const leListWidget* _this)
391 
392  Summary:
393  Gets the image icon position
394 
395  Description:
396  Gets the image icon position
397 
398  Parameters:
399  const leListWidget* _this - The list widget to operate on
400 
401  Remarks:
402  Usage - _this->fn->getIconPosition(_this);
403 
404  Returns:
405  leRelativePosition - the position
406 */
417 virtual leRelativePosition getIconPosition(const leListWidget* _this);
418 
419 // *****************************************************************************
420 /* Virtual Member Function:
421  leResult setIconPosition(leListWidget* _this,
422  leRelativePosition pos)
423 
424  Summary:
425  Sets the image icon position
426 
427  Description:
428  Sets the image icon position
429 
430  Parameters:
431  leListWidget* _this - The list widget to operate on
432  leRelativePosition pos - the position value
433 
434  Remarks:
435  Usage - _this->fn->setIconPosition(_this, pos);
436 
437  Returns:
438  leResult - the result of the operation
439 */
452 virtual leResult setIconPosition(leListWidget* _this,
453  leRelativePosition pos);
454 
455 
456 // *****************************************************************************
457 /* Virtual Member Function:
458  uint32_t getIconMargin(const leListWidget* _this)
459 
460  Summary:
461  Gets the icon margin
462 
463  Description:
464  Gets the icon margin
465 
466  Parameters:
467  const leListWidget* _this - The list widget to operate on
468 
469  Remarks:
470  Usage - _this->fn->getIconMargin(_this);
471 
472  Returns:
473  uint32_t - the margin value
474 */
485 virtual uint32_t getIconMargin(const leListWidget* _this);
486 
487 // *****************************************************************************
488 /* Virtual Member Function:
489  leResult setIconMargin(leListWidget* _this,
490  uint32_t mg)
491 
492  Summary:
493  Sets the icon margin
494 
495  Description:
496  Sets the icon margin
497 
498  Parameters:
499  leListWidget* _this - The list widget to operate on
500  uint32_t mg - the margin value
501 
502  Remarks:
503  Usage - _this->fn->setIconMargin(_this, mg);
504 
505  Returns:
506  leResult - the result of the operation
507 */
520 virtual leResult setIconMargin(leListWidget* _this,
521  uint32_t mg);
522 
523 
524 // *****************************************************************************
525 /* Virtual Member Function:
526  uint32_t getItemCount(const leListWidget* _this)
527 
528  Summary:
529  Gets the item count
530 
531  Description:
532  Gets the item count
533 
534  Parameters:
535  const leListWidget* _this - The list widget to operate on
536 
537  Remarks:
538  Usage - _this->fn->getItemCount(_this);
539 
540  Returns:
541  uint32_t - the item count
542 */
553 virtual uint32_t getItemCount(const leListWidget* _this);
554 
555 // *****************************************************************************
556 /* Virtual Member Function:
557  int32_t appendItem(leListWidget* _this)
558 
559  Summary:
560  Appends an item to the list
561 
562  Description:
563  Appends an item to the list
564 
565  Parameters:
566  leListWidget* _this - The list widget to operate on
567 
568  Remarks:
569  Usage - _this->fn->appendItem(_this);
570 
571  Returns:
572  int32_t - the index of the new item
573 */
584 virtual int32_t appendItem(leListWidget* _this);
585 
586 // *****************************************************************************
587 /* Virtual Member Function:
588  int32_t insertItem(leListWidget* _this,
589  int32_t idx)
590 
591  Summary:
592  Inserts an item into the list
593 
594  Description:
595  Inserts an item into the list
596 
597  Parameters:
598  leListWidget* _this - The list widget to operate on
599  int32_t idx - the index
600 
601  Remarks:
602  Usage - _this->fn->insertItem(_this, idx);
603 
604  Returns:
605  int32_t - the index of the new item
606 */
617 virtual int32_t insertItem(leListWidget* _this,
618  int32_t idx);
619 
620 // *****************************************************************************
621 /* Virtual Member Function:
622  leResult removeItem(leListWidget* _this,
623  int32_t idx)
624 
625  Summary:
626  Removes an item from the list
627 
628  Description:
629  Removes an item from the list
630 
631  Parameters:
632  leListWidget* _this - The list widget to operate on
633  int32_t idx - the index
634 
635  Remarks:
636  Usage - _this->fn->removeItem(_this, idx);
637 
638  Returns:
639  leResult - the result of the operation
640 */
653 virtual leResult removeItem(leListWidget* _this,
654  int32_t idx);
655 
656 
657 // *****************************************************************************
658 /* Virtual Member Function:
659  leResult removeAllItems(leListWidget* _this)
660 
661  Summary:
662  Removes all items from the list
663 
664  Description:
665  Removes all items from the list
666 
667  Parameters:
668  leListWidget* _this - The list widget to operate on
669 
670  Remarks:
671  Usage - _this->fn->removeAllItems(_this);
672 
673  Returns:
674  leResult - the result of the operation
675 */
686 virtual leResult removeAllItems(leListWidget* _this);
687 
688 
689 // *****************************************************************************
690 /* Virtual Member Function:
691  leBool getItemSelected(const leListWidget* _this,
692  int32_t idx)
693 
694  Summary:
695  Gets the currently selected item
696 
697  Description:
698  Gets the currently selected item
699 
700  Parameters:
701  const leListWidget* _this - The list widget to operate on
702  int32_t idx - the index
703 
704  Remarks:
705  Usage - _this->fn->getItemSelected(_this, idx);
706 
707  Returns:
708  leBool - the selected state
709 */
721 virtual leBool getItemSelected(const leListWidget* _this,
722  int32_t idx);
723 
724 // *****************************************************************************
725 /* Virtual Member Function:
726  leResult setItemSelected(leListWidget* _this,
727  int32_t idx,
728  leBool selected)
729 
730  Summary:
731  Sets the currently selected item
732 
733  Description:
734  Sets the currently selected item
735 
736  Parameters:
737  leListWidget* _this - The list widget to operate on
738  int32_t idx - the index
739  leBool selected - the selected state
740 
741  Remarks:
742  Usage - _this->fn->setItemSelected(_this, idx, selected);
743 
744  Returns:
745  leResult - the result of the operation
746 */
760 virtual leResult setItemSelected(leListWidget* _this,
761  int32_t idx,
762  leBool selected);
763 
764 
765 
766 // *****************************************************************************
767 /* Virtual Member Function:
768  leResult toggleItemSelected(leListWidget* _this,
769  int32_t idx)
770 
771  Summary:
772  Toggles an item selection
773 
774  Description:
775  Toggles an item selection
776 
777  Parameters:
778  leListWidget* _this - The list widget to operate on
779  int32_t idx - the index
780 
781  Remarks:
782  Usage - _this->fn->toggleItemSelected(_this, idx);
783 
784  Returns:
785  leResult - the result of the operation
786 */
798 virtual leResult toggleItemSelected(leListWidget* _this,
799  int32_t idx);
800 
801 // *****************************************************************************
802 /* Virtual Member Function:
803  leResult selectAll(leListWidget* _this)
804 
805  Summary:
806  Selects all items
807 
808  Description:
809  Selects all items
810 
811  Parameters:
812  leListWidget* _this - The list widget to operate on
813 
814  Remarks:
815  Usage - _this->fn->selectAll(_this);
816 
817  Returns:
818  leResult - the result of the operation
819 */
831 virtual leResult selectAll(leListWidget* _this);
832 
833 
834 // *****************************************************************************
835 /* Virtual Member Function:
836  leResult deselectAll(leListWidget* _this)
837 
838  Summary:
839  Deselects all items
840 
841  Description:
842  Deselects all items
843 
844  Parameters:
845  leListWidget* _this - The list widget to operate on
846 
847  Remarks:
848  Usage - _this->fn->deselectAll(_this);
849 
850  Returns:
851  leResult - the result of the operation
852 */
863 virtual leResult deselectAll(leListWidget* _this);
864 
865 
866 // *****************************************************************************
867 /* Virtual Member Function:
868  int32_t getFirstSelectedItem(const leListWidget* _this)
869 
870  Summary:
871  Gets the first selected item
872 
873  Description:
874  Gets the first selected item
875 
876  Parameters:
877  const leListWidget* _this - The list widget to operate on
878 
879  Remarks:
880  Usage - _this->fn->getFirstSelectedItem(_this);
881 
882  Returns:
883  int32_t - the selected item index
884 */
896 virtual int32_t getFirstSelectedItem(const leListWidget* _this);
897 
898 // *****************************************************************************
899 /* Virtual Member Function:
900  int32_t getLastSelectedItem(const leListWidget* _this)
901 
902  Summary:
903  Gets the last selected item
904 
905  Description:
906  Gets the last selected item
907 
908  Parameters:
909  const leListWidget* _this - The list widget to operate on
910 
911  Remarks:
912  Usage - _this->fn->getLastSelectedItem(_this);
913 
914  Returns:
915  int32_t - the selected item index
916 */
927 virtual int32_t getLastSelectedItem(const leListWidget* _this);
928 
929 // *****************************************************************************
930 /* Virtual Member Function:
931  uint32_t getSelectionCount(const leListWidget* _this)
932 
933  Summary:
934  Gets the number of selected items
935 
936  Description:
937  Gets the number of selected items
938 
939  Parameters:
940  const leListWidget* _this - The list widget to operate on
941 
942  Remarks:
943  Usage - _this->fn->getSelectionCount(_this);
944 
945  Returns:
946  uint32_t - the number of selected items
947 */
958 virtual uint32_t getSelectionCount(const leListWidget* _this);
959 
960 // *****************************************************************************
961 /* Virtual Member Function:
962  leString* getItemString(const leListWidget* _this,
963  int32_t idx)
964 
965  Summary:
966  Gets the string pointer for an item
967 
968  Description:
969  Gets the string pointer for an item
970 
971  Parameters:
972  const leListWidget* _this - The list widget to operate on
973  int32_t idx - the index
974 
975  Remarks:
976  Usage - _this->fn->getItemString(_this, idx);
977 
978  Returns:
979  leString* - the string pointer
980 */
991 virtual leString* getItemString(const leListWidget* _this,
992  int32_t idx);
993 
994 // *****************************************************************************
995 /* Virtual Member Function:
996  leResult setItemString(leListWidget* _this,
997  int32_t idx,
998  const leString* str)
999 
1000  Summary:
1001  Sets the string pointer for an item
1002 
1003  Description:
1004  Sets the string pointer for an item
1005 
1006  Parameters:
1007  leListWidget* _this - The list widget to operate on
1008  int32_t idx - the index
1009  const leString* str - the string pointer
1010 
1011  Remarks:
1012  Usage - _this->fn->setItemString(_this, idx, str);
1013 
1014  Returns:
1015  leResult - the result of the operation
1016 */
1032 virtual leResult setItemString(leListWidget* _this,
1033  int32_t idx,
1034  const leString* str);
1035 
1036 // *****************************************************************************
1037 /* Virtual Member Function:
1038  leImage* getItemIcon(const leListWidget* _this,
1039  int32_t idx)
1040 
1041  Summary:
1042  Gets the image pointer for an item
1043 
1044  Description:
1045  Gets the image pointer for an item
1046 
1047  Parameters:
1048  const leListWidget* _this - The list widget to operate on
1049  int32_t idx - the index
1050 
1051  Remarks:
1052  Usage - _this->fn->getItemIcon(_this, idx);
1053 
1054  Returns:
1055  leImage* - the image pointer
1056 */
1068 virtual leImage* getItemIcon(const leListWidget* _this,
1069  int32_t idx);
1070 
1071 // *****************************************************************************
1072 /* Virtual Member Function:
1073  leResult setItemIcon(leListWidget* _this,
1074  int32_t idx,
1075  const leImage* img)
1076 
1077  Summary:
1078  Sets the image pointer for an item
1079 
1080  Description:
1081  Sets the image pointer for an item
1082 
1083  Parameters:
1084  leListWidget* _this - The list widget to operate on
1085  int32_t idx - the index
1086  const leImage* img - the image pointer
1087 
1088  Remarks:
1089  Usage - _this->fn->setItemIcon(_this, idx, img);
1090 
1091  Returns:
1092  leResult - the result of the operation
1093 */
1108 virtual leResult setItemIcon(leListWidget* _this,
1109  int32_t idx,
1110  const leImage* img);
1111 
1112 // *****************************************************************************
1113 /* Virtual Member Function:
1114  leBool getItemEnable(const leListWidget* _this,
1115  int32_t idx)
1116 
1117  Summary:
1118  Gets an item enable state
1119 
1120  Description:
1121  Gets an item enable state
1122 
1123  Parameters:
1124  const leListWidget* _this - The list widget to operate on
1125  int32_t idx - the index
1126 
1127  Remarks:
1128  Usage - _this->fn->getItemEnable(_this, idx);
1129 
1130  Returns:
1131  leBool - the enable state
1132 */
1144 virtual leBool getItemEnable(const leListWidget* _this,
1145  int32_t idx);
1146 
1147 // *****************************************************************************
1148 /* Virtual Member Function:
1149  leResult setItemEnable(leListWidget* _this,
1150  int32_t idx,
1151  leBool b)
1152 
1153  Summary:
1154  Sets an item enable state
1155 
1156  Description:
1157  Sets an item enable state
1158 
1159  Parameters:
1160  leListWidget* _this - The list widget to operate on
1161  int32_t idx - the index
1162  leBool b - the enable state
1163 
1164  Remarks:
1165  Usage - _this->fn->setItemEnable(_this, idx, b);
1166 
1167  Returns:
1168  leResult - the result of the operation
1169 */
1184 virtual leResult setItemEnable(leListWidget* _this,
1185  int32_t idx,
1186  leBool b);
1187 
1188 
1189 
1200 virtual leListWidget_SelectedItemChangedEvent getSelectedItemChangedEventCallback
1201  (const leListWidget* _this);
1202 
1216 virtual leResult setSelectedItemChangedEventCallback(leListWidget* _this,
1217  leListWidget_SelectedItemChangedEvent cb);
1218 
1219 #undef THIS_TYPE
1220 #endif
1221 
1222 
1223 #endif // LE_LIST_WIDGET_ENABLED && LE_SCROLLBAR_WIDGET_ENABLED
1224 #endif /* LEGATO_LISTWIDGET_H */
_leWidget_SetAlphaAmount
leResult _leWidget_SetAlphaAmount(leWidget *_this, uint32_t alpha)
Set alpha amount.
Definition: legato_widget.c:570
legato_math.h
Defines common math functions for general use.
legato_error.h
Error functions, macros and definitions.
_leWidget_GetType
leWidgetType _leWidget_GetType(const leWidget *_this)
Get widget type.
Definition: legato_widget.c:176
_leWidget_GetScheme
leScheme * _leWidget_GetScheme(const leWidget *_this)
Get widget scheme.
Definition: legato_widget.c:938
leResult
leResult
This enum represents function call results.
Definition: legato_common.h:134
leArray_RemoveAt
leResult leArray_RemoveAt(leArray *arr, uint32_t idx)
Remove value at index.
Definition: legato_array.c:197
_leWidget_RectToScreenSpace
leRect _leWidget_RectToScreenSpace(const leWidget *_this)
Get widget rectangle.
Definition: legato_widget.c:701
leRect
This struct represents a rectangle.
Definition: legato_common.h:405
_leWidget_IsOpaque
leBool _leWidget_IsOpaque(const leWidget *_this)
Determine is widget is opaque.
Definition: legato_widget.c:594
_leWidget_SetBorderType
leResult _leWidget_SetBorderType(leWidget *_this, leBorderType type)
Set widget scheme.
Definition: legato_widget.c:967
_leWidget_RemoveAllChildren
void _leWidget_RemoveAllChildren(leWidget *_this)
Remove all children from widget.
Definition: legato_widget.c:823
_leWidget_SetParent
leResult _leWidget_SetParent(leWidget *_this, leWidget *parent)
Set parent widget.
Definition: legato_widget.c:862
leWidgetEvent_TouchUp
Used to define widget touch up event.
Definition: legato_widget.h:403
legato_image.h
Image functions and defintions.
_leWidget_InvalidateContents
void _leWidget_InvalidateContents(const leWidget *_this)
Invalidate widget contents.
Definition: legato_widget.c:1210
_leWidget_SetCornerRadius
leResult _leWidget_SetCornerRadius(leWidget *_this, uint32_t radius)
Set widget scheme.
Definition: legato_widget.c:1091
_leWidget_InstallEventFilter
leResult _leWidget_InstallEventFilter(leWidget *_this, leWidgetEventFilter fltr)
Install event filter.
Definition: legato_widget.c:1215
_leWidget_SetX
leResult _leWidget_SetX(leWidget *_this, int32_t x)
Set widget x position.
Definition: legato_widget.c:190
_leWidget_SetSize
leResult _leWidget_SetSize(leWidget *_this, uint32_t width, uint32_t height)
Set widget height.
Definition: legato_widget.c:381
_leWidget_HasFocus
leBool _leWidget_HasFocus(const leWidget *_this)
Determines the focus status.
Definition: legato_widget.c:1110
legato_memory.h
Memory functions and definitions.
_leWidget_Resize
leResult _leWidget_Resize(leWidget *_this, int32_t width, int32_t height)
Resize widget.
Definition: legato_widget.c:426
_leWidget_SetAlphaEnabled
leResult _leWidget_SetAlphaEnabled(leWidget *_this, leBool enable)
Set cumulative alpha enable status.
Definition: legato_widget.c:501
leArray_PushBack
leResult leArray_PushBack(leArray *arr, void *val)
Push value on back.
Definition: legato_array.c:147
leWidgetEvent_TouchDown
Used to define widget touch down event.
Definition: legato_widget.h:377
_leWidget_ContainsDescendant
leBool _leWidget_ContainsDescendant(const leWidget *_this, const leWidget *wgt)
Determine widget exists.
Definition: legato_widget.c:910
_leWidget_SetBackgroundType
leResult _leWidget_SetBackgroundType(leWidget *_this, leBackgroundType type)
Set widget scheme.
Definition: legato_widget.c:989
legato_widget_list.h
List widget functions and definitions.
_leWidget_GetWidth
uint32_t _leWidget_GetWidth(const leWidget *_this)
Get widget width.
Definition: legato_widget.c:317
leImage
Definition: legato_image.h:180
_leWidget_GetCumulativeAlphaEnabled
leBool _leWidget_GetCumulativeAlphaEnabled(const leWidget *_this)
Get cumulative alpha enable status.
Definition: legato_widget.c:484
_leWidget_RectToParentSpace
leRect _leWidget_RectToParentSpace(const leWidget *_this)
Get widget rectangle.
Definition: legato_widget.c:684
_leWidget_Translate
leResult _leWidget_Translate(leWidget *_this, int32_t x, int32_t y)
Translate widget x and y position.
Definition: legato_widget.c:282
legato_renderer.h
legato_string_renderer.h
String Renderer.
_leWidget_SetHeight
leResult _leWidget_SetHeight(leWidget *_this, uint32_t height)
Set widget height.
Definition: legato_widget.c:356
_leWidget_SetWidth
leResult _leWidget_SetWidth(leWidget *_this, uint32_t width)
Set the widget width.
Definition: legato_widget.c:324
leWidget_ResizeEvent
Used to define widget resize event.
Definition: legato_widget.h:329
LE_WIDGET_BACKGROUND_FILL
@ LE_WIDGET_BACKGROUND_FILL
Definition: legato_widget.h:226
_leWidget_SetVisible
leResult _leWidget_SetVisible(leWidget *_this, leBool visible)
Set widget visible status.
Definition: legato_widget.c:649
_leWidget_GetRootWidget
leWidget * _leWidget_GetRootWidget(const leWidget *_this)
Get root widget.
Definition: legato_widget.c:843
_leWidget_Update
void _leWidget_Update(leWidget *_this, uint32_t dt)
Update widget.
Definition: legato_widget.c:1491
LE_HALIGN_CENTER
@ LE_HALIGN_CENTER
Definition: legato_common.h:208
leArray
This struct represents a array.
Definition: legato_array.h:61
legato_widget.h
Legato widget definitions.
leArray_Create
leResult leArray_Create(leArray *arr)
Create a new array.
Definition: legato_array.c:73
_leWidget_GetHAlignment
leHAlignment _leWidget_GetHAlignment(const leWidget *_this)
Get widget horizontal alignment.
Definition: legato_widget.c:1003
_leWidget_GetHeight
uint32_t _leWidget_GetHeight(const leWidget *_this)
Get widget height.
Definition: legato_widget.c:349
leString
This struct represents a string.
Definition: legato_string.h:108
_leWidget_LocalRect
leRect _leWidget_LocalRect(const leWidget *_this)
Get widget rectangle.
Definition: legato_widget.c:670
legato_widget_scrollbar.h
Scrollbar functions and definitions.
leArray_InsertAt
leResult leArray_InsertAt(leArray *arr, uint32_t idx, void *val)
Insert value at index.
Definition: legato_array.c:174
leBool
leBool
This enum represents booleans.
Definition: legato_common.h:157
_leWidget_GetBackgroundType
leBackgroundType _leWidget_GetBackgroundType(const leWidget *_this)
Get widget background type.
Definition: legato_widget.c:982
_leWidget_SetScheme
leResult _leWidget_SetScheme(leWidget *_this, const leScheme *scheme)
Set widget scheme.
Definition: legato_widget.c:945
_leWidget_SetHAlignment
leResult _leWidget_SetHAlignment(leWidget *_this, leHAlignment align)
Set widget scheme.
Definition: legato_widget.c:1010
_leWidget_GetEnabled
leBool _leWidget_GetEnabled(const leWidget *_this)
Get widget enabled flag.
Definition: legato_widget.c:615
length
virtual uint32_t length(const leString *_this)
Get length of the string.
_leWidget_SetFocus
leResult _leWidget_SetFocus(leWidget *_this)
Set widget scheme.
Definition: legato_widget.c:1117
LE_FALSE
@ LE_FALSE
Definition: legato_common.h:158
_leWidget_GetAlphaEnabled
leBool _leWidget_GetAlphaEnabled(const leWidget *_this)
Get alpha enable status.
Definition: legato_widget.c:473
leRectContainsPoint
LIB_EXPORT leBool leRectContainsPoint(const leRect *rect, const lePoint *point)
Determines if a point is inside a rectangle.
Definition: legato_rect.c:31
_leWidget_GetChildAtIndex
leWidget * _leWidget_GetChildAtIndex(const leWidget *_this, uint32_t idx)
Get child at index.
Definition: legato_widget.c:888
leWidgetEvent
Used to define widget event.
Definition: legato_widget.h:352
_leWidget_GetCumulativeAlphaAmount
uint32_t _leWidget_GetCumulativeAlphaAmount(const leWidget *_this)
Get cumulative alpha amount.
Definition: legato_widget.c:538
_leWidget_SetY
leResult _leWidget_SetY(leWidget *_this, int32_t y)
Set widget y position.
Definition: legato_widget.c:222
_leWidget_GetBorderType
leBorderType _leWidget_GetBorderType(const leWidget *_this)
Get widget bordertype.
Definition: legato_widget.c:960
_leWidget_SetMargins
leResult _leWidget_SetMargins(leWidget *_this, uint32_t l, uint32_t t, uint32_t r, uint32_t b)
Set widget margins.
Definition: legato_widget.c:1058
legato_utils.h
General internal utilities for the library.
_leWidget_GetVAlignment
leVAlignment _leWidget_GetVAlignment(const leWidget *_this)
Get widget vertical alignment.
Definition: legato_widget.c:1027
legato_string.h
Fixed string functions and definitions.
leArray_Clear
leResult leArray_Clear(leArray *arr)
Clear array.
Definition: legato_array.c:279
leCStringRenderRequest
This struct represents a c-style string render request.
Definition: legato_string_renderer.h:128
LE_RELATIVE_POSITION_RIGHTOF
@ LE_RELATIVE_POSITION_RIGHTOF
Definition: legato_common.h:317
LE_WIDGET_BACKGROUND_NONE
@ LE_WIDGET_BACKGROUND_NONE
Definition: legato_widget.h:225
leWidget
Used to define a widget.
Definition: legato_widget.h:623
legato_stringutils.h
String utility functions and definitions.
legato.h
The header file joins all header files used in the graphics object library.
_leWidget_GetX
int32_t _leWidget_GetX(const leWidget *_this)
Get widget x position.
Definition: legato_widget.c:183
_leWidget_SetVAlignment
leResult _leWidget_SetVAlignment(leWidget *_this, leVAlignment align)
Set widget vertical alignment.
Definition: legato_widget.c:1034
_leWidget_GetVisible
leBool _leWidget_GetVisible(const leWidget *_this)
Get widget visible status.
Definition: legato_widget.c:642
leWidgetEvent_TouchMove
Used to define widget touch move event.
Definition: legato_widget.h:429
_leWidget_AddChild
leResult _leWidget_AddChild(leWidget *_this, leWidget *child)
Add child to widget.
Definition: legato_widget.c:734
_leWidget_GetIndexOfChild
uint32_t _leWidget_GetIndexOfChild(const leWidget *_this, const leWidget *child)
Get index of child.
Definition: legato_widget.c:899
leArray_Get
void * leArray_Get(const leArray *arr, uint32_t idx)
Get entry at index.
Definition: legato_array.c:224
_leWidget_GetChildCount
uint32_t _leWidget_GetChildCount(const leWidget *_this)
Get child count.
Definition: legato_widget.c:881
LE_RELATIVE_POSITION_LEFTOF
@ LE_RELATIVE_POSITION_LEFTOF
Definition: legato_common.h:314
_leWidget_GetMargins
leMargin _leWidget_GetMargins(const leWidget *_this)
Get widget margins.
Definition: legato_widget.c:1051
leStringRenderer_DrawCString
leResult leStringRenderer_DrawCString(leCStringRenderRequest *req)
Draw leChar string.
Definition: legato_string_renderer.c:297
leWidget_Constructor
LIB_EXPORT void leWidget_Constructor(leWidget *wgt)
Initialize widget.
Definition: legato_widget.c:67
leScheme_GetRenderColor
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
leRelativePosition
This enum represents the relative position modes for objects.
Definition: legato_common.h:313
LE_TRUE
@ LE_TRUE
Definition: legato_common.h:159
_leWidget_GetAlphaAmount
uint32_t _leWidget_GetAlphaAmount(const leWidget *_this)
Get alpha amount.
Definition: legato_widget.c:527
_leWidget_GetCornerRadius
uint32_t _leWidget_GetCornerRadius(const leWidget *_this)
Get widget corner radius.
Definition: legato_widget.c:1084
legato_common.h
Common macros and definitions used by Legato.
_leWidget_RemoveEventFilter
leResult _leWidget_RemoveEventFilter(leWidget *_this, leWidgetEventFilter fltr)
Remove event filter.
Definition: legato_widget.c:1238
leString::fn
const leStringVTable * fn
Definition: legato_string.h:109
_leWidget_RemoveChild
leResult _leWidget_RemoveChild(leWidget *_this, leWidget *child)
Remove child from widget.
Definition: legato_widget.c:785
destructor
virtual void destructor(leString *_this)
Destruct string.
legato_widget_line_graph.h
Line draw functions and definitions.
leStringUtils_GetRectCStr
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
_leWidget_SetEnabled
leResult _leWidget_SetEnabled(leWidget *_this, leBool enable)
Set widget enabled flag.
Definition: legato_widget.c:620
_leWidget_SetPosition
leResult _leWidget_SetPosition(leWidget *_this, int32_t x, int32_t y)
Set widget x and y position.
Definition: legato_widget.c:247
leGetYGivenXOnLine
int32_t leGetYGivenXOnLine(lePoint p1, lePoint p2, int32_t x)
Project Y give X.
Definition: legato_math.c:446
_leWidget_Invalidate
void _leWidget_Invalidate(const leWidget *_this)
Invalidate widget.
Definition: legato_widget.c:1142
lePoint
This structure represents a integer Cartesian point.
Definition: legato_common.h:357
_leWidget_GetY
int32_t _leWidget_GetY(const leWidget *_this)
Get widget y position.
Definition: legato_widget.c:215