 |
MPLABĀ® Harmony Graphics Suite
|
Go to the documentation of this file.
46 #ifndef LEGATO_KEYPAD_H
47 #define LEGATO_KEYPAD_H
51 #if LE_KEYPAD_WIDGET_ENABLED == 1 && LE_BUTTON_WIDGET_ENABLED == 1
56 typedef struct leKeyPadWidget leKeyPadWidget;
57 typedef struct leButtonWidget leButtonWidget;
66 typedef void (*leKeyPadWidget_KeyClickEvent)(leKeyPadWidget*,
90 typedef enum leKeyPadCellAction
92 LE_KEYPAD_CELL_ACTION_NONE,
93 LE_KEYPAD_CELL_ACTION_APPEND,
94 LE_KEYPAD_CELL_ACTION_SET,
95 LE_KEYPAD_CELL_ACTION_BACKSPACE,
96 LE_KEYPAD_CELL_ACTION_CLEAR,
97 LE_KEYPAD_CELL_ACTION_ACCEPT
113 typedef enum leKeyPadActionTrigger
115 LE_KEYPAD_TRIGGER_KEYRELEASED,
116 LE_KEYPAD_TRIGGER_KEYPRESSED,
117 } leKeyPadActionTrigger;
133 typedef struct leKeyPadCell
136 leButtonWidget* button;
138 leKeyPadCellAction action;
148 #define LE_KEYPADWIDGET_VTABLE(THIS_TYPE) \
149 LE_WIDGET_VTABLE(THIS_TYPE) \
151 leKeyPadActionTrigger (*getKeyPadActionTrigger)(const THIS_TYPE* _this); \
152 leResult (*setKeyPadActionTrigger)(THIS_TYPE* _this, leKeyPadActionTrigger trg); \
153 leKeyPadWidget_KeyClickEvent (*getKeyClickEventCallback)(const THIS_TYPE* _this); \
154 leResult (*setKeyClickEventCallback)(THIS_TYPE* _this, leKeyPadWidget_KeyClickEvent cb); \
155 leResult (*setKeyVisible)(THIS_TYPE* _this, uint32_t row, uint32_t col, leBool b); \
156 leKeyPadCellAction (*getKeyAction)(const THIS_TYPE* _this, uint32_t row, uint32_t col); \
157 leResult (*setKeyAction)(THIS_TYPE* _this, uint32_t row, uint32_t col, leKeyPadCellAction action); \
158 leString* (*getKeyValue)(const THIS_TYPE* _this, uint32_t row, uint32_t col); \
159 leResult (*setKeyValue)(THIS_TYPE* _this, uint32_t row, uint32_t col, const leString* val); \
160 leButtonWidget* (*getCellButton)(const THIS_TYPE* _this, uint32_t row, uint32_t col); \
162 typedef struct leKeyPadWidgetVTable
164 LE_KEYPADWIDGET_VTABLE(leKeyPadWidget)
165 } leKeyPadWidgetVTable;
180 typedef struct leKeyPadWidget
184 const leKeyPadWidgetVTable* fn;
189 leKeyPadActionTrigger trigger;
193 leKeyPadWidget_KeyClickEvent clickEvt;
213 LIB_EXPORT leKeyPadWidget* leKeyPadWidget_New(uint32_t rows,
230 LIB_EXPORT
void leKeyPadWidget_Constructor(leKeyPadWidget* wgt,
235 #define THIS_TYPE struct leWidget
289 virtual leKeyPadWidget_KeyClickEvent getKeyClickEventCallback(
const leKeyPadWidget* _this);
304 virtual leResult setKeyClickEventCallback(leKeyPadWidget* _this,
305 leKeyPadWidget_KeyClickEvent cb);
483 #endif // LE_WIDGET_KEYPAD_ENABLED && LE_WIDGET_BUTTON_ENABLED
Error functions, macros and definitions.
leResult
This enum represents function call results.
Definition: legato_common.h:134
This struct represents a rectangle.
Definition: legato_common.h:405
Memory functions and definitions.
This struct represents a string.
Definition: legato_string.h:108
leBool
This enum represents booleans.
Definition: legato_common.h:157
LIB_EXPORT leRect leRectClipAdj(const leRect *l_rect, const leRect *r_rect, leRect *adj)
Clips a rectangle to the space of another rectangle.
Definition: legato_rect.c:75
@ LE_FALSE
Definition: legato_common.h:158
General internal utilities for the library.
LIB_EXPORT leResult leImage_Draw(const leImage *img, const leRect *sourceRect, int32_t x, int32_t y, uint32_t a)
Draw an Image.
Definition: legato_image.c:131
Fixed string functions and definitions.
void leUtils_RectToScreenSpace(const leWidget *widget, leRect *rect)
Convert rectangle from widget local space to screen space.
Definition: legato_utils.c:151
The header file joins all header files used in the graphics object library.
@ LE_TRUE
Definition: legato_common.h:159
Common macros and definitions used by Legato.
void leUtils_ArrangeRectangle(leRect *sub, leRect obj, leRect bounds, leHAlignment hAlignment, leVAlignment vAlignment, leRelativePosition position, uint8_t leftMargin, uint8_t topMargin, uint8_t rightMargin, uint8_t bottomMargin, uint16_t rectMargin)
Calculates the position of a rectangle within the given bound.
Definition: legato_utils.c:213
virtual void destructor(leString *_this)
Destruct string.