]>
Commit | Line | Data |
---|---|---|
7936fb6a | 1 | /** @file\r |
2 | Private structure, MACRO and function definitions for User Interface related functionalities.\r | |
3 | \r | |
e5eed7d3 HT |
4 | Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
7936fb6a | 6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _UI_H_\r | |
16 | #define _UI_H_\r | |
17 | \r | |
7936fb6a | 18 | //\r |
19 | // Globals\r | |
20 | //\r | |
21 | #define REGULAR_NUMERIC 0\r | |
22 | #define TIME_NUMERIC 1\r | |
23 | #define DATE_NUMERIC 2\r | |
24 | \r | |
25 | #define SUBTITLE_INDENT 2\r | |
26 | \r | |
40a06b0c | 27 | \r |
28 | //\r | |
29 | // It take 23 characters including the NULL to print a 64 bits number with "[" and "]".\r | |
30 | // pow(2, 64) = [18446744073709551616]\r | |
31 | //\r | |
32 | #define MAX_NUMERIC_INPUT_WIDTH 23\r | |
33 | \r | |
7936fb6a | 34 | typedef enum {\r |
35 | UiNoOperation,\r | |
36 | UiDefault,\r | |
37 | UiSelect,\r | |
38 | UiUp,\r | |
39 | UiDown,\r | |
40 | UiLeft,\r | |
41 | UiRight,\r | |
42 | UiReset,\r | |
43 | UiSave,\r | |
44 | UiPrevious,\r | |
45 | UiPageUp,\r | |
46 | UiPageDown,\r | |
47 | UiMaxOperation\r | |
48 | } UI_SCREEN_OPERATION;\r | |
49 | \r | |
50 | typedef enum {\r | |
51 | CfInitialization,\r | |
52 | CfCheckSelection,\r | |
53 | CfRepaint,\r | |
54 | CfRefreshHighLight,\r | |
55 | CfUpdateHelpString,\r | |
56 | CfPrepareToReadKey,\r | |
57 | CfReadKey,\r | |
58 | CfScreenOperation,\r | |
7936fb6a | 59 | CfUiSelect,\r |
60 | CfUiReset,\r | |
61 | CfUiLeft,\r | |
62 | CfUiRight,\r | |
63 | CfUiUp,\r | |
64 | CfUiPageUp,\r | |
65 | CfUiPageDown,\r | |
66 | CfUiDown,\r | |
67 | CfUiSave,\r | |
68 | CfUiDefault,\r | |
69 | CfUiNoOperation,\r | |
70 | CfExit,\r | |
71 | CfMaxControlFlag\r | |
72 | } UI_CONTROL_FLAG;\r | |
73 | \r | |
74 | #define UI_ACTION_NONE 0\r | |
75 | #define UI_ACTION_REFRESH_FORM 1\r | |
76 | #define UI_ACTION_REFRESH_FORMSET 2\r | |
77 | #define UI_ACTION_EXIT 3\r | |
78 | \r | |
79 | typedef struct {\r | |
80 | EFI_HII_HANDLE Handle;\r | |
81 | \r | |
82 | //\r | |
83 | // Target formset/form/Question information\r | |
84 | //\r | |
85 | EFI_GUID FormSetGuid;\r | |
86 | UINT16 FormId;\r | |
87 | UINT16 QuestionId;\r | |
88 | \r | |
89 | UINTN TopRow;\r | |
90 | UINTN BottomRow;\r | |
91 | UINTN PromptCol;\r | |
92 | UINTN OptionCol;\r | |
93 | UINTN CurrentRow;\r | |
94 | \r | |
95 | //\r | |
96 | // Ation for Browser to taken:\r | |
97 | // UI_ACTION_NONE - navigation inside a form\r | |
98 | // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form\r | |
99 | // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary\r | |
100 | //\r | |
101 | UINTN Action;\r | |
102 | \r | |
103 | //\r | |
104 | // Current selected fomset/form/Question\r | |
105 | //\r | |
106 | FORM_BROWSER_FORMSET *FormSet;\r | |
107 | FORM_BROWSER_FORM *Form;\r | |
108 | FORM_BROWSER_STATEMENT *Statement;\r | |
8b0fc5c1 | 109 | \r |
110 | //\r | |
111 | // Whether the Form is editable\r | |
112 | //\r | |
113 | BOOLEAN FormEditable;\r | |
7936fb6a | 114 | } UI_MENU_SELECTION;\r |
115 | \r | |
f3f2e05d | 116 | #define UI_MENU_OPTION_SIGNATURE SIGNATURE_32 ('u', 'i', 'm', 'm')\r |
117 | #define UI_MENU_LIST_SIGNATURE SIGNATURE_32 ('u', 'i', 'm', 'l')\r | |
7936fb6a | 118 | \r |
119 | typedef struct {\r | |
120 | UINTN Signature;\r | |
121 | LIST_ENTRY Link;\r | |
122 | \r | |
123 | EFI_HII_HANDLE Handle;\r | |
124 | FORM_BROWSER_STATEMENT *ThisTag;\r | |
125 | UINT16 EntryNumber;\r | |
126 | \r | |
127 | UINTN Row;\r | |
128 | UINTN Col;\r | |
129 | UINTN OptCol;\r | |
130 | CHAR16 *Description;\r | |
131 | UINTN Skip; // Number of lines\r | |
132 | \r | |
133 | //\r | |
134 | // Display item sequence for date/time\r | |
135 | // Date: Month/Day/Year\r | |
136 | // Sequence: 0 1 2\r | |
137 | //\r | |
138 | // Time: Hour : Minute : Second\r | |
139 | // Sequence: 0 1 2\r | |
140 | //\r | |
141 | //\r | |
142 | UINTN Sequence;\r | |
143 | \r | |
144 | BOOLEAN GrayOut;\r | |
145 | BOOLEAN ReadOnly;\r | |
8b0fc5c1 | 146 | \r |
147 | //\r | |
148 | // Whether user could change value of this item\r | |
149 | //\r | |
150 | BOOLEAN IsQuestion;\r | |
7936fb6a | 151 | } UI_MENU_OPTION;\r |
152 | \r | |
153 | #define MENU_OPTION_FROM_LINK(a) CR (a, UI_MENU_OPTION, Link, UI_MENU_OPTION_SIGNATURE)\r | |
154 | \r | |
d66e6c16 | 155 | typedef struct _UI_MENU_LIST UI_MENU_LIST;\r |
156 | \r | |
157 | struct _UI_MENU_LIST {\r | |
7936fb6a | 158 | UINTN Signature;\r |
d66e6c16 | 159 | LIST_ENTRY Link;\r |
7936fb6a | 160 | \r |
d66e6c16 | 161 | EFI_GUID FormSetGuid;\r |
7936fb6a | 162 | UINT16 FormId;\r |
163 | UINT16 QuestionId;\r | |
d66e6c16 | 164 | \r |
165 | UI_MENU_LIST *Parent;\r | |
166 | LIST_ENTRY ChildListHead;\r | |
167 | };\r | |
168 | \r | |
169 | #define UI_MENU_LIST_FROM_LINK(a) CR (a, UI_MENU_LIST, Link, UI_MENU_LIST_SIGNATURE)\r | |
7936fb6a | 170 | \r |
1ccdbf2a | 171 | typedef struct _MENU_REFRESH_ENTRY MENU_REFRESH_ENTRY;\r |
172 | struct _MENU_REFRESH_ENTRY {\r | |
173 | MENU_REFRESH_ENTRY *Next;\r | |
7936fb6a | 174 | UI_MENU_OPTION *MenuOption; // Describes the entry needing an update\r |
175 | UI_MENU_SELECTION *Selection;\r | |
176 | UINTN CurrentColumn;\r | |
177 | UINTN CurrentRow;\r | |
178 | UINTN CurrentAttribute;\r | |
1ccdbf2a | 179 | };\r |
7936fb6a | 180 | \r |
181 | typedef struct {\r | |
182 | UINT16 ScanCode;\r | |
183 | UI_SCREEN_OPERATION ScreenOperation;\r | |
184 | } SCAN_CODE_TO_SCREEN_OPERATION;\r | |
185 | \r | |
186 | typedef struct {\r | |
187 | UI_SCREEN_OPERATION ScreenOperation;\r | |
188 | UI_CONTROL_FLAG ControlFlag;\r | |
189 | } SCREEN_OPERATION_T0_CONTROL_FLAG;\r | |
190 | \r | |
191 | \r | |
ce6d12cc | 192 | extern LIST_ENTRY gMenuOption;\r |
7936fb6a | 193 | extern MENU_REFRESH_ENTRY *gMenuRefreshHead;\r |
194 | extern UI_MENU_SELECTION *gCurrentSelection;\r | |
8d00a0f1 | 195 | extern BOOLEAN mHiiPackageListUpdated;\r |
7936fb6a | 196 | \r |
197 | //\r | |
198 | // Global Functions\r | |
199 | //\r | |
200 | /**\r | |
201 | Initialize Menu option list.\r | |
202 | \r | |
203 | **/\r | |
204 | VOID\r | |
205 | UiInitMenu (\r | |
206 | VOID\r | |
ed66e1bc | 207 | );\r |
7936fb6a | 208 | \r |
209 | /**\r | |
210 | Initialize Menu option list.\r | |
211 | \r | |
212 | **/\r | |
213 | VOID\r | |
214 | UiInitMenuList (\r | |
215 | VOID\r | |
ed66e1bc | 216 | );\r |
7936fb6a | 217 | \r |
218 | /**\r | |
d66e6c16 | 219 | Free Menu option linked list.\r |
7936fb6a | 220 | \r |
221 | **/\r | |
222 | VOID\r | |
d66e6c16 | 223 | UiFreeMenu (\r |
224 | VOID\r | |
ed66e1bc | 225 | );\r |
7936fb6a | 226 | \r |
227 | /**\r | |
d66e6c16 | 228 | Create a menu with specified formset GUID and form ID, and add it as a child\r |
229 | of the given parent menu.\r | |
230 | \r | |
231 | @param Parent The parent of menu to be added.\r | |
232 | @param FormSetGuid The Formset Guid of menu to be added.\r | |
233 | @param FormId The Form ID of menu to be added.\r | |
234 | \r | |
235 | @return A pointer to the newly added menu or NULL if memory is insufficient.\r | |
7936fb6a | 236 | \r |
237 | **/\r | |
d66e6c16 | 238 | UI_MENU_LIST *\r |
239 | UiAddMenuList (\r | |
240 | IN OUT UI_MENU_LIST *Parent,\r | |
241 | IN EFI_GUID *FormSetGuid,\r | |
242 | IN UINT16 FormId\r | |
ed66e1bc | 243 | );\r |
7936fb6a | 244 | \r |
245 | /**\r | |
d66e6c16 | 246 | Search Menu with given FormId in the parent menu and all its child menus.\r |
7936fb6a | 247 | \r |
d66e6c16 | 248 | @param Parent The parent of menu to search.\r |
249 | @param FormId The Form ID of menu to search.\r | |
250 | \r | |
251 | @return A pointer to menu found or NULL if not found.\r | |
7936fb6a | 252 | \r |
253 | **/\r | |
d66e6c16 | 254 | UI_MENU_LIST *\r |
255 | UiFindChildMenuList (\r | |
256 | IN UI_MENU_LIST *Parent,\r | |
257 | IN UINT16 FormId\r | |
258 | );\r | |
259 | \r | |
260 | /**\r | |
261 | Search Menu with given FormSetGuid and FormId in all cached menu list.\r | |
262 | \r | |
263 | @param FormSetGuid The Formset GUID of the menu to search.\r | |
264 | @param FormId The Form ID of menu to search.\r | |
265 | \r | |
266 | @return A pointer to menu found or NULL if not found.\r | |
267 | \r | |
268 | **/\r | |
269 | UI_MENU_LIST *\r | |
270 | UiFindMenuList (\r | |
271 | IN EFI_GUID *FormSetGuid,\r | |
272 | IN UINT16 FormId\r | |
ed66e1bc | 273 | );\r |
7936fb6a | 274 | \r |
275 | /**\r | |
276 | Free Menu option linked list.\r | |
277 | \r | |
278 | **/\r | |
279 | VOID\r | |
d66e6c16 | 280 | UiFreeRefreshList (\r |
7936fb6a | 281 | VOID\r |
ed66e1bc | 282 | );\r |
7936fb6a | 283 | \r |
284 | /**\r | |
285 | Add one menu option by specified description and context.\r | |
286 | \r | |
287 | @param String String description for this option.\r | |
288 | @param Handle Hii handle for the package list.\r | |
289 | @param Statement Statement of this Menu Option.\r | |
290 | @param NumberOfLines Display lines for this Menu Option.\r | |
291 | @param MenuItemCount The index for this Option in the Menu.\r | |
292 | \r | |
8b0fc5c1 | 293 | @retval Pointer Pointer to the added Menu Option.\r |
294 | \r | |
7936fb6a | 295 | **/\r |
8b0fc5c1 | 296 | UI_MENU_OPTION *\r |
7936fb6a | 297 | UiAddMenuOption (\r |
298 | IN CHAR16 *String,\r | |
299 | IN EFI_HII_HANDLE Handle,\r | |
300 | IN FORM_BROWSER_STATEMENT *Statement,\r | |
301 | IN UINT16 NumberOfLines,\r | |
302 | IN UINT16 MenuItemCount\r | |
ed66e1bc | 303 | );\r |
7936fb6a | 304 | \r |
305 | /**\r | |
306 | Display menu and wait for user to select one menu option, then return it.\r | |
307 | If AutoBoot is enabled, then if user doesn't select any option,\r | |
308 | after period of time, it will automatically return the first menu option.\r | |
309 | \r | |
310 | @param Selection Menu selection.\r | |
311 | \r | |
312 | @return Return the pointer of the menu which selected,\r | |
313 | @return otherwise return NULL.\r | |
314 | \r | |
315 | **/\r | |
316 | EFI_STATUS\r | |
317 | UiDisplayMenu (\r | |
318 | IN OUT UI_MENU_SELECTION *Selection\r | |
ed66e1bc | 319 | );\r |
7936fb6a | 320 | \r |
321 | /**\r | |
322 | Free up the resource allocated for all strings required\r | |
323 | by Setup Browser.\r | |
324 | \r | |
325 | **/\r | |
326 | VOID\r | |
327 | FreeBrowserStrings (\r | |
328 | VOID\r | |
ed66e1bc | 329 | );\r |
7936fb6a | 330 | \r |
331 | /**\r | |
332 | The worker function that send the displays to the screen. On output,\r | |
333 | the selection made by user is returned.\r | |
334 | \r | |
335 | @param Selection On input, Selection tell setup browser the information\r | |
336 | about the Selection, form and formset to be displayed.\r | |
337 | On output, Selection return the screen item that is selected\r | |
338 | by user.\r | |
339 | \r | |
340 | @retval EFI_SUCCESS The page is displayed successfully.\r | |
341 | @return Other value if the page failed to be diplayed.\r | |
342 | \r | |
343 | **/\r | |
344 | EFI_STATUS\r | |
345 | SetupBrowser (\r | |
346 | IN OUT UI_MENU_SELECTION *Selection\r | |
ed66e1bc | 347 | );\r |
7936fb6a | 348 | \r |
7936fb6a | 349 | /**\r |
350 | Set Buffer to Value for Size bytes.\r | |
351 | \r | |
352 | @param Buffer Memory to set.\r | |
353 | @param Size Number of bytes to set\r | |
354 | @param Value Value of the set operation.\r | |
355 | \r | |
356 | **/\r | |
357 | VOID\r | |
358 | SetUnicodeMem (\r | |
359 | IN VOID *Buffer,\r | |
360 | IN UINTN Size,\r | |
361 | IN CHAR16 Value\r | |
ed66e1bc | 362 | );\r |
7936fb6a | 363 | \r |
364 | /**\r | |
365 | Wait for a given event to fire, or for an optional timeout to expire.\r | |
366 | \r | |
367 | @param Event The event to wait for\r | |
368 | @param Timeout An optional timeout value in 100 ns units.\r | |
369 | @param RefreshInterval Menu refresh interval (in seconds).\r | |
370 | \r | |
371 | @retval EFI_SUCCESS Event fired before Timeout expired.\r | |
372 | @retval EFI_TIME_OUT Timout expired before Event fired.\r | |
373 | \r | |
374 | **/\r | |
375 | EFI_STATUS\r | |
376 | UiWaitForSingleEvent (\r | |
377 | IN EFI_EVENT Event,\r | |
378 | IN UINT64 Timeout, OPTIONAL\r | |
379 | IN UINT8 RefreshInterval OPTIONAL\r | |
ed66e1bc | 380 | );\r |
7936fb6a | 381 | \r |
382 | /**\r | |
383 | Draw a pop up windows based on the dimension, number of lines and\r | |
384 | strings specified.\r | |
385 | \r | |
7064c0a5 | 386 | @param ScreenWidth The width of the pop-up.\r |
7936fb6a | 387 | @param NumberOfLines The number of lines.\r |
7936fb6a | 388 | @param ... A series of text strings that displayed in the pop-up.\r |
389 | \r | |
390 | **/\r | |
391 | VOID\r | |
8091267c | 392 | EFIAPI\r |
3ebb9bdb | 393 | CreateMultiStringPopUp (\r |
7936fb6a | 394 | IN UINTN ScreenWidth,\r |
395 | IN UINTN NumberOfLines,\r | |
7936fb6a | 396 | ...\r |
ed66e1bc | 397 | );\r |
7936fb6a | 398 | \r |
399 | /**\r | |
400 | Get string or password input from user.\r | |
401 | \r | |
402 | @param MenuOption Pointer to the current input menu.\r | |
403 | @param Prompt The prompt string shown on popup window.\r | |
404 | @param StringPtr Destination for use input string.\r | |
405 | \r | |
406 | @retval EFI_SUCCESS If string input is read successfully\r | |
407 | @retval EFI_DEVICE_ERROR If operation fails\r | |
408 | \r | |
409 | **/\r | |
410 | EFI_STATUS\r | |
411 | ReadString (\r | |
412 | IN UI_MENU_OPTION *MenuOption,\r | |
413 | IN CHAR16 *Prompt,\r | |
414 | OUT CHAR16 *StringPtr\r | |
ed66e1bc | 415 | );\r |
7936fb6a | 416 | \r |
417 | /**\r | |
418 | Get selection for OneOf and OrderedList (Left/Right will be ignored).\r | |
419 | \r | |
420 | @param Selection Pointer to current selection.\r | |
421 | @param MenuOption Pointer to the current input menu.\r | |
422 | \r | |
423 | @retval EFI_SUCCESS If Option input is processed successfully\r | |
424 | @retval EFI_DEVICE_ERROR If operation fails\r | |
425 | \r | |
426 | **/\r | |
427 | EFI_STATUS\r | |
428 | GetSelectionInputPopUp (\r | |
429 | IN UI_MENU_SELECTION *Selection,\r | |
430 | IN UI_MENU_OPTION *MenuOption\r | |
ed66e1bc | 431 | );\r |
7936fb6a | 432 | \r |
433 | /**\r | |
434 | This routine reads a numeric value from the user input.\r | |
435 | \r | |
436 | @param Selection Pointer to current selection.\r | |
437 | @param MenuOption Pointer to the current input menu.\r | |
438 | \r | |
439 | @retval EFI_SUCCESS If numerical input is read successfully\r | |
440 | @retval EFI_DEVICE_ERROR If operation fails\r | |
441 | \r | |
442 | **/\r | |
443 | EFI_STATUS\r | |
444 | GetNumericInput (\r | |
445 | IN UI_MENU_SELECTION *Selection,\r | |
446 | IN UI_MENU_OPTION *MenuOption\r | |
ed66e1bc | 447 | );\r |
7936fb6a | 448 | \r |
449 | /**\r | |
450 | Update status bar on the bottom of menu.\r | |
451 | \r | |
452 | @param MessageType The type of message to be shown.\r | |
453 | @param Flags The flags in Question header.\r | |
454 | @param State Set or clear.\r | |
455 | \r | |
456 | **/\r | |
457 | VOID\r | |
458 | UpdateStatusBar (\r | |
459 | IN UINTN MessageType,\r | |
460 | IN UINT8 Flags,\r | |
461 | IN BOOLEAN State\r | |
ed66e1bc | 462 | );\r |
7936fb6a | 463 | \r |
464 | /**\r | |
465 | Process Question Config.\r | |
466 | \r | |
467 | @param Selection The UI menu selection.\r | |
468 | @param Question The Question to be peocessed.\r | |
469 | \r | |
470 | @retval EFI_SUCCESS Question Config process success.\r | |
471 | @retval Other Question Config process fail.\r | |
472 | \r | |
473 | **/\r | |
474 | EFI_STATUS\r | |
475 | ProcessQuestionConfig (\r | |
476 | IN UI_MENU_SELECTION *Selection,\r | |
477 | IN FORM_BROWSER_STATEMENT *Question\r | |
ed66e1bc | 478 | );\r |
7936fb6a | 479 | \r |
480 | /**\r | |
481 | Print Question Value according to it's storage width and display attributes.\r | |
482 | \r | |
483 | @param Question The Question to be printed.\r | |
484 | @param FormattedNumber Buffer for output string.\r | |
485 | @param BufferSize The FormattedNumber buffer size in bytes.\r | |
486 | \r | |
487 | @retval EFI_SUCCESS Print success.\r | |
488 | @retval EFI_BUFFER_TOO_SMALL Buffer size is not enough for formatted number.\r | |
489 | \r | |
490 | **/\r | |
491 | EFI_STATUS\r | |
492 | PrintFormattedNumber (\r | |
493 | IN FORM_BROWSER_STATEMENT *Question,\r | |
494 | IN OUT CHAR16 *FormattedNumber,\r | |
495 | IN UINTN BufferSize\r | |
ed66e1bc | 496 | );\r |
7936fb6a | 497 | \r |
498 | /**\r | |
499 | Search an Option of a Question by its value.\r | |
500 | \r | |
501 | @param Question The Question\r | |
502 | @param OptionValue Value for Option to be searched.\r | |
503 | \r | |
504 | @retval Pointer Pointer to the found Option.\r | |
505 | @retval NULL Option not found.\r | |
506 | \r | |
507 | **/\r | |
508 | QUESTION_OPTION *\r | |
509 | ValueToOption (\r | |
510 | IN FORM_BROWSER_STATEMENT *Question,\r | |
511 | IN EFI_HII_VALUE *OptionValue\r | |
ed66e1bc | 512 | );\r |
7936fb6a | 513 | \r |
d02847d3 | 514 | /**\r |
515 | Return data element in an Array by its Index.\r | |
516 | \r | |
517 | @param Array The data array.\r | |
518 | @param Type Type of the data in this array.\r | |
519 | @param Index Zero based index for data in this array.\r | |
520 | \r | |
521 | @retval Value The data to be returned\r | |
522 | \r | |
523 | **/\r | |
524 | UINT64\r | |
525 | GetArrayData (\r | |
526 | IN VOID *Array,\r | |
527 | IN UINT8 Type,\r | |
528 | IN UINTN Index\r | |
529 | );\r | |
530 | \r | |
531 | /**\r | |
532 | Set value of a data element in an Array by its Index.\r | |
533 | \r | |
534 | @param Array The data array.\r | |
535 | @param Type Type of the data in this array.\r | |
536 | @param Index Zero based index for data in this array.\r | |
537 | @param Value The value to be set.\r | |
538 | \r | |
539 | **/\r | |
540 | VOID\r | |
541 | SetArrayData (\r | |
542 | IN VOID *Array,\r | |
543 | IN UINT8 Type,\r | |
544 | IN UINTN Index,\r | |
545 | IN UINT64 Value\r | |
546 | );\r | |
547 | \r | |
7936fb6a | 548 | /**\r |
549 | Process a Question's Option (whether selected or un-selected).\r | |
550 | \r | |
551 | @param Selection Pointer to UI_MENU_SELECTION.\r | |
552 | @param MenuOption The MenuOption for this Question.\r | |
553 | @param Selected TRUE: if Question is selected.\r | |
554 | @param OptionString Pointer of the Option String to be displayed.\r | |
555 | \r | |
556 | @retval EFI_SUCCESS Question Option process success.\r | |
557 | @retval Other Question Option process fail.\r | |
558 | \r | |
559 | **/\r | |
560 | EFI_STATUS\r | |
561 | ProcessOptions (\r | |
562 | IN UI_MENU_SELECTION *Selection,\r | |
563 | IN UI_MENU_OPTION *MenuOption,\r | |
564 | IN BOOLEAN Selected,\r | |
565 | OUT CHAR16 **OptionString\r | |
ed66e1bc | 566 | );\r |
7936fb6a | 567 | \r |
568 | /**\r | |
569 | Process the help string: Split StringPtr to several lines of strings stored in\r | |
570 | FormattedString and the glyph width of each line cannot exceed gHelpBlockWidth.\r | |
571 | \r | |
572 | @param StringPtr The entire help string.\r | |
573 | @param FormattedString The oupput formatted string.\r | |
574 | @param RowCount TRUE: if Question is selected.\r | |
575 | \r | |
576 | **/\r | |
577 | VOID\r | |
578 | ProcessHelpString (\r | |
579 | IN CHAR16 *StringPtr,\r | |
580 | OUT CHAR16 **FormattedString,\r | |
581 | IN UINTN RowCount\r | |
ed66e1bc | 582 | );\r |
7936fb6a | 583 | \r |
584 | /**\r | |
585 | Update key's help imformation.\r | |
586 | \r | |
8b0fc5c1 | 587 | @param Selection Tell setup browser the information about the Selection\r |
7936fb6a | 588 | @param MenuOption The Menu option\r |
589 | @param Selected Whether or not a tag be selected\r | |
590 | \r | |
591 | **/\r | |
592 | VOID\r | |
593 | UpdateKeyHelp (\r | |
8b0fc5c1 | 594 | IN UI_MENU_SELECTION *Selection,\r |
7936fb6a | 595 | IN UI_MENU_OPTION *MenuOption,\r |
596 | IN BOOLEAN Selected\r | |
ed66e1bc | 597 | );\r |
7936fb6a | 598 | \r |
599 | /**\r | |
600 | Clear retangle with specified text attribute.\r | |
601 | \r | |
602 | @param LeftColumn Left column of retangle.\r | |
603 | @param RightColumn Right column of retangle.\r | |
604 | @param TopRow Start row of retangle.\r | |
605 | @param BottomRow End row of retangle.\r | |
606 | @param TextAttribute The character foreground and background.\r | |
607 | \r | |
608 | **/\r | |
609 | VOID\r | |
610 | ClearLines (\r | |
8b0fc5c1 | 611 | IN UINTN LeftColumn,\r |
612 | IN UINTN RightColumn,\r | |
613 | IN UINTN TopRow,\r | |
614 | IN UINTN BottomRow,\r | |
615 | IN UINTN TextAttribute\r | |
ed66e1bc | 616 | );\r |
7936fb6a | 617 | \r |
618 | /**\r | |
619 | Count the storage space of a Unicode string.\r | |
620 | \r | |
621 | This function handles the Unicode string with NARROW_CHAR\r | |
622 | and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR\r | |
d66e6c16 | 623 | does not count in the resultant output. If a WIDE_CHAR is\r |
7936fb6a | 624 | hit, then 2 Unicode character will consume an output storage\r |
625 | space with size of CHAR16 till a NARROW_CHAR is hit.\r | |
626 | \r | |
771ececd LG |
627 | If String is NULL, then ASSERT ().\r |
628 | \r | |
7936fb6a | 629 | @param String The input string to be counted.\r |
630 | \r | |
631 | @return Storage space for the input string.\r | |
632 | \r | |
633 | **/\r | |
634 | UINTN\r | |
635 | GetStringWidth (\r | |
8b0fc5c1 | 636 | IN CHAR16 *String\r |
ed66e1bc | 637 | );\r |
7936fb6a | 638 | \r |
639 | /**\r | |
640 | Will copy LineWidth amount of a string in the OutputString buffer and return the\r | |
641 | number of CHAR16 characters that were copied into the OutputString buffer.\r | |
642 | \r | |
643 | @param InputString String description for this option.\r | |
644 | @param LineWidth Width of the desired string to extract in CHAR16\r | |
645 | characters\r | |
646 | @param Index Where in InputString to start the copy process\r | |
647 | @param OutputString Buffer to copy the string into\r | |
648 | \r | |
649 | @return Returns the number of CHAR16 characters that were copied into the OutputString buffer.\r | |
650 | \r | |
651 | **/\r | |
652 | UINT16\r | |
653 | GetLineByWidth (\r | |
654 | IN CHAR16 *InputString,\r | |
655 | IN UINT16 LineWidth,\r | |
656 | IN OUT UINTN *Index,\r | |
657 | OUT CHAR16 **OutputString\r | |
ed66e1bc | 658 | );\r |
7936fb6a | 659 | \r |
660 | /**\r | |
661 | Get the supported width for a particular op-code\r | |
662 | \r | |
663 | @param Statement The FORM_BROWSER_STATEMENT structure passed in.\r | |
664 | @param Handle The handle in the HII database being used\r | |
665 | \r | |
666 | @return Returns the number of CHAR16 characters that is support.\r | |
667 | \r | |
668 | **/\r | |
669 | UINT16\r | |
670 | GetWidth (\r | |
671 | IN FORM_BROWSER_STATEMENT *Statement,\r | |
672 | IN EFI_HII_HANDLE Handle\r | |
ed66e1bc | 673 | );\r |
7936fb6a | 674 | \r |
675 | /**\r | |
676 | Concatenate a narrow string to another string.\r | |
677 | \r | |
678 | @param Destination The destination string.\r | |
679 | @param Source The source string. The string to be concatenated.\r | |
680 | to the end of Destination.\r | |
681 | \r | |
682 | **/\r | |
683 | VOID\r | |
684 | NewStrCat (\r | |
8b0fc5c1 | 685 | IN OUT CHAR16 *Destination,\r |
686 | IN CHAR16 *Source\r | |
ed66e1bc | 687 | );\r |
7936fb6a | 688 | \r |
689 | /**\r | |
690 | Wait for a key to be pressed by user.\r | |
691 | \r | |
692 | @param Key The key which is pressed by user.\r | |
693 | \r | |
694 | @retval EFI_SUCCESS The function always completed successfully.\r | |
695 | \r | |
696 | **/\r | |
697 | EFI_STATUS\r | |
698 | WaitForKeyStroke (\r | |
699 | OUT EFI_INPUT_KEY *Key\r | |
ed66e1bc | 700 | );\r |
7936fb6a | 701 | \r |
702 | /**\r | |
703 | Reset stack pointer to begin of the stack.\r | |
704 | \r | |
705 | **/\r | |
706 | VOID\r | |
707 | ResetScopeStack (\r | |
708 | VOID\r | |
ed66e1bc | 709 | );\r |
7936fb6a | 710 | \r |
711 | /**\r | |
712 | Push an Operand onto the Stack\r | |
713 | \r | |
714 | @param Operand Operand to push.\r | |
715 | \r | |
716 | @retval EFI_SUCCESS The value was pushed onto the stack.\r | |
717 | @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r | |
718 | stack.\r | |
719 | \r | |
720 | **/\r | |
721 | EFI_STATUS\r | |
722 | PushScope (\r | |
723 | IN UINT8 Operand\r | |
ed66e1bc | 724 | );\r |
7936fb6a | 725 | \r |
726 | /**\r | |
727 | Pop an Operand from the Stack\r | |
728 | \r | |
729 | @param Operand Operand to pop.\r | |
730 | \r | |
731 | @retval EFI_SUCCESS The value was pushed onto the stack.\r | |
732 | @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r | |
733 | stack.\r | |
734 | \r | |
735 | **/\r | |
736 | EFI_STATUS\r | |
737 | PopScope (\r | |
738 | OUT UINT8 *Operand\r | |
ed66e1bc | 739 | );\r |
7936fb6a | 740 | \r |
2573712e LG |
741 | /**\r |
742 | Reset stack pointer to begin of the stack.\r | |
743 | \r | |
744 | **/\r | |
745 | VOID\r | |
746 | ResetCurrentExpressionStack (\r | |
747 | VOID\r | |
748 | );\r | |
749 | \r | |
750 | /**\r | |
751 | Push current expression onto the Stack\r | |
752 | \r | |
753 | @param Pointer Pointer to current expression.\r | |
754 | \r | |
755 | @retval EFI_SUCCESS The value was pushed onto the stack.\r | |
756 | @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r | |
757 | \r | |
758 | **/\r | |
759 | EFI_STATUS\r | |
760 | PushCurrentExpression (\r | |
761 | IN VOID *Pointer\r | |
762 | );\r | |
763 | \r | |
764 | /**\r | |
765 | Pop current expression from the Stack\r | |
766 | \r | |
767 | @param Pointer Pointer to current expression to be pop.\r | |
768 | \r | |
769 | @retval EFI_SUCCESS The value was pushed onto the stack.\r | |
770 | @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r | |
771 | \r | |
772 | **/\r | |
773 | EFI_STATUS\r | |
774 | PopCurrentExpression (\r | |
775 | OUT VOID **Pointer\r | |
776 | );\r | |
777 | \r | |
778 | /**\r | |
779 | Reset stack pointer to begin of the stack.\r | |
780 | \r | |
781 | **/\r | |
782 | VOID\r | |
783 | ResetMapExpressionListStack (\r | |
784 | VOID\r | |
785 | );\r | |
786 | \r | |
787 | /**\r | |
788 | Push the list of map expression onto the Stack\r | |
789 | \r | |
790 | @param Pointer Pointer to the list of map expression to be pushed.\r | |
791 | \r | |
792 | @retval EFI_SUCCESS The value was pushed onto the stack.\r | |
793 | @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r | |
794 | \r | |
795 | **/\r | |
796 | EFI_STATUS\r | |
797 | PushMapExpressionList (\r | |
798 | IN VOID *Pointer\r | |
799 | );\r | |
800 | \r | |
801 | /**\r | |
802 | Pop the list of map expression from the Stack\r | |
803 | \r | |
804 | @param Pointer Pointer to the list of map expression to be pop.\r | |
805 | \r | |
806 | @retval EFI_SUCCESS The value was pushed onto the stack.\r | |
807 | @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r | |
808 | \r | |
809 | **/\r | |
810 | EFI_STATUS\r | |
811 | PopMapExpressionList (\r | |
812 | OUT VOID **Pointer\r | |
813 | );\r | |
814 | \r | |
7936fb6a | 815 | /**\r |
816 | Get Form given its FormId.\r | |
817 | \r | |
818 | @param FormSet The formset which contains this form.\r | |
819 | @param FormId Id of this form.\r | |
820 | \r | |
821 | @retval Pointer The form.\r | |
822 | @retval NULL Specified Form is not found in the formset.\r | |
823 | \r | |
824 | **/\r | |
825 | FORM_BROWSER_FORM *\r | |
826 | IdToForm (\r | |
827 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
828 | IN UINT16 FormId\r | |
ed66e1bc | 829 | );\r |
7936fb6a | 830 | \r |
831 | /**\r | |
832 | Search a Question in Formset scope using its QuestionId.\r | |
833 | \r | |
834 | @param FormSet The formset which contains this form.\r | |
835 | @param Form The form which contains this Question.\r | |
836 | @param QuestionId Id of this Question.\r | |
837 | \r | |
838 | @retval Pointer The Question.\r | |
839 | @retval NULL Specified Question not found in the form.\r | |
840 | \r | |
841 | **/\r | |
842 | FORM_BROWSER_STATEMENT *\r | |
843 | IdToQuestion (\r | |
844 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
845 | IN FORM_BROWSER_FORM *Form,\r | |
846 | IN UINT16 QuestionId\r | |
ed66e1bc | 847 | );\r |
7936fb6a | 848 | \r |
849 | /**\r | |
850 | Zero extend integer/boolean/date/time to UINT64 for comparing.\r | |
851 | \r | |
852 | @param Value HII Value to be converted.\r | |
853 | \r | |
854 | **/\r | |
855 | VOID\r | |
856 | ExtendValueToU64 (\r | |
857 | IN EFI_HII_VALUE *Value\r | |
ed66e1bc | 858 | );\r |
7936fb6a | 859 | \r |
860 | /**\r | |
861 | Compare two Hii value.\r | |
862 | \r | |
863 | @param Value1 Expression value to compare on left-hand.\r | |
864 | @param Value2 Expression value to compare on right-hand.\r | |
865 | @param HiiHandle Only required for string compare.\r | |
866 | \r | |
867 | @retval EFI_INVALID_PARAMETER Could not perform comparation on two values.\r | |
868 | @retval 0 Two operators equeal.\r | |
869 | @return Positive value if Value1 is greater than Value2.\r | |
870 | @retval Negative value if Value1 is less than Value2.\r | |
871 | \r | |
872 | **/\r | |
873 | INTN\r | |
874 | CompareHiiValue (\r | |
875 | IN EFI_HII_VALUE *Value1,\r | |
876 | IN EFI_HII_VALUE *Value2,\r | |
877 | IN EFI_HII_HANDLE HiiHandle OPTIONAL\r | |
ed66e1bc | 878 | );\r |
7936fb6a | 879 | \r |
880 | /**\r | |
881 | Evaluate the result of a HII expression\r | |
882 | \r | |
3018ca2d | 883 | If Expression is NULL, then ASSERT.\r |
884 | \r | |
7936fb6a | 885 | @param FormSet FormSet associated with this expression.\r |
886 | @param Form Form associated with this expression.\r | |
887 | @param Expression Expression to be evaluated.\r | |
888 | \r | |
889 | @retval EFI_SUCCESS The expression evaluated successfuly\r | |
890 | @retval EFI_NOT_FOUND The Question which referenced by a QuestionId\r | |
891 | could not be found.\r | |
892 | @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r | |
893 | stack.\r | |
894 | @retval EFI_ACCESS_DENIED The pop operation underflowed the stack\r | |
895 | @retval EFI_INVALID_PARAMETER Syntax error with the Expression\r | |
896 | \r | |
897 | **/\r | |
898 | EFI_STATUS\r | |
899 | EvaluateExpression (\r | |
900 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
901 | IN FORM_BROWSER_FORM *Form,\r | |
902 | IN OUT FORM_EXPRESSION *Expression\r | |
ed66e1bc | 903 | );\r |
7936fb6a | 904 | \r |
905 | #endif // _UI_H\r |