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