MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_editwidget.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_editwidget.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements the routines to enable edit of library widgets.
38 *******************************************************************************/
39 
46 #ifndef LEGATO_EDITWIDGET_H
47 #define LEGATO_EDITWIDGET_H
48 
52 
53 // DOM-IGNORE-BEGIN
54 typedef struct leEditWidget leEditWidget;
55 
56 #define LE_EDITWIDGET_VTABLE(THIS_TYPE) \
57  LE_WIDGET_VTABLE(THIS_TYPE) \
58  \
59  leResult (*editStart)(THIS_TYPE* _this); \
60  void (*editEnd)(THIS_TYPE* _this); \
61  void (*editClear)(THIS_TYPE* _this); \
62  void (*editAccept)(THIS_TYPE* _this); \
63  void (*editSet)(THIS_TYPE* _this, const leString* str); \
64  void (*editAppend)(THIS_TYPE* _this, const leString* str); \
65  void (*editBackspace)(THIS_TYPE* _this); \
66 
67 typedef struct leEditWidgetVTable
68 {
69  LE_EDITWIDGET_VTABLE(leEditWidget)
71 
72 // DOM-IGNORE-END
73 
74 /* Structure:
75  leEditWidget
76 
77  Summary:
78  Specifies the edit widget structure to manage all properties and events
79  associated with edit widgets
80 
81  Description:
82  Edit widgets are a subset of normal widgets that are capable of receiving
83  edit events from the UI kernel. Specialized widgets are capable of
84  broadcasting edit events and the active edit event will react to them.
85 
86  Remarks:
87  None.
88 
89 */
90 typedef struct leEditWidget
91 {
93 
94  const leEditWidgetVTable* fn;
95 
96 } leEditWidget;
97 
98 // *****************************************************************************
99 /* Virtual Member Function:
100  leResult editStart(leEditWidget* _this)
101 
102  Summary:
103  Start editing command
104 
105  Description:
106  Start editing command
107 
108  Parameters:
109  leEditWidget* _this - The edit widget to operate on
110 
111  Remarks:
112  Usage - _this->fn->editStart(_this);
113 
114  Returns:
115  leResult - the result of the operation
116 */
117 leResult _leEditWidget_EditStart(leEditWidget* _this);
118 
119 // *****************************************************************************
120 /* Virtual Member Function:
121  void editEnd(leEditWidget* _this)
122 
123  Summary:
124  End editing command
125 
126  Description:
127  End editing command
128 
129  Parameters:
130  leEditWidget* _this - The edit widget to operate on
131 
132  Remarks:
133  Usage - _this->fn->editEnd(_this);
134 
135  Returns:
136  void
137 */
138 void _leEditWidget_EditEnd(leEditWidget* _this);
139 
140 // *****************************************************************************
141 /* Virtual Member Function:
142  void editClear(leEditWidget* _this)
143 
144  Summary:
145  Clear command
146 
147  Description:
148  Clear command
149 
150  Parameters:
151  leEditWidget* _this - The edit widget to operate on
152 
153  Remarks:
154  Usage - _this->fn->editClear(_this);
155 
156  Returns:
157  void
158 */
159 void _leEditWidget_EditClear(leEditWidget* _this);
160 
161 // *****************************************************************************
162 /* Virtual Member Function:
163  void editAccept(leEditWidget* _this)
164 
165  Summary:
166  Accept command
167 
168  Description:
169  Accept command
170 
171  Parameters:
172  leEditWidget* _this - The edit widget to operate on
173 
174  Remarks:
175  Usage - _this->fn->editAccept(_this);
176 
177  Returns:
178  void
179 */
180 void _leEditWidget_EditAccept(leEditWidget* _this);
181 
182 // *****************************************************************************
183 /* Virtual Member Function:
184  void editSet(leEditWidget* _this,
185  const leString* str)
186 
187  Summary:
188  Set command
189 
190  Description:
191  Set command
192 
193  Parameters:
194  leEditWidget* _this - The edit widget to operate on
195  const leString* str - the string pointer
196 
197  Remarks:
198  Usage - _this->fn->editSet(_this, str);
199 
200  Returns:
201  void
202 */
203 void _leEditWidget_EditSet(leEditWidget* _this,
204  const leString* str);
205 
206 // *****************************************************************************
207 /* Virtual Member Function:
208  void editAppend(leEditWidget* _this,
209  const leString* str)
210 
211  Summary:
212  Append command
213 
214  Description:
215  Append command
216 
217  Parameters:
218  leEditWidget* _this - The edit widget to operate on
219  const leString* str - the string pointer
220 
221  Remarks:
222  Usage - _this->fn->editAppend(_this, str);
223 
224  Returns:
225  void
226 */
227 void _leEditWidget_EditAppend(leEditWidget* _this,
228  const leString* str);
229 
230 // *****************************************************************************
231 /* Virtual Member Function:
232  void editBackspace(leEditWidget* _this)
233 
234  Summary:
235  Backspace command
236 
237  Description:
238  Backspace command
239 
240  Parameters:
241  leEditWidget* _this - The edit widget to operate on
242 
243  Remarks:
244  Usage - _this->fn->editBackspace(_this);
245 
246  Returns:
247  void
248 */
249 void _leEditWidget_EditBackspace(leEditWidget* _this);
250 
251 
252 // DOM-IGNORE-BEGIN
253 leResult _leEditWidget_StartEdit(void);
254 void _leEditWidget_EndEdit(void);
255 
256 void _leEditWidget_Clear(void);
257 void _leEditWidget_Accept(void);
258 void _leEditWidget_Set(const leString* str);
259 void _leEditWidget_Append(const leString* str);
260 void _leEditWidget_Backspace(void);
261 // DOM-IGNORE-END
262 
263 #endif // LEGATO_EDITWIDGET_H
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
Used to define a widget.
Definition: legato_widget.h:624
Definition: legato_editwidget.h:67
Legato widget definitions.
Definition: legato_editwidget.h:90
Definition: widget.py:1
Fixed string functions and definitions.