]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
Fix compiler warnings.
[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_GUID FormSetGuid;
164 UINT16 FormId;
165 UINT16 QuestionId;
166 UINTN Sequence; // used for time/date only.
167
168 UI_MENU_LIST *Parent;
169 LIST_ENTRY ChildListHead;
170 };
171
172 #define UI_MENU_LIST_FROM_LINK(a) CR (a, UI_MENU_LIST, Link, UI_MENU_LIST_SIGNATURE)
173
174 typedef struct _MENU_REFRESH_ENTRY MENU_REFRESH_ENTRY;
175 struct _MENU_REFRESH_ENTRY {
176 MENU_REFRESH_ENTRY *Next;
177 UI_MENU_OPTION *MenuOption; // Describes the entry needing an update
178 UI_MENU_SELECTION *Selection;
179 UINTN CurrentColumn;
180 UINTN CurrentRow;
181 UINTN CurrentAttribute;
182 EFI_EVENT Event;
183 };
184
185 typedef struct {
186 UINT16 ScanCode;
187 UI_SCREEN_OPERATION ScreenOperation;
188 } SCAN_CODE_TO_SCREEN_OPERATION;
189
190 typedef struct {
191 UI_SCREEN_OPERATION ScreenOperation;
192 UI_CONTROL_FLAG ControlFlag;
193 } SCREEN_OPERATION_T0_CONTROL_FLAG;
194
195
196 extern LIST_ENTRY gMenuOption;
197 extern MENU_REFRESH_ENTRY *gMenuRefreshHead;
198 extern UI_MENU_SELECTION *gCurrentSelection;
199 extern BOOLEAN mHiiPackageListUpdated;
200
201 //
202 // Global Functions
203 //
204 /**
205 Initialize Menu option list.
206
207 **/
208 VOID
209 UiInitMenu (
210 VOID
211 );
212
213 /**
214 Initialize Menu option list.
215
216 **/
217 VOID
218 UiInitMenuList (
219 VOID
220 );
221
222 /**
223 Free Menu option linked list.
224
225 **/
226 VOID
227 UiFreeMenu (
228 VOID
229 );
230
231 /**
232 Create a menu with specified formset GUID and form ID, and add it as a child
233 of the given parent menu.
234
235 @param Parent The parent of menu to be added.
236 @param FormSetGuid The Formset Guid of menu to be added.
237 @param FormId The Form ID of menu to be added.
238
239 @return A pointer to the newly added menu or NULL if memory is insufficient.
240
241 **/
242 UI_MENU_LIST *
243 UiAddMenuList (
244 IN OUT UI_MENU_LIST *Parent,
245 IN EFI_GUID *FormSetGuid,
246 IN UINT16 FormId
247 );
248
249 /**
250 Search Menu with given FormId in the parent menu and all its child menus.
251
252 @param Parent The parent of menu to search.
253 @param FormId The Form ID of menu to search.
254
255 @return A pointer to menu found or NULL if not found.
256
257 **/
258 UI_MENU_LIST *
259 UiFindChildMenuList (
260 IN UI_MENU_LIST *Parent,
261 IN UINT16 FormId
262 );
263
264 /**
265 Search Menu with given FormSetGuid and FormId in all cached menu list.
266
267 @param FormSetGuid The Formset GUID of the menu to search.
268 @param FormId The Form ID of menu to search.
269
270 @return A pointer to menu found or NULL if not found.
271
272 **/
273 UI_MENU_LIST *
274 UiFindMenuList (
275 IN EFI_GUID *FormSetGuid,
276 IN UINT16 FormId
277 );
278
279 /**
280 Free Menu option linked list.
281
282 **/
283 VOID
284 UiFreeRefreshList (
285 VOID
286 );
287
288 /**
289 Add one menu option by specified description and context.
290
291 @param String String description for this option.
292 @param Handle Hii handle for the package list.
293 @param Statement Statement of this Menu Option.
294 @param NumberOfLines Display lines for this Menu Option.
295 @param MenuItemCount The index for this Option in the Menu.
296
297 @retval Pointer Pointer to the added Menu Option.
298
299 **/
300 UI_MENU_OPTION *
301 UiAddMenuOption (
302 IN CHAR16 *String,
303 IN EFI_HII_HANDLE Handle,
304 IN FORM_BROWSER_STATEMENT *Statement,
305 IN UINT16 NumberOfLines,
306 IN UINT16 MenuItemCount
307 );
308
309 /**
310 Display menu and wait for user to select one menu option, then return it.
311 If AutoBoot is enabled, then if user doesn't select any option,
312 after period of time, it will automatically return the first menu option.
313
314 @param Selection Menu selection.
315
316 @return Return the pointer of the menu which selected,
317 @return otherwise return NULL.
318
319 **/
320 EFI_STATUS
321 UiDisplayMenu (
322 IN OUT UI_MENU_SELECTION *Selection
323 );
324
325 /**
326 Free up the resource allocated for all strings required
327 by Setup Browser.
328
329 **/
330 VOID
331 FreeBrowserStrings (
332 VOID
333 );
334
335 /**
336 Process the goto op code, update the info in the selection structure.
337
338 @param Statement The statement belong to goto op code.
339 @param Selection The selection info.
340 @param Repaint Whether need to repaint the menu.
341 @param NewLine Whether need to create new line.
342
343 @retval EFI_SUCCESS The menu process successfully.
344 @return Other value if the process failed.
345 **/
346 EFI_STATUS
347 ProcessGotoOpCode (
348 IN OUT FORM_BROWSER_STATEMENT *Statement,
349 IN OUT UI_MENU_SELECTION *Selection,
350 OUT BOOLEAN *Repaint,
351 OUT BOOLEAN *NewLine
352 );
353
354
355 /**
356 The worker function that send the displays to the screen. On output,
357 the selection made by user is returned.
358
359 @param Selection On input, Selection tell setup browser the information
360 about the Selection, form and formset to be displayed.
361 On output, Selection return the screen item that is selected
362 by user.
363
364 @retval EFI_SUCCESS The page is displayed successfully.
365 @return Other value if the page failed to be diplayed.
366
367 **/
368 EFI_STATUS
369 SetupBrowser (
370 IN OUT UI_MENU_SELECTION *Selection
371 );
372
373 /**
374 Set Buffer to Value for Size bytes.
375
376 @param Buffer Memory to set.
377 @param Size Number of bytes to set
378 @param Value Value of the set operation.
379
380 **/
381 VOID
382 SetUnicodeMem (
383 IN VOID *Buffer,
384 IN UINTN Size,
385 IN CHAR16 Value
386 );
387
388 /**
389 Wait for a given event to fire, or for an optional timeout to expire.
390
391 @param Event The event to wait for
392 @param Timeout An optional timeout value in 100 ns units.
393 @param RefreshInterval Menu refresh interval (in seconds).
394
395 @retval EFI_SUCCESS Event fired before Timeout expired.
396 @retval EFI_TIME_OUT Timout expired before Event fired.
397
398 **/
399 EFI_STATUS
400 UiWaitForSingleEvent (
401 IN EFI_EVENT Event,
402 IN UINT64 Timeout, OPTIONAL
403 IN UINT8 RefreshInterval OPTIONAL
404 );
405
406 /**
407 Draw a pop up windows based on the dimension, number of lines and
408 strings specified.
409
410 @param ScreenWidth The width of the pop-up.
411 @param NumberOfLines The number of lines.
412 @param ... A series of text strings that displayed in the pop-up.
413
414 **/
415 VOID
416 EFIAPI
417 CreateMultiStringPopUp (
418 IN UINTN ScreenWidth,
419 IN UINTN NumberOfLines,
420 ...
421 );
422
423 /**
424 Get string or password input from user.
425
426 @param MenuOption Pointer to the current input menu.
427 @param Prompt The prompt string shown on popup window.
428 @param StringPtr Old user input and destination for use input string.
429
430 @retval EFI_SUCCESS If string input is read successfully
431 @retval EFI_DEVICE_ERROR If operation fails
432
433 **/
434 EFI_STATUS
435 ReadString (
436 IN UI_MENU_OPTION *MenuOption,
437 IN CHAR16 *Prompt,
438 IN OUT CHAR16 *StringPtr
439 );
440
441 /**
442 Get selection for OneOf and OrderedList (Left/Right will be ignored).
443
444 @param Selection Pointer to current selection.
445 @param MenuOption Pointer to the current input menu.
446
447 @retval EFI_SUCCESS If Option input is processed successfully
448 @retval EFI_DEVICE_ERROR If operation fails
449
450 **/
451 EFI_STATUS
452 GetSelectionInputPopUp (
453 IN UI_MENU_SELECTION *Selection,
454 IN UI_MENU_OPTION *MenuOption
455 );
456
457 /**
458 This routine reads a numeric value from the user input.
459
460 @param Selection Pointer to current selection.
461 @param MenuOption Pointer to the current input menu.
462
463 @retval EFI_SUCCESS If numerical input is read successfully
464 @retval EFI_DEVICE_ERROR If operation fails
465
466 **/
467 EFI_STATUS
468 GetNumericInput (
469 IN UI_MENU_SELECTION *Selection,
470 IN UI_MENU_OPTION *MenuOption
471 );
472
473 /**
474 Update status bar on the bottom of menu.
475
476 @param Selection Current selection info.
477 @param MessageType The type of message to be shown.
478 @param Flags The flags in Question header.
479 @param State Set or clear.
480
481 **/
482 VOID
483 UpdateStatusBar (
484 IN UI_MENU_SELECTION *Selection,
485 IN UINTN MessageType,
486 IN UINT8 Flags,
487 IN BOOLEAN State
488 );
489
490 /**
491 Process Question Config.
492
493 @param Selection The UI menu selection.
494 @param Question The Question to be peocessed.
495
496 @retval EFI_SUCCESS Question Config process success.
497 @retval Other Question Config process fail.
498
499 **/
500 EFI_STATUS
501 ProcessQuestionConfig (
502 IN UI_MENU_SELECTION *Selection,
503 IN FORM_BROWSER_STATEMENT *Question
504 );
505
506 /**
507 Print Question Value according to it's storage width and display attributes.
508
509 @param Question The Question to be printed.
510 @param FormattedNumber Buffer for output string.
511 @param BufferSize The FormattedNumber buffer size in bytes.
512
513 @retval EFI_SUCCESS Print success.
514 @retval EFI_BUFFER_TOO_SMALL Buffer size is not enough for formatted number.
515
516 **/
517 EFI_STATUS
518 PrintFormattedNumber (
519 IN FORM_BROWSER_STATEMENT *Question,
520 IN OUT CHAR16 *FormattedNumber,
521 IN UINTN BufferSize
522 );
523
524 /**
525 Search an Option of a Question by its value.
526
527 @param Question The Question
528 @param OptionValue Value for Option to be searched.
529
530 @retval Pointer Pointer to the found Option.
531 @retval NULL Option not found.
532
533 **/
534 QUESTION_OPTION *
535 ValueToOption (
536 IN FORM_BROWSER_STATEMENT *Question,
537 IN EFI_HII_VALUE *OptionValue
538 );
539
540 /**
541 Return data element in an Array by its Index.
542
543 @param Array The data array.
544 @param Type Type of the data in this array.
545 @param Index Zero based index for data in this array.
546
547 @retval Value The data to be returned
548
549 **/
550 UINT64
551 GetArrayData (
552 IN VOID *Array,
553 IN UINT8 Type,
554 IN UINTN Index
555 );
556
557 /**
558 Set value of a data element in an Array by its Index.
559
560 @param Array The data array.
561 @param Type Type of the data in this array.
562 @param Index Zero based index for data in this array.
563 @param Value The value to be set.
564
565 **/
566 VOID
567 SetArrayData (
568 IN VOID *Array,
569 IN UINT8 Type,
570 IN UINTN Index,
571 IN UINT64 Value
572 );
573
574 /**
575 Process a Question's Option (whether selected or un-selected).
576
577 @param Selection Pointer to UI_MENU_SELECTION.
578 @param MenuOption The MenuOption for this Question.
579 @param Selected TRUE: if Question is selected.
580 @param OptionString Pointer of the Option String to be displayed.
581
582 @retval EFI_SUCCESS Question Option process success.
583 @retval Other Question Option process fail.
584
585 **/
586 EFI_STATUS
587 ProcessOptions (
588 IN UI_MENU_SELECTION *Selection,
589 IN UI_MENU_OPTION *MenuOption,
590 IN BOOLEAN Selected,
591 OUT CHAR16 **OptionString
592 );
593
594 /**
595 Process the help string: Split StringPtr to several lines of strings stored in
596 FormattedString and the glyph width of each line cannot exceed gHelpBlockWidth.
597
598 @param StringPtr The entire help string.
599 @param FormattedString The oupput formatted string.
600 @param RowCount TRUE: if Question is selected.
601
602 **/
603 VOID
604 ProcessHelpString (
605 IN CHAR16 *StringPtr,
606 OUT CHAR16 **FormattedString,
607 IN UINTN RowCount
608 );
609
610 /**
611 Update key's help imformation.
612
613 @param Selection Tell setup browser the information about the Selection
614 @param MenuOption The Menu option
615 @param Selected Whether or not a tag be selected
616
617 **/
618 VOID
619 UpdateKeyHelp (
620 IN UI_MENU_SELECTION *Selection,
621 IN UI_MENU_OPTION *MenuOption,
622 IN BOOLEAN Selected
623 );
624
625 /**
626 Clear retangle with specified text attribute.
627
628 @param LeftColumn Left column of retangle.
629 @param RightColumn Right column of retangle.
630 @param TopRow Start row of retangle.
631 @param BottomRow End row of retangle.
632 @param TextAttribute The character foreground and background.
633
634 **/
635 VOID
636 ClearLines (
637 IN UINTN LeftColumn,
638 IN UINTN RightColumn,
639 IN UINTN TopRow,
640 IN UINTN BottomRow,
641 IN UINTN TextAttribute
642 );
643
644 /**
645 Count the storage space of a Unicode string.
646
647 This function handles the Unicode string with NARROW_CHAR
648 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR
649 does not count in the resultant output. If a WIDE_CHAR is
650 hit, then 2 Unicode character will consume an output storage
651 space with size of CHAR16 till a NARROW_CHAR is hit.
652
653 If String is NULL, then ASSERT ().
654
655 @param String The input string to be counted.
656
657 @return Storage space for the input string.
658
659 **/
660 UINTN
661 GetStringWidth (
662 IN CHAR16 *String
663 );
664
665 /**
666 Will copy LineWidth amount of a string in the OutputString buffer and return the
667 number of CHAR16 characters that were copied into the OutputString buffer.
668
669 @param InputString String description for this option.
670 @param LineWidth Width of the desired string to extract in CHAR16
671 characters
672 @param Index Where in InputString to start the copy process
673 @param OutputString Buffer to copy the string into
674
675 @return Returns the number of CHAR16 characters that were copied into the OutputString buffer.
676
677 **/
678 UINT16
679 GetLineByWidth (
680 IN CHAR16 *InputString,
681 IN UINT16 LineWidth,
682 IN OUT UINTN *Index,
683 OUT CHAR16 **OutputString
684 );
685
686 /**
687 Get the supported width for a particular op-code
688
689 @param Statement The FORM_BROWSER_STATEMENT structure passed in.
690 @param Handle The handle in the HII database being used
691
692 @return Returns the number of CHAR16 characters that is support.
693
694 **/
695 UINT16
696 GetWidth (
697 IN FORM_BROWSER_STATEMENT *Statement,
698 IN EFI_HII_HANDLE Handle
699 );
700
701 /**
702 Concatenate a narrow string to another string.
703
704 @param Destination The destination string.
705 @param Source The source string. The string to be concatenated.
706 to the end of Destination.
707
708 **/
709 VOID
710 NewStrCat (
711 IN OUT CHAR16 *Destination,
712 IN CHAR16 *Source
713 );
714
715 /**
716 Wait for a key to be pressed by user.
717
718 @param Key The key which is pressed by user.
719
720 @retval EFI_SUCCESS The function always completed successfully.
721
722 **/
723 EFI_STATUS
724 WaitForKeyStroke (
725 OUT EFI_INPUT_KEY *Key
726 );
727
728 /**
729 Reset stack pointer to begin of the stack.
730
731 **/
732 VOID
733 ResetScopeStack (
734 VOID
735 );
736
737 /**
738 Push an Operand onto the Stack
739
740 @param Operand Operand to push.
741
742 @retval EFI_SUCCESS The value was pushed onto the stack.
743 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the
744 stack.
745
746 **/
747 EFI_STATUS
748 PushScope (
749 IN UINT8 Operand
750 );
751
752 /**
753 Pop an Operand from the Stack
754
755 @param Operand Operand to pop.
756
757 @retval EFI_SUCCESS The value was pushed onto the stack.
758 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the
759 stack.
760
761 **/
762 EFI_STATUS
763 PopScope (
764 OUT UINT8 *Operand
765 );
766
767 /**
768 Reset stack pointer to begin of the stack.
769
770 **/
771 VOID
772 ResetCurrentExpressionStack (
773 VOID
774 );
775
776 /**
777 Push current expression onto the Stack
778
779 @param Pointer Pointer to current expression.
780
781 @retval EFI_SUCCESS The value was pushed onto the stack.
782 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
783
784 **/
785 EFI_STATUS
786 PushCurrentExpression (
787 IN VOID *Pointer
788 );
789
790 /**
791 Pop current expression from the Stack
792
793 @param Pointer Pointer to current expression to be pop.
794
795 @retval EFI_SUCCESS The value was pushed onto the stack.
796 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
797
798 **/
799 EFI_STATUS
800 PopCurrentExpression (
801 OUT VOID **Pointer
802 );
803
804 /**
805 Reset stack pointer to begin of the stack.
806
807 **/
808 VOID
809 ResetMapExpressionListStack (
810 VOID
811 );
812
813 /**
814 Push the list of map expression onto the Stack
815
816 @param Pointer Pointer to the list of map expression to be pushed.
817
818 @retval EFI_SUCCESS The value was pushed onto the stack.
819 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
820
821 **/
822 EFI_STATUS
823 PushMapExpressionList (
824 IN VOID *Pointer
825 );
826
827 /**
828 Pop the list of map expression from the Stack
829
830 @param Pointer Pointer to the list of map expression to be pop.
831
832 @retval EFI_SUCCESS The value was pushed onto the stack.
833 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
834
835 **/
836 EFI_STATUS
837 PopMapExpressionList (
838 OUT VOID **Pointer
839 );
840
841 /**
842 Get Form given its FormId.
843
844 @param FormSet The formset which contains this form.
845 @param FormId Id of this form.
846
847 @retval Pointer The form.
848 @retval NULL Specified Form is not found in the formset.
849
850 **/
851 FORM_BROWSER_FORM *
852 IdToForm (
853 IN FORM_BROWSER_FORMSET *FormSet,
854 IN UINT16 FormId
855 );
856
857 /**
858 Search a Question in Formset scope using its QuestionId.
859
860 @param FormSet The formset which contains this form.
861 @param Form The form which contains this Question.
862 @param QuestionId Id of this Question.
863
864 @retval Pointer The Question.
865 @retval NULL Specified Question not found in the form.
866
867 **/
868 FORM_BROWSER_STATEMENT *
869 IdToQuestion (
870 IN FORM_BROWSER_FORMSET *FormSet,
871 IN FORM_BROWSER_FORM *Form,
872 IN UINT16 QuestionId
873 );
874
875 /**
876 Zero extend integer/boolean/date/time to UINT64 for comparing.
877
878 @param Value HII Value to be converted.
879
880 **/
881 VOID
882 ExtendValueToU64 (
883 IN EFI_HII_VALUE *Value
884 );
885
886 /**
887 Compare two Hii value.
888
889 @param Value1 Expression value to compare on left-hand.
890 @param Value2 Expression value to compare on right-hand.
891 @param HiiHandle Only required for string compare.
892
893 @retval EFI_INVALID_PARAMETER Could not perform comparation on two values.
894 @retval 0 Two operators equeal.
895 @return Positive value if Value1 is greater than Value2.
896 @retval Negative value if Value1 is less than Value2.
897
898 **/
899 INTN
900 CompareHiiValue (
901 IN EFI_HII_VALUE *Value1,
902 IN EFI_HII_VALUE *Value2,
903 IN EFI_HII_HANDLE HiiHandle OPTIONAL
904 );
905
906 /**
907 Evaluate the result of a HII expression
908
909 If Expression is NULL, then ASSERT.
910
911 @param FormSet FormSet associated with this expression.
912 @param Form Form associated with this expression.
913 @param Expression Expression to be evaluated.
914
915 @retval EFI_SUCCESS The expression evaluated successfuly
916 @retval EFI_NOT_FOUND The Question which referenced by a QuestionId
917 could not be found.
918 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the
919 stack.
920 @retval EFI_ACCESS_DENIED The pop operation underflowed the stack
921 @retval EFI_INVALID_PARAMETER Syntax error with the Expression
922
923 **/
924 EFI_STATUS
925 EvaluateExpression (
926 IN FORM_BROWSER_FORMSET *FormSet,
927 IN FORM_BROWSER_FORM *Form,
928 IN OUT FORM_EXPRESSION *Expression
929 );
930
931 #endif // _UI_H