46 #ifndef LEGATO_KEYPAD_H 47 #define LEGATO_KEYPAD_H 51 #if LE_KEYPAD_WIDGET_ENABLED == 1 && LE_BUTTON_WIDGET_ENABLED == 1 60 typedef struct leKeyPadWidget leKeyPadWidget;
61 typedef struct leButtonWidget leButtonWidget;
70 typedef void (* leKeyPadWidget_KeyClickEvent)(leKeyPadWidget*,
94 typedef enum leKeyPadCellAction
96 LE_KEYPAD_CELL_ACTION_NONE,
97 LE_KEYPAD_CELL_ACTION_APPEND,
98 LE_KEYPAD_CELL_ACTION_SET,
99 LE_KEYPAD_CELL_ACTION_BACKSPACE,
100 LE_KEYPAD_CELL_ACTION_CLEAR,
101 LE_KEYPAD_CELL_ACTION_ACCEPT
102 } leKeyPadCellAction;
117 typedef enum leKeyPadActionTrigger
119 LE_KEYPAD_TRIGGER_KEYRELEASED,
120 LE_KEYPAD_TRIGGER_KEYPRESSED,
121 } leKeyPadActionTrigger;
137 typedef struct leKeyPadCell
140 leButtonWidget* button;
142 leKeyPadCellAction
action;
152 #define LE_KEYPADWIDGET_VTABLE(THIS_TYPE) \ 153 LE_WIDGET_VTABLE(THIS_TYPE) \ 155 leResult (*setCellArraySize)(THIS_TYPE* _this, uint32_t rows, uint32_t cols); \ 156 leKeyPadActionTrigger (*getKeyPadActionTrigger)(const THIS_TYPE* _this); \ 157 leResult (*setKeyPadActionTrigger)(THIS_TYPE* _this, leKeyPadActionTrigger trg); \ 158 leKeyPadWidget_KeyClickEvent (*getKeyClickEventCallback)(const THIS_TYPE* _this); \ 159 leResult (*setKeyClickEventCallback)(THIS_TYPE* _this, leKeyPadWidget_KeyClickEvent cb); \ 160 leResult (*setKeyVisible)(THIS_TYPE* _this, uint32_t row, uint32_t col, leBool b); \ 161 leKeyPadCellAction (*getKeyAction)(const THIS_TYPE* _this, uint32_t row, uint32_t col); \ 162 leResult (*setKeyAction)(THIS_TYPE* _this, uint32_t row, uint32_t col, leKeyPadCellAction action); \ 163 leString* (*getKeyValue)(const THIS_TYPE* _this, uint32_t row, uint32_t col); \ 164 leResult (*setKeyValue)(THIS_TYPE* _this, uint32_t row, uint32_t col, const leString* val); \ 165 leButtonWidget* (*getCellButton)(const THIS_TYPE* _this, uint32_t row, uint32_t col); \ 167 typedef struct leKeyPadWidgetVTable
169 LE_KEYPADWIDGET_VTABLE(leKeyPadWidget)
170 } leKeyPadWidgetVTable;
185 typedef struct leKeyPadWidget
189 const leKeyPadWidgetVTable* fn;
194 leKeyPadActionTrigger trigger;
196 leKeyPadCell** cells;
198 leKeyPadWidget_KeyClickEvent clickEvt;
218 leKeyPadWidget* leKeyPadWidget_New(uint32_t rows,
235 void leKeyPadWidget_Constructor(leKeyPadWidget* wgt,
240 #define THIS_TYPE struct leWidget 294 virtual leKeyPadWidget_KeyClickEvent getKeyClickEventCallback(
const leKeyPadWidget* _this);
309 virtual leResult setKeyClickEventCallback(leKeyPadWidget* _this,
310 leKeyPadWidget_KeyClickEvent cb);
491 #endif // LE_WIDGET_KEYPAD_ENABLED && LE_WIDGET_BUTTON_ENABLED
Common macros and definitions used by Legato.
This struct represents a string.
Definition: legato_string.h:107
leResult
This enum represents function call results.
Definition: legato_common.h:123
leBool
This enum represents booleans.
Definition: legato_common.h:146
Fixed string functions and definitions.