]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
Change the FormBrowser behavior of "Pressing ESC":
[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
519/**\r
520 Process a Question's Option (whether selected or un-selected).\r
521\r
522 @param Selection Pointer to UI_MENU_SELECTION.\r
523 @param MenuOption The MenuOption for this Question.\r
524 @param Selected TRUE: if Question is selected.\r
525 @param OptionString Pointer of the Option String to be displayed.\r
526\r
527 @retval EFI_SUCCESS Question Option process success.\r
528 @retval Other Question Option process fail.\r
529\r
530**/\r
531EFI_STATUS\r
532ProcessOptions (\r
533 IN UI_MENU_SELECTION *Selection,\r
534 IN UI_MENU_OPTION *MenuOption,\r
535 IN BOOLEAN Selected,\r
536 OUT CHAR16 **OptionString\r
ed66e1bc 537 );\r
7936fb6a 538\r
539/**\r
540 Process the help string: Split StringPtr to several lines of strings stored in\r
541 FormattedString and the glyph width of each line cannot exceed gHelpBlockWidth.\r
542\r
543 @param StringPtr The entire help string.\r
544 @param FormattedString The oupput formatted string.\r
545 @param RowCount TRUE: if Question is selected.\r
546\r
547**/\r
548VOID\r
549ProcessHelpString (\r
550 IN CHAR16 *StringPtr,\r
551 OUT CHAR16 **FormattedString,\r
552 IN UINTN RowCount\r
ed66e1bc 553 );\r
7936fb6a 554\r
555/**\r
556 Update key's help imformation.\r
557\r
558 @param MenuOption The Menu option\r
559 @param Selected Whether or not a tag be selected\r
560\r
561**/\r
562VOID\r
563UpdateKeyHelp (\r
564 IN UI_MENU_OPTION *MenuOption,\r
565 IN BOOLEAN Selected\r
ed66e1bc 566 );\r
7936fb6a 567\r
568/**\r
569 Clear retangle with specified text attribute.\r
570\r
571 @param LeftColumn Left column of retangle.\r
572 @param RightColumn Right column of retangle.\r
573 @param TopRow Start row of retangle.\r
574 @param BottomRow End row of retangle.\r
575 @param TextAttribute The character foreground and background.\r
576\r
577**/\r
578VOID\r
579ClearLines (\r
580 UINTN LeftColumn,\r
581 UINTN RightColumn,\r
582 UINTN TopRow,\r
583 UINTN BottomRow,\r
584 UINTN TextAttribute\r
ed66e1bc 585 );\r
7936fb6a 586\r
587/**\r
588 Count the storage space of a Unicode string.\r
589\r
590 This function handles the Unicode string with NARROW_CHAR\r
591 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR\r
d66e6c16 592 does not count in the resultant output. If a WIDE_CHAR is\r
7936fb6a 593 hit, then 2 Unicode character will consume an output storage\r
594 space with size of CHAR16 till a NARROW_CHAR is hit.\r
595\r
596 @param String The input string to be counted.\r
597\r
598 @return Storage space for the input string.\r
599\r
600**/\r
601UINTN\r
602GetStringWidth (\r
603 CHAR16 *String\r
ed66e1bc 604 );\r
7936fb6a 605\r
606/**\r
607 Will copy LineWidth amount of a string in the OutputString buffer and return the\r
608 number of CHAR16 characters that were copied into the OutputString buffer.\r
609\r
610 @param InputString String description for this option.\r
611 @param LineWidth Width of the desired string to extract in CHAR16\r
612 characters\r
613 @param Index Where in InputString to start the copy process\r
614 @param OutputString Buffer to copy the string into\r
615\r
616 @return Returns the number of CHAR16 characters that were copied into the OutputString buffer.\r
617\r
618**/\r
619UINT16\r
620GetLineByWidth (\r
621 IN CHAR16 *InputString,\r
622 IN UINT16 LineWidth,\r
623 IN OUT UINTN *Index,\r
624 OUT CHAR16 **OutputString\r
ed66e1bc 625 );\r
7936fb6a 626\r
627/**\r
628 Get the supported width for a particular op-code\r
629\r
630 @param Statement The FORM_BROWSER_STATEMENT structure passed in.\r
631 @param Handle The handle in the HII database being used\r
632\r
633 @return Returns the number of CHAR16 characters that is support.\r
634\r
635**/\r
636UINT16\r
637GetWidth (\r
638 IN FORM_BROWSER_STATEMENT *Statement,\r
639 IN EFI_HII_HANDLE Handle\r
ed66e1bc 640 );\r
7936fb6a 641\r
642/**\r
643 Concatenate a narrow string to another string.\r
644\r
645 @param Destination The destination string.\r
646 @param Source The source string. The string to be concatenated.\r
647 to the end of Destination.\r
648\r
649**/\r
650VOID\r
651NewStrCat (\r
652 CHAR16 *Destination,\r
653 CHAR16 *Source\r
ed66e1bc 654 );\r
7936fb6a 655\r
656/**\r
657 Wait for a key to be pressed by user.\r
658\r
659 @param Key The key which is pressed by user.\r
660\r
661 @retval EFI_SUCCESS The function always completed successfully.\r
662\r
663**/\r
664EFI_STATUS\r
665WaitForKeyStroke (\r
666 OUT EFI_INPUT_KEY *Key\r
ed66e1bc 667 );\r
7936fb6a 668\r
669/**\r
670 Reset stack pointer to begin of the stack.\r
671\r
672**/\r
673VOID\r
674ResetScopeStack (\r
675 VOID\r
ed66e1bc 676 );\r
7936fb6a 677\r
678/**\r
679 Push an Operand onto the Stack\r
680\r
681 @param Operand Operand to push.\r
682\r
683 @retval EFI_SUCCESS The value was pushed onto the stack.\r
684 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r
685 stack.\r
686\r
687**/\r
688EFI_STATUS\r
689PushScope (\r
690 IN UINT8 Operand\r
ed66e1bc 691 );\r
7936fb6a 692\r
693/**\r
694 Pop an Operand from the Stack\r
695\r
696 @param Operand Operand to pop.\r
697\r
698 @retval EFI_SUCCESS The value was pushed onto the stack.\r
699 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r
700 stack.\r
701\r
702**/\r
703EFI_STATUS\r
704PopScope (\r
705 OUT UINT8 *Operand\r
ed66e1bc 706 );\r
7936fb6a 707\r
708/**\r
709 Get Form given its FormId.\r
710\r
711 @param FormSet The formset which contains this form.\r
712 @param FormId Id of this form.\r
713\r
714 @retval Pointer The form.\r
715 @retval NULL Specified Form is not found in the formset.\r
716\r
717**/\r
718FORM_BROWSER_FORM *\r
719IdToForm (\r
720 IN FORM_BROWSER_FORMSET *FormSet,\r
721 IN UINT16 FormId\r
ed66e1bc 722 );\r
7936fb6a 723\r
724/**\r
725 Search a Question in Formset scope using its QuestionId.\r
726\r
727 @param FormSet The formset which contains this form.\r
728 @param Form The form which contains this Question.\r
729 @param QuestionId Id of this Question.\r
730\r
731 @retval Pointer The Question.\r
732 @retval NULL Specified Question not found in the form.\r
733\r
734**/\r
735FORM_BROWSER_STATEMENT *\r
736IdToQuestion (\r
737 IN FORM_BROWSER_FORMSET *FormSet,\r
738 IN FORM_BROWSER_FORM *Form,\r
739 IN UINT16 QuestionId\r
ed66e1bc 740 );\r
7936fb6a 741\r
742/**\r
743 Zero extend integer/boolean/date/time to UINT64 for comparing.\r
744\r
745 @param Value HII Value to be converted.\r
746\r
747**/\r
748VOID\r
749ExtendValueToU64 (\r
750 IN EFI_HII_VALUE *Value\r
ed66e1bc 751 );\r
7936fb6a 752\r
753/**\r
754 Compare two Hii value.\r
755\r
756 @param Value1 Expression value to compare on left-hand.\r
757 @param Value2 Expression value to compare on right-hand.\r
758 @param HiiHandle Only required for string compare.\r
759\r
760 @retval EFI_INVALID_PARAMETER Could not perform comparation on two values.\r
761 @retval 0 Two operators equeal.\r
762 @return Positive value if Value1 is greater than Value2.\r
763 @retval Negative value if Value1 is less than Value2.\r
764\r
765**/\r
766INTN\r
767CompareHiiValue (\r
768 IN EFI_HII_VALUE *Value1,\r
769 IN EFI_HII_VALUE *Value2,\r
770 IN EFI_HII_HANDLE HiiHandle OPTIONAL\r
ed66e1bc 771 );\r
7936fb6a 772\r
773/**\r
774 Evaluate the result of a HII expression\r
775\r
3018ca2d 776 If Expression is NULL, then ASSERT.\r
777\r
7936fb6a 778 @param FormSet FormSet associated with this expression.\r
779 @param Form Form associated with this expression.\r
780 @param Expression Expression to be evaluated.\r
781\r
782 @retval EFI_SUCCESS The expression evaluated successfuly\r
783 @retval EFI_NOT_FOUND The Question which referenced by a QuestionId\r
784 could not be found.\r
785 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r
786 stack.\r
787 @retval EFI_ACCESS_DENIED The pop operation underflowed the stack\r
788 @retval EFI_INVALID_PARAMETER Syntax error with the Expression\r
789\r
790**/\r
791EFI_STATUS\r
792EvaluateExpression (\r
793 IN FORM_BROWSER_FORMSET *FormSet,\r
794 IN FORM_BROWSER_FORM *Form,\r
795 IN OUT FORM_EXPRESSION *Expression\r
ed66e1bc 796 );\r
7936fb6a 797\r
798#endif // _UI_H\r