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