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