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