]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
Fix AutoUpdateLangVariable() logic to handle the case PlatformLang/Lang is set before...
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Ui.h
... / ...
CommitLineData
1/** @file\r
2Private structure, MACRO and function definitions for User Interface related functionalities.\r
3\r
4Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
5This 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//\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
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
34typedef 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
50typedef 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
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
79typedef 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
109\r
110 //\r
111 // Whether the Form is editable\r
112 //\r
113 BOOLEAN FormEditable;\r
114} UI_MENU_SELECTION;\r
115\r
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
118\r
119typedef 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
146\r
147 //\r
148 // Whether user could change value of this item\r
149 //\r
150 BOOLEAN IsQuestion;\r
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
155typedef struct _UI_MENU_LIST UI_MENU_LIST;\r
156\r
157struct _UI_MENU_LIST {\r
158 UINTN Signature;\r
159 LIST_ENTRY Link;\r
160\r
161 EFI_GUID FormSetGuid;\r
162 UINT16 FormId;\r
163 UINT16 QuestionId;\r
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
170\r
171typedef struct _MENU_REFRESH_ENTRY MENU_REFRESH_ENTRY;\r
172struct _MENU_REFRESH_ENTRY {\r
173 MENU_REFRESH_ENTRY *Next;\r
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
179};\r
180\r
181typedef struct {\r
182 UINT16 ScanCode;\r
183 UI_SCREEN_OPERATION ScreenOperation;\r
184} SCAN_CODE_TO_SCREEN_OPERATION;\r
185\r
186typedef 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
192extern LIST_ENTRY gMenuOption;\r
193extern MENU_REFRESH_ENTRY *gMenuRefreshHead;\r
194extern UI_MENU_SELECTION *gCurrentSelection;\r
195extern BOOLEAN mHiiPackageListUpdated;\r
196\r
197//\r
198// Global Functions\r
199//\r
200/**\r
201 Initialize Menu option list.\r
202\r
203**/\r
204VOID\r
205UiInitMenu (\r
206 VOID\r
207 );\r
208\r
209/**\r
210 Initialize Menu option list.\r
211\r
212**/\r
213VOID\r
214UiInitMenuList (\r
215 VOID\r
216 );\r
217\r
218/**\r
219 Free Menu option linked list.\r
220\r
221**/\r
222VOID\r
223UiFreeMenu (\r
224 VOID\r
225 );\r
226\r
227/**\r
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
236\r
237**/\r
238UI_MENU_LIST *\r
239UiAddMenuList (\r
240 IN OUT UI_MENU_LIST *Parent,\r
241 IN EFI_GUID *FormSetGuid,\r
242 IN UINT16 FormId\r
243 );\r
244\r
245/**\r
246 Search Menu with given FormId in the parent menu and all its child menus.\r
247\r
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
252\r
253**/\r
254UI_MENU_LIST *\r
255UiFindChildMenuList (\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
269UI_MENU_LIST *\r
270UiFindMenuList (\r
271 IN EFI_GUID *FormSetGuid,\r
272 IN UINT16 FormId\r
273 );\r
274\r
275/**\r
276 Free Menu option linked list.\r
277\r
278**/\r
279VOID\r
280UiFreeRefreshList (\r
281 VOID\r
282 );\r
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
293 @retval Pointer Pointer to the added Menu Option.\r
294\r
295**/\r
296UI_MENU_OPTION *\r
297UiAddMenuOption (\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
303 );\r
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
316EFI_STATUS\r
317UiDisplayMenu (\r
318 IN OUT UI_MENU_SELECTION *Selection\r
319 );\r
320\r
321/**\r
322 Free up the resource allocated for all strings required\r
323 by Setup Browser.\r
324\r
325**/\r
326VOID\r
327FreeBrowserStrings (\r
328 VOID\r
329 );\r
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
344EFI_STATUS\r
345SetupBrowser (\r
346 IN OUT UI_MENU_SELECTION *Selection\r
347 );\r
348\r
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
357VOID\r
358SetUnicodeMem (\r
359 IN VOID *Buffer,\r
360 IN UINTN Size,\r
361 IN CHAR16 Value\r
362 );\r
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
375EFI_STATUS\r
376UiWaitForSingleEvent (\r
377 IN EFI_EVENT Event,\r
378 IN UINT64 Timeout, OPTIONAL\r
379 IN UINT8 RefreshInterval OPTIONAL\r
380 );\r
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
386 @param ScreenWidth The width of the pop-up.\r
387 @param NumberOfLines The number of lines.\r
388 @param ... A series of text strings that displayed in the pop-up.\r
389\r
390**/\r
391VOID\r
392EFIAPI\r
393CreateMultiStringPopUp (\r
394 IN UINTN ScreenWidth,\r
395 IN UINTN NumberOfLines,\r
396 ...\r
397 );\r
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
410EFI_STATUS\r
411ReadString (\r
412 IN UI_MENU_OPTION *MenuOption,\r
413 IN CHAR16 *Prompt,\r
414 OUT CHAR16 *StringPtr\r
415 );\r
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
427EFI_STATUS\r
428GetSelectionInputPopUp (\r
429 IN UI_MENU_SELECTION *Selection,\r
430 IN UI_MENU_OPTION *MenuOption\r
431 );\r
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
443EFI_STATUS\r
444GetNumericInput (\r
445 IN UI_MENU_SELECTION *Selection,\r
446 IN UI_MENU_OPTION *MenuOption\r
447 );\r
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
457VOID\r
458UpdateStatusBar (\r
459 IN UINTN MessageType,\r
460 IN UINT8 Flags,\r
461 IN BOOLEAN State\r
462 );\r
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
474EFI_STATUS\r
475ProcessQuestionConfig (\r
476 IN UI_MENU_SELECTION *Selection,\r
477 IN FORM_BROWSER_STATEMENT *Question\r
478 );\r
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
491EFI_STATUS\r
492PrintFormattedNumber (\r
493 IN FORM_BROWSER_STATEMENT *Question,\r
494 IN OUT CHAR16 *FormattedNumber,\r
495 IN UINTN BufferSize\r
496 );\r
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
508QUESTION_OPTION *\r
509ValueToOption (\r
510 IN FORM_BROWSER_STATEMENT *Question,\r
511 IN EFI_HII_VALUE *OptionValue\r
512 );\r
513\r
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
524UINT64\r
525GetArrayData (\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
540VOID\r
541SetArrayData (\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
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
560EFI_STATUS\r
561ProcessOptions (\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
566 );\r
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
577VOID\r
578ProcessHelpString (\r
579 IN CHAR16 *StringPtr,\r
580 OUT CHAR16 **FormattedString,\r
581 IN UINTN RowCount\r
582 );\r
583\r
584/**\r
585 Update key's help imformation.\r
586\r
587 @param Selection Tell setup browser the information about the Selection\r
588 @param MenuOption The Menu option\r
589 @param Selected Whether or not a tag be selected\r
590\r
591**/\r
592VOID\r
593UpdateKeyHelp (\r
594 IN UI_MENU_SELECTION *Selection,\r
595 IN UI_MENU_OPTION *MenuOption,\r
596 IN BOOLEAN Selected\r
597 );\r
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
609VOID\r
610ClearLines (\r
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
616 );\r
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
623 does not count in the resultant output. If a WIDE_CHAR is\r
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
627 If String is NULL, then ASSERT ().\r
628\r
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
634UINTN\r
635GetStringWidth (\r
636 IN CHAR16 *String\r
637 );\r
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
652UINT16\r
653GetLineByWidth (\r
654 IN CHAR16 *InputString,\r
655 IN UINT16 LineWidth,\r
656 IN OUT UINTN *Index,\r
657 OUT CHAR16 **OutputString\r
658 );\r
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
669UINT16\r
670GetWidth (\r
671 IN FORM_BROWSER_STATEMENT *Statement,\r
672 IN EFI_HII_HANDLE Handle\r
673 );\r
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
683VOID\r
684NewStrCat (\r
685 IN OUT CHAR16 *Destination,\r
686 IN CHAR16 *Source\r
687 );\r
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
697EFI_STATUS\r
698WaitForKeyStroke (\r
699 OUT EFI_INPUT_KEY *Key\r
700 );\r
701\r
702/**\r
703 Reset stack pointer to begin of the stack.\r
704\r
705**/\r
706VOID\r
707ResetScopeStack (\r
708 VOID\r
709 );\r
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
721EFI_STATUS\r
722PushScope (\r
723 IN UINT8 Operand\r
724 );\r
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
736EFI_STATUS\r
737PopScope (\r
738 OUT UINT8 *Operand\r
739 );\r
740\r
741/**\r
742 Reset stack pointer to begin of the stack.\r
743\r
744**/\r
745VOID\r
746ResetCurrentExpressionStack (\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
759EFI_STATUS\r
760PushCurrentExpression (\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
773EFI_STATUS\r
774PopCurrentExpression (\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
782VOID\r
783ResetMapExpressionListStack (\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
796EFI_STATUS\r
797PushMapExpressionList (\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
810EFI_STATUS\r
811PopMapExpressionList (\r
812 OUT VOID **Pointer\r
813 );\r
814\r
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
825FORM_BROWSER_FORM *\r
826IdToForm (\r
827 IN FORM_BROWSER_FORMSET *FormSet,\r
828 IN UINT16 FormId\r
829 );\r
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
842FORM_BROWSER_STATEMENT *\r
843IdToQuestion (\r
844 IN FORM_BROWSER_FORMSET *FormSet,\r
845 IN FORM_BROWSER_FORM *Form,\r
846 IN UINT16 QuestionId\r
847 );\r
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
855VOID\r
856ExtendValueToU64 (\r
857 IN EFI_HII_VALUE *Value\r
858 );\r
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
873INTN\r
874CompareHiiValue (\r
875 IN EFI_HII_VALUE *Value1,\r
876 IN EFI_HII_VALUE *Value2,\r
877 IN EFI_HII_HANDLE HiiHandle OPTIONAL\r
878 );\r
879\r
880/**\r
881 Evaluate the result of a HII expression\r
882\r
883 If Expression is NULL, then ASSERT.\r
884\r
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
898EFI_STATUS\r
899EvaluateExpression (\r
900 IN FORM_BROWSER_FORMSET *FormSet,\r
901 IN FORM_BROWSER_FORM *Form,\r
902 IN OUT FORM_EXPRESSION *Expression\r
903 );\r
904\r
905#endif // _UI_H\r