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