46 #ifndef LEGATO_TEXTFIELD_H 47 #define LEGATO_TEXTFIELD_H 51 #if LE_TEXTFIELD_WIDGET_ENABLED == 1 60 typedef struct leTextFieldWidget leTextFieldWidget;
73 typedef void (* leTextFieldWidget_TextChangedCallback)(leTextFieldWidget*);
86 typedef void (* leTextFieldWidget_FocusChangedCallback)(leTextFieldWidget*,
leBool);
88 typedef struct leTextFieldWidget leTextFieldWidget;
94 #define LE_TEXTFIELDWIDGET_VTABLE(THIS_TYPE) \ 95 LE_EDITWIDGET_VTABLE(THIS_TYPE) \ 97 uint32_t (*getCursorDelay)(const THIS_TYPE* _this); \ 98 leResult (*setCursorDelay)(THIS_TYPE* _this, uint32_t dt); \ 99 leBool (*getCursorEnabled)(const THIS_TYPE* _this); \ 100 leResult (*setCursorEnabled)(THIS_TYPE* _this, leBool en); \ 101 uint32_t (*getCursorPosition)(const THIS_TYPE* _this); \ 102 leResult (*setCursorPosition)(THIS_TYPE* _this, uint32_t pos); \ 103 const leString* (*getString)(const THIS_TYPE* txt); \ 104 leResult (*setString)(THIS_TYPE* _this, const leString* str); \ 105 leFont* (*getFont)(const THIS_TYPE* _this); \ 106 leResult (*setFont)(THIS_TYPE* _this, const leFont* fnt); \ 107 leString* (*getHintString)(const THIS_TYPE* txt); \ 108 leResult (*setHintString)(THIS_TYPE* _this, const leString* str); \ 109 leResult (*setClearValueOnFirstEdit)(THIS_TYPE* _this, leBool clr); \ 110 leTextFieldWidget_TextChangedCallback (*getTextChangedEventCallback)(const THIS_TYPE* _this); \ 111 leResult (*setTextChangedEventCallback)(THIS_TYPE* _this, leTextFieldWidget_TextChangedCallback cb); \ 112 leTextFieldWidget_FocusChangedCallback (*getFocusChangedEventCallback)(const THIS_TYPE* _this); \ 113 leResult (*setFocusChangedEventCallback)(THIS_TYPE* _this, leTextFieldWidget_FocusChangedCallback cb); \ 115 typedef struct leTextFieldWidgetVTable
117 LE_TEXTFIELDWIDGET_VTABLE(leTextFieldWidget)
118 } leTextFieldWidgetVTable;
136 typedef struct leTextFieldWidget
140 const leTextFieldWidgetVTable* fn;
146 uint32_t cursorDelay;
152 leTextFieldWidget_TextChangedCallback textChangedEvent;
153 leTextFieldWidget_FocusChangedCallback focusChangedEvent;
173 leTextFieldWidget* leTextFieldWidget_New(
void);
185 void leTextFieldWidget_Constructor(leTextFieldWidget* wgt);
188 #define THIS_TYPE struct leWidget 202 virtual uint32_t getCursorDelay(
const leTextFieldWidget* _this);
218 virtual leResult setCursorDelay(leTextFieldWidget* _this,
232 virtual leBool getCursorEnabled(
const leTextFieldWidget* _this);
247 virtual leResult setCursorEnabled(leTextFieldWidget* _this,
262 virtual uint32_t getCursorPosition(
const leTextFieldWidget* _this);
278 virtual leResult setCursorPosition(leTextFieldWidget* _this,
294 virtual const leString* getString(
const leTextFieldWidget* txt);
310 virtual leResult setString(leTextFieldWidget* _this,
355 virtual leString* getHintString(
const leTextFieldWidget* _this);
371 virtual leResult setHintString(leTextFieldWidget* _this,
388 virtual leResult setClearValueOnFirstEdit(leTextFieldWidget* _this,
402 virtual leTextFieldWidget_TextChangedCallback getTextChangedEventCallback
403 (
const leTextFieldWidget* _this);
418 virtual leResult setTextChangedEventCallback(leTextFieldWidget* _this,
419 leTextFieldWidget_TextChangedCallback cb);
431 virtual leTextFieldWidget_FocusChangedCallback getFocusChangedEventCallback
432 (
const leTextFieldWidget* _this);
447 virtual leResult setFocusChangedEventCallback(leTextFieldWidget* _this,
448 leTextFieldWidget_FocusChangedCallback cb);
457 #endif // LE_TEXTFIELD_WIDGET_ENABLED Common macros and definitions used by Legato.
This struct represents a string.
Definition: legato_string.h:107
This struct represents a dynamic string.
Definition: legato_dynamicstring.h:59
virtual leResult setFont(leString *_this, const leFont *font)
Set font.
This struct represents a font object.
Definition: legato_font.h:156
leResult
This enum represents function call results.
Definition: legato_common.h:123
Dynamic string functions and definitions.
leBool
This enum represents booleans.
Definition: legato_common.h:146
virtual leFont * getFont(const leString *_this)
Get font.