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