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