]>
Commit | Line | Data |
---|---|---|
7c6c064c ED |
1 | /** @file\r |
2 | FormDiplay protocol to show Form\r | |
3 | \r | |
d1102dba | 4 | Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
7c6c064c ED |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef __FORM_DISPLAY_H__\r | |
10 | #define __FORM_DISPLAY_H__\r | |
11 | \r | |
12 | \r | |
13 | #include <Library/UefiBootServicesTableLib.h>\r | |
14 | #include <Library/DebugLib.h>\r | |
15 | #include <Library/BaseMemoryLib.h>\r | |
16 | #include <Library/BaseLib.h>\r | |
17 | #include <Library/HiiLib.h>\r | |
18 | #include <Library/MemoryAllocationLib.h>\r | |
19 | #include <Library/PrintLib.h>\r | |
20 | #include <Library/CustomizedDisplayLib.h>\r | |
21 | \r | |
22 | #include <Protocol/FormBrowserEx2.h>\r | |
23 | #include <Protocol/SimpleTextIn.h>\r | |
24 | #include <Protocol/DisplayProtocol.h>\r | |
06aad9a2 | 25 | #include <Protocol/HiiPopup.h>\r |
7c6c064c ED |
26 | \r |
27 | #include <Guid/MdeModuleHii.h>\r | |
28 | \r | |
29 | //\r | |
30 | // This is the generated header file which includes whatever needs to be exported (strings + IFR)\r | |
31 | //\r | |
32 | extern UINT8 DisplayEngineStrings[];\r | |
33 | extern EFI_SCREEN_DESCRIPTOR gStatementDimensions;\r | |
34 | extern USER_INPUT *gUserInput;\r | |
35 | extern FORM_DISPLAY_ENGINE_FORM *gFormData;\r | |
36 | extern EFI_HII_HANDLE gHiiHandle;\r | |
37 | extern UINT16 gDirection;\r | |
38 | extern LIST_ENTRY gMenuOption;\r | |
06aad9a2 DB |
39 | extern CHAR16 *gConfirmOptYes;\r |
40 | extern CHAR16 *gConfirmOptNo;\r | |
41 | extern CHAR16 *gConfirmOptOk;\r | |
42 | extern CHAR16 *gConfirmOptCancel;\r | |
43 | extern CHAR16 *gYesOption;\r | |
44 | extern CHAR16 *gNoOption;\r | |
45 | extern CHAR16 *gOkOption;\r | |
46 | extern CHAR16 *gCancelOption;\r | |
47 | extern CHAR16 *gErrorPopup;\r | |
48 | extern CHAR16 *gWarningPopup;\r | |
49 | extern CHAR16 *gInfoPopup;\r | |
7c6c064c ED |
50 | \r |
51 | //\r | |
52 | // Browser Global Strings\r | |
53 | //\r | |
54 | extern CHAR16 *gSaveFailed;\r | |
55 | extern CHAR16 *gPromptForData;\r | |
56 | extern CHAR16 *gPromptForPassword;\r | |
57 | extern CHAR16 *gPromptForNewPassword;\r | |
58 | extern CHAR16 *gConfirmPassword;\r | |
59 | extern CHAR16 *gConfirmError;\r | |
60 | extern CHAR16 *gPassowordInvalid;\r | |
61 | extern CHAR16 *gPressEnter;\r | |
62 | extern CHAR16 *gEmptyString;\r | |
63 | extern CHAR16 *gMiniString;\r | |
64 | extern CHAR16 *gOptionMismatch;\r | |
65 | extern CHAR16 *gFormSuppress;\r | |
66 | extern CHAR16 *gProtocolNotFound;\r | |
88f0c4e2 | 67 | extern CHAR16 *gPasswordUnsupported;\r |
7c6c064c ED |
68 | \r |
69 | extern CHAR16 gPromptBlockWidth;\r | |
70 | extern CHAR16 gOptionBlockWidth;\r | |
71 | extern CHAR16 gHelpBlockWidth;\r | |
72 | extern CHAR16 *mUnknownString;\r | |
42645c3d | 73 | extern BOOLEAN gMisMatch;\r |
7c6c064c ED |
74 | \r |
75 | //\r | |
76 | // Screen definitions\r | |
77 | //\r | |
78 | \r | |
79 | #define LEFT_SKIPPED_COLUMNS 3\r | |
80 | #define SCROLL_ARROW_HEIGHT 1\r | |
81 | #define POPUP_PAD_SPACE_COUNT 5\r | |
82 | #define POPUP_FRAME_WIDTH 2\r | |
83 | \r | |
4d4deaac ED |
84 | #define UPPER_LOWER_CASE_OFFSET 0x20\r |
85 | \r | |
7c6c064c ED |
86 | //\r |
87 | // Display definitions\r | |
88 | //\r | |
89 | #define LEFT_ONEOF_DELIMITER L'<'\r | |
90 | #define RIGHT_ONEOF_DELIMITER L'>'\r | |
91 | \r | |
92 | #define LEFT_NUMERIC_DELIMITER L'['\r | |
93 | #define RIGHT_NUMERIC_DELIMITER L']'\r | |
94 | \r | |
95 | #define LEFT_CHECKBOX_DELIMITER L'['\r | |
96 | #define RIGHT_CHECKBOX_DELIMITER L']'\r | |
97 | \r | |
98 | #define CHECK_ON L'X'\r | |
99 | #define CHECK_OFF L' '\r | |
100 | \r | |
101 | #define TIME_SEPARATOR L':'\r | |
102 | #define DATE_SEPARATOR L'/'\r | |
103 | \r | |
104 | #define SUBTITLE_INDENT 2\r | |
105 | \r | |
106 | //\r | |
107 | // This is the Input Error Message\r | |
108 | //\r | |
109 | #define INPUT_ERROR 1\r | |
110 | \r | |
111 | //\r | |
112 | // This is the NV RAM update required Message\r | |
113 | //\r | |
114 | #define NV_UPDATE_REQUIRED 2\r | |
115 | //\r | |
116 | // Time definitions\r | |
117 | //\r | |
118 | #define ONE_SECOND 10000000\r | |
119 | \r | |
120 | //\r | |
121 | // It take 23 characters including the NULL to print a 64 bits number with "[" and "]".\r | |
122 | // pow(2, 64) = [18446744073709551616]\r | |
aee257db | 123 | // with extra '-' flat, set the width to 24.\r |
7c6c064c | 124 | //\r |
aee257db | 125 | #define MAX_NUMERIC_INPUT_WIDTH 24\r |
7c6c064c ED |
126 | \r |
127 | #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0\r | |
128 | #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1\r | |
129 | #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2\r | |
130 | #define EFI_HII_EXPRESSION_SUPPRESS_IF 3\r | |
131 | #define EFI_HII_EXPRESSION_DISABLE_IF 4\r | |
132 | \r | |
133 | //\r | |
134 | // Character definitions\r | |
135 | //\r | |
136 | #define CHAR_SPACE 0x0020\r | |
137 | \r | |
138 | #define FORM_DISPLAY_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'D', 'D', 'V')\r | |
139 | typedef struct {\r | |
140 | UINT32 Signature;\r | |
141 | \r | |
142 | EFI_HANDLE Handle;\r | |
143 | \r | |
144 | //\r | |
145 | // Produced protocol\r | |
146 | //\r | |
147 | EDKII_FORM_DISPLAY_ENGINE_PROTOCOL FromDisplayProt;\r | |
06aad9a2 | 148 | EFI_HII_POPUP_PROTOCOL HiiPopup;\r |
7c6c064c ED |
149 | } FORM_DISPLAY_DRIVER_PRIVATE_DATA;\r |
150 | \r | |
151 | \r | |
152 | typedef enum {\r | |
153 | UiNoOperation,\r | |
154 | UiSelect,\r | |
155 | UiUp,\r | |
156 | UiDown,\r | |
157 | UiLeft,\r | |
158 | UiRight,\r | |
159 | UiReset,\r | |
160 | UiPrevious,\r | |
161 | UiPageUp,\r | |
162 | UiPageDown,\r | |
163 | UiHotKey,\r | |
164 | UiMaxOperation\r | |
165 | } UI_SCREEN_OPERATION;\r | |
166 | \r | |
167 | typedef enum {\r | |
168 | CfInitialization,\r | |
169 | CfCheckSelection,\r | |
170 | CfRepaint,\r | |
171 | CfRefreshHighLight,\r | |
172 | CfUpdateHelpString,\r | |
173 | CfPrepareToReadKey,\r | |
174 | CfReadKey,\r | |
175 | CfScreenOperation,\r | |
176 | CfUiSelect,\r | |
177 | CfUiReset,\r | |
178 | CfUiLeft,\r | |
179 | CfUiRight,\r | |
180 | CfUiUp,\r | |
181 | CfUiPageUp,\r | |
182 | CfUiPageDown,\r | |
183 | CfUiDown,\r | |
7c6c064c ED |
184 | CfUiNoOperation,\r |
185 | CfExit,\r | |
186 | CfUiHotKey,\r | |
187 | CfMaxControlFlag\r | |
188 | } UI_CONTROL_FLAG;\r | |
189 | \r | |
190 | typedef enum {\r | |
191 | UIEventNone,\r | |
192 | UIEventKey,\r | |
193 | UIEventTimeOut,\r | |
194 | UIEventDriver\r | |
195 | } UI_EVENT_TYPE;\r | |
196 | \r | |
197 | typedef struct {\r | |
198 | UINT16 ScanCode;\r | |
199 | UI_SCREEN_OPERATION ScreenOperation;\r | |
200 | } SCAN_CODE_TO_SCREEN_OPERATION;\r | |
201 | \r | |
202 | typedef struct {\r | |
203 | UI_SCREEN_OPERATION ScreenOperation;\r | |
204 | UI_CONTROL_FLAG ControlFlag;\r | |
205 | } SCREEN_OPERATION_T0_CONTROL_FLAG;\r | |
206 | \r | |
207 | typedef struct {\r | |
336c8e11 | 208 | EFI_HII_HANDLE HiiHandle;\r |
42645c3d | 209 | UINT16 FormId;\r |
d1102dba | 210 | \r |
42645c3d ED |
211 | //\r |
212 | // Info for the highlight question.\r | |
213 | // HLT means highlight\r | |
214 | //\r | |
215 | // If one statement has questionid, save questionid info to find the question.\r | |
d1102dba | 216 | // If one statement not has questionid info, save the opcode info to find the\r |
42645c3d | 217 | // statement. If more than one statement has same opcode in one form(just like\r |
d1102dba | 218 | // empty subtitle info may has more than one info one form), also use Index\r |
42645c3d ED |
219 | // info to find the statement.\r |
220 | //\r | |
221 | EFI_QUESTION_ID HLTQuestionId;\r | |
222 | EFI_IFR_OP_HEADER *HLTOpCode;\r | |
223 | UINTN HLTIndex;\r | |
224 | UINTN HLTSequence;\r | |
d1102dba | 225 | \r |
42645c3d ED |
226 | //\r |
227 | // Info for the top of screen question.\r | |
228 | // TOS means Top Of Screen\r | |
229 | //\r | |
230 | EFI_QUESTION_ID TOSQuestionId;\r | |
231 | EFI_IFR_OP_HEADER *TOSOpCode;\r | |
232 | UINTN TOSIndex;\r | |
233 | \r | |
336c8e11 | 234 | UINT16 SkipValue;\r |
7c6c064c ED |
235 | } DISPLAY_HIGHLIGHT_MENU_INFO;\r |
236 | \r | |
bfae1330 ED |
237 | typedef struct {\r |
238 | EFI_EVENT SyncEvent;\r | |
239 | UINT8 *TimeOut;\r | |
240 | CHAR16 *ErrorInfo;\r | |
241 | } WARNING_IF_CONTEXT;\r | |
242 | \r | |
7c6c064c ED |
243 | #define UI_MENU_OPTION_SIGNATURE SIGNATURE_32 ('u', 'i', 'm', 'm')\r |
244 | \r | |
245 | typedef struct {\r | |
246 | UINTN Signature;\r | |
247 | LIST_ENTRY Link;\r | |
248 | \r | |
249 | EFI_HII_HANDLE Handle;\r | |
250 | FORM_DISPLAY_ENGINE_STATEMENT *ThisTag;\r | |
251 | UINT16 EntryNumber;\r | |
252 | \r | |
253 | UINTN Row;\r | |
254 | UINTN Col;\r | |
255 | UINTN OptCol;\r | |
256 | CHAR16 *Description;\r | |
257 | UINTN Skip; // Number of lines\r | |
258 | \r | |
259 | //\r | |
260 | // Display item sequence for date/time\r | |
261 | // Date: Month/Day/Year\r | |
262 | // Sequence: 0 1 2\r | |
263 | //\r | |
264 | // Time: Hour : Minute : Second\r | |
265 | // Sequence: 0 1 2\r | |
266 | //\r | |
267 | //\r | |
268 | UINTN Sequence;\r | |
269 | \r | |
270 | BOOLEAN GrayOut;\r | |
271 | BOOLEAN ReadOnly;\r | |
272 | \r | |
273 | //\r | |
274 | // Whether user could change value of this item\r | |
275 | //\r | |
276 | BOOLEAN IsQuestion;\r | |
277 | BOOLEAN NestInStatement;\r | |
278 | } UI_MENU_OPTION;\r | |
279 | \r | |
280 | #define MENU_OPTION_FROM_LINK(a) CR (a, UI_MENU_OPTION, Link, UI_MENU_OPTION_SIGNATURE)\r | |
281 | \r | |
06aad9a2 DB |
282 | #define USER_SELECTABLE_OPTION_OK_WIDTH StrLen (gOkOption)\r |
283 | #define USER_SELECTABLE_OPTION_OK_CAL_WIDTH (StrLen (gOkOption) + StrLen (gCancelOption))\r | |
284 | #define USER_SELECTABLE_OPTION_YES_NO_WIDTH (StrLen (gYesOption) + StrLen (gNoOption))\r | |
285 | #define USER_SELECTABLE_OPTION_YES_NO_CAL_WIDTH (StrLen (gYesOption) + StrLen (gNoOption) + StrLen (gCancelOption))\r | |
286 | \r | |
287 | #define USER_SELECTABLE_OPTION_SKIP_WIDTH 2\r | |
288 | \r | |
289 | //\r | |
290 | // +-------------------------------------------+ // POPUP_BORDER }\r | |
291 | // | ERROR/WARNING/INFO | // POPUP_STYLE_STRING_HEIGHT } POPUP_HEADER_HEIGHT\r | |
292 | // |-------------------------------------------| // POPUP_EMPTY_LINE_HEIGHT }\r | |
293 | // | popup messages |\r | |
294 | // | | // POPUP_EMPTY_LINE_HEIGHT }\r | |
295 | // | user selectable options | // POPUP_USER_SELECTABLE_OPTION_HEIGHT } POPUP_FOOTER_HEIGHT\r | |
296 | // +-------------------------------------------+ // POPUP_BORDER }\r | |
297 | //\r | |
298 | #define POPUP_BORDER 1\r | |
299 | #define POPUP_EMPTY_LINE_HEIGHT 1\r | |
300 | #define POPUP_STYLE_STRING_HEIGHT 1\r | |
301 | #define POPUP_USER_SELECTABLE_OPTION_HEIGHT 1\r | |
302 | \r | |
303 | #define POPUP_HEADER_HEIGHT (POPUP_BORDER + POPUP_STYLE_STRING_HEIGHT + POPUP_EMPTY_LINE_HEIGHT)\r | |
304 | #define POPUP_FOOTER_HEIGHT (POPUP_EMPTY_LINE_HEIGHT + POPUP_USER_SELECTABLE_OPTION_HEIGHT + POPUP_BORDER)\r | |
305 | \r | |
306 | #define USER_SELECTABLE_OPTION_SIGNATURE SIGNATURE_32 ('u', 's', 's', 'o')\r | |
307 | \r | |
308 | typedef struct {\r | |
309 | UINTN Signature;\r | |
310 | LIST_ENTRY Link;\r | |
311 | EFI_HII_POPUP_SELECTION OptionType;\r | |
312 | CHAR16 *OptionString;\r | |
313 | //\r | |
314 | // Display item sequence for user select options\r | |
315 | // Ok: Ok\r | |
316 | // Sequence: 0\r | |
317 | //\r | |
318 | // Ok/Cancel: Ok : Cancel\r | |
319 | // Sequence: 0 1\r | |
320 | //\r | |
321 | // Yes/No: Yes : No\r | |
322 | // Sequence: 0 1\r | |
323 | //\r | |
324 | // Yes/No/Cancel: Yes : No: Cancel\r | |
325 | // Sequence: 0 1 2\r | |
326 | //\r | |
327 | UINTN Sequence;\r | |
328 | UINTN OptionRow;\r | |
329 | UINTN OptionCol;\r | |
330 | UINTN MaxSequence;\r | |
331 | UINTN MinSequence;\r | |
332 | } USER_SELECTABLE_OPTION;\r | |
333 | \r | |
334 | #define SELECTABLE_OPTION_FROM_LINK(a) CR (a, USER_SELECTABLE_OPTION, Link, USER_SELECTABLE_OPTION_SIGNATURE)\r | |
335 | \r | |
7c6c064c ED |
336 | /**\r |
337 | Print Question Value according to it's storage width and display attributes.\r | |
338 | \r | |
339 | @param Question The Question to be printed.\r | |
340 | @param FormattedNumber Buffer for output string.\r | |
341 | @param BufferSize The FormattedNumber buffer size in bytes.\r | |
342 | \r | |
343 | @retval EFI_SUCCESS Print success.\r | |
344 | @retval EFI_BUFFER_TOO_SMALL Buffer size is not enough for formatted number.\r | |
345 | \r | |
346 | **/\r | |
347 | EFI_STATUS\r | |
348 | PrintFormattedNumber (\r | |
349 | IN FORM_DISPLAY_ENGINE_STATEMENT *Question,\r | |
350 | IN OUT CHAR16 *FormattedNumber,\r | |
351 | IN UINTN BufferSize\r | |
352 | );\r | |
353 | \r | |
354 | /**\r | |
355 | Set value of a data element in an Array by its Index.\r | |
356 | \r | |
357 | @param Array The data array.\r | |
358 | @param Type Type of the data in this array.\r | |
359 | @param Index Zero based index for data in this array.\r | |
360 | @param Value The value to be set.\r | |
361 | \r | |
362 | **/\r | |
363 | VOID\r | |
364 | SetArrayData (\r | |
365 | IN VOID *Array,\r | |
366 | IN UINT8 Type,\r | |
367 | IN UINTN Index,\r | |
368 | IN UINT64 Value\r | |
369 | );\r | |
370 | \r | |
371 | /**\r | |
372 | Return data element in an Array by its Index.\r | |
373 | \r | |
374 | @param Array The data array.\r | |
375 | @param Type Type of the data in this array.\r | |
376 | @param Index Zero based index for data in this array.\r | |
377 | \r | |
378 | @retval Value The data to be returned\r | |
379 | \r | |
380 | **/\r | |
381 | UINT64\r | |
382 | GetArrayData (\r | |
383 | IN VOID *Array,\r | |
384 | IN UINT8 Type,\r | |
385 | IN UINTN Index\r | |
386 | );\r | |
d1102dba | 387 | \r |
7c6c064c ED |
388 | /**\r |
389 | Search an Option of a Question by its value.\r | |
390 | \r | |
391 | @param Question The Question\r | |
392 | @param OptionValue Value for Option to be searched.\r | |
393 | \r | |
394 | @retval Pointer Pointer to the found Option.\r | |
395 | @retval NULL Option not found.\r | |
396 | \r | |
397 | **/\r | |
398 | DISPLAY_QUESTION_OPTION *\r | |
399 | ValueToOption (\r | |
400 | IN FORM_DISPLAY_ENGINE_STATEMENT *Question,\r | |
401 | IN EFI_HII_VALUE *OptionValue\r | |
402 | );\r | |
403 | \r | |
404 | /**\r | |
405 | Compare two Hii value.\r | |
406 | \r | |
407 | @param Value1 Expression value to compare on left-hand.\r | |
408 | @param Value2 Expression value to compare on right-hand.\r | |
409 | @param Result Return value after compare.\r | |
410 | retval 0 Two operators equal.\r | |
411 | return Positive value if Value1 is greater than Value2.\r | |
412 | retval Negative value if Value1 is less than Value2.\r | |
413 | @param HiiHandle Only required for string compare.\r | |
414 | \r | |
415 | @retval other Could not perform compare on two values.\r | |
416 | @retval EFI_SUCCESS Compare the value success.\r | |
417 | \r | |
418 | **/\r | |
419 | EFI_STATUS\r | |
420 | CompareHiiValue (\r | |
421 | IN EFI_HII_VALUE *Value1,\r | |
422 | IN EFI_HII_VALUE *Value2,\r | |
423 | OUT INTN *Result,\r | |
424 | IN EFI_HII_HANDLE HiiHandle OPTIONAL\r | |
425 | );\r | |
426 | \r | |
427 | /**\r | |
428 | Draw a pop up windows based on the dimension, number of lines and\r | |
429 | strings specified.\r | |
430 | \r | |
431 | @param RequestedWidth The width of the pop-up.\r | |
432 | @param NumberOfLines The number of lines.\r | |
433 | @param ... A series of text strings that displayed in the pop-up.\r | |
434 | \r | |
435 | **/\r | |
436 | VOID\r | |
437 | EFIAPI\r | |
438 | CreateMultiStringPopUp (\r | |
439 | IN UINTN RequestedWidth,\r | |
440 | IN UINTN NumberOfLines,\r | |
441 | ...\r | |
442 | );\r | |
443 | \r | |
444 | /**\r | |
445 | Will copy LineWidth amount of a string in the OutputString buffer and return the\r | |
446 | number of CHAR16 characters that were copied into the OutputString buffer.\r | |
447 | The output string format is:\r | |
448 | Glyph Info + String info + '\0'.\r | |
449 | \r | |
450 | In the code, it deals \r,\n,\r\n same as \n\r, also it not process the \r or \g.\r | |
451 | \r | |
452 | @param InputString String description for this option.\r | |
453 | @param LineWidth Width of the desired string to extract in CHAR16\r | |
454 | characters\r | |
455 | @param GlyphWidth The glyph width of the begin of the char in the string.\r | |
456 | @param Index Where in InputString to start the copy process\r | |
457 | @param OutputString Buffer to copy the string into\r | |
458 | \r | |
d1102dba | 459 | @return Returns the number of CHAR16 characters that were copied into the OutputString\r |
7c6c064c ED |
460 | buffer, include extra glyph info and '\0' info.\r |
461 | \r | |
462 | **/\r | |
463 | UINT16\r | |
464 | GetLineByWidth (\r | |
465 | IN CHAR16 *InputString,\r | |
466 | IN UINT16 LineWidth,\r | |
467 | IN OUT UINT16 *GlyphWidth,\r | |
468 | IN OUT UINTN *Index,\r | |
469 | OUT CHAR16 **OutputString\r | |
470 | );\r | |
471 | \r | |
472 | \r | |
473 | /**\r | |
474 | Get the string based on the StringId and HII Package List Handle.\r | |
475 | \r | |
476 | @param Token The String's ID.\r | |
477 | @param HiiHandle The Hii handle for this string package.\r | |
478 | \r | |
479 | @return The output string.\r | |
480 | \r | |
481 | **/\r | |
482 | CHAR16 *\r | |
483 | GetToken (\r | |
484 | IN EFI_STRING_ID Token,\r | |
485 | IN EFI_HII_HANDLE HiiHandle\r | |
486 | );\r | |
d1102dba | 487 | \r |
7c6c064c ED |
488 | /**\r |
489 | Count the storage space of a Unicode string.\r | |
490 | \r | |
491 | This function handles the Unicode string with NARROW_CHAR\r | |
492 | and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR\r | |
493 | does not count in the resultant output. If a WIDE_CHAR is\r | |
494 | hit, then 2 Unicode character will consume an output storage\r | |
495 | space with size of CHAR16 till a NARROW_CHAR is hit.\r | |
496 | \r | |
497 | If String is NULL, then ASSERT ().\r | |
498 | \r | |
499 | @param String The input string to be counted.\r | |
500 | \r | |
501 | @return Storage space for the input string.\r | |
502 | \r | |
503 | **/\r | |
504 | UINTN\r | |
505 | GetStringWidth (\r | |
506 | IN CHAR16 *String\r | |
507 | );\r | |
508 | \r | |
509 | /**\r | |
510 | This routine reads a numeric value from the user input.\r | |
511 | \r | |
512 | @param MenuOption Pointer to the current input menu.\r | |
513 | \r | |
514 | @retval EFI_SUCCESS If numerical input is read successfully\r | |
515 | @retval EFI_DEVICE_ERROR If operation fails\r | |
516 | \r | |
517 | **/\r | |
518 | EFI_STATUS\r | |
519 | GetNumericInput (\r | |
520 | IN UI_MENU_OPTION *MenuOption\r | |
521 | );\r | |
522 | \r | |
523 | /**\r | |
524 | Get string or password input from user.\r | |
525 | \r | |
526 | @param MenuOption Pointer to the current input menu.\r | |
527 | @param Prompt The prompt string shown on popup window.\r | |
528 | @param StringPtr Old user input and destination for use input string.\r | |
529 | \r | |
530 | @retval EFI_SUCCESS If string input is read successfully\r | |
531 | @retval EFI_DEVICE_ERROR If operation fails\r | |
532 | \r | |
533 | **/\r | |
534 | EFI_STATUS\r | |
535 | ReadString (\r | |
536 | IN UI_MENU_OPTION *MenuOption,\r | |
537 | IN CHAR16 *Prompt,\r | |
538 | IN OUT CHAR16 *StringPtr\r | |
539 | );\r | |
540 | \r | |
541 | /**\r | |
542 | Draw a pop up windows based on the dimension, number of lines and\r | |
543 | strings specified.\r | |
544 | \r | |
545 | @param RequestedWidth The width of the pop-up.\r | |
546 | @param NumberOfLines The number of lines.\r | |
547 | @param Marker The variable argument list for the list of string to be printed.\r | |
548 | \r | |
549 | **/\r | |
550 | VOID\r | |
551 | CreateSharedPopUp (\r | |
552 | IN UINTN RequestedWidth,\r | |
553 | IN UINTN NumberOfLines,\r | |
554 | IN VA_LIST Marker\r | |
555 | );\r | |
d1102dba | 556 | \r |
7c6c064c ED |
557 | /**\r |
558 | Wait for a key to be pressed by user.\r | |
559 | \r | |
560 | @param Key The key which is pressed by user.\r | |
561 | \r | |
562 | @retval EFI_SUCCESS The function always completed successfully.\r | |
563 | \r | |
564 | **/\r | |
565 | EFI_STATUS\r | |
566 | WaitForKeyStroke (\r | |
567 | OUT EFI_INPUT_KEY *Key\r | |
568 | );\r | |
569 | \r | |
570 | /**\r | |
571 | Get selection for OneOf and OrderedList (Left/Right will be ignored).\r | |
572 | \r | |
573 | @param MenuOption Pointer to the current input menu.\r | |
574 | \r | |
575 | @retval EFI_SUCCESS If Option input is processed successfully\r | |
576 | @retval EFI_DEVICE_ERROR If operation fails\r | |
577 | \r | |
578 | **/\r | |
579 | EFI_STATUS\r | |
580 | GetSelectionInputPopUp (\r | |
581 | IN UI_MENU_OPTION *MenuOption\r | |
582 | );\r | |
583 | \r | |
584 | /**\r | |
585 | Process the help string: Split StringPtr to several lines of strings stored in\r | |
586 | FormattedString and the glyph width of each line cannot exceed gHelpBlockWidth.\r | |
587 | \r | |
588 | @param StringPtr The entire help string.\r | |
589 | @param FormattedString The oupput formatted string.\r | |
590 | @param EachLineWidth The max string length of each line in the formatted string.\r | |
591 | @param RowCount TRUE: if Question is selected.\r | |
592 | \r | |
593 | **/\r | |
594 | UINTN\r | |
595 | ProcessHelpString (\r | |
596 | IN CHAR16 *StringPtr,\r | |
597 | OUT CHAR16 **FormattedString,\r | |
598 | OUT UINT16 *EachLineWidth,\r | |
599 | IN UINTN RowCount\r | |
600 | );\r | |
601 | \r | |
602 | /**\r | |
603 | Process a Question's Option (whether selected or un-selected).\r | |
604 | \r | |
605 | @param MenuOption The MenuOption for this Question.\r | |
606 | @param Selected TRUE: if Question is selected.\r | |
607 | @param OptionString Pointer of the Option String to be displayed.\r | |
608 | @param SkipErrorValue Whether need to return when value without option for it.\r | |
609 | \r | |
610 | @retval EFI_SUCCESS Question Option process success.\r | |
611 | @retval Other Question Option process fail.\r | |
612 | \r | |
613 | **/\r | |
614 | EFI_STATUS\r | |
615 | ProcessOptions (\r | |
616 | IN UI_MENU_OPTION *MenuOption,\r | |
617 | IN BOOLEAN Selected,\r | |
618 | OUT CHAR16 **OptionString,\r | |
619 | IN BOOLEAN SkipErrorValue\r | |
620 | );\r | |
621 | \r | |
622 | /**\r | |
623 | Set Buffer to Value for Size bytes.\r | |
624 | \r | |
625 | @param Buffer Memory to set.\r | |
626 | @param Size Number of bytes to set\r | |
627 | @param Value Value of the set operation.\r | |
628 | \r | |
629 | **/\r | |
630 | VOID\r | |
631 | SetUnicodeMem (\r | |
632 | IN VOID *Buffer,\r | |
633 | IN UINTN Size,\r | |
634 | IN CHAR16 Value\r | |
635 | );\r | |
636 | \r | |
637 | /**\r | |
638 | Display one form, and return user input.\r | |
d1102dba | 639 | \r |
7c6c064c ED |
640 | @param FormData Form Data to be shown.\r |
641 | @param UserInputData User input data.\r | |
d1102dba | 642 | \r |
7c6c064c ED |
643 | @retval EFI_SUCCESS Form Data is shown, and user input is got.\r |
644 | **/\r | |
645 | EFI_STATUS\r | |
d1102dba | 646 | EFIAPI\r |
7c6c064c ED |
647 | FormDisplay (\r |
648 | IN FORM_DISPLAY_ENGINE_FORM *FormData,\r | |
649 | OUT USER_INPUT *UserInputData\r | |
650 | );\r | |
651 | \r | |
5a9f73bf ED |
652 | /**\r |
653 | Clear Screen to the initial state.\r | |
654 | **/\r | |
655 | VOID\r | |
d1102dba | 656 | EFIAPI\r |
5a9f73bf ED |
657 | DriverClearDisplayPage (\r |
658 | VOID\r | |
659 | );\r | |
660 | \r | |
7c6c064c ED |
661 | /**\r |
662 | Exit Display and Clear Screen to the original state.\r | |
663 | \r | |
664 | **/\r | |
665 | VOID\r | |
d1102dba | 666 | EFIAPI\r |
7c6c064c ED |
667 | ExitDisplay (\r |
668 | VOID\r | |
669 | );\r | |
670 | \r | |
671 | /**\r | |
bfae1330 | 672 | Process nothing.\r |
7c6c064c | 673 | \r |
bfae1330 ED |
674 | @param Event The Event need to be process\r |
675 | @param Context The context of the event.\r | |
7c6c064c | 676 | \r |
bfae1330 ED |
677 | **/\r |
678 | VOID\r | |
679 | EFIAPI\r | |
680 | EmptyEventProcess (\r | |
681 | IN EFI_EVENT Event,\r | |
682 | IN VOID *Context\r | |
683 | );\r | |
684 | \r | |
685 | /**\r | |
686 | Process for the refresh interval statement.\r | |
687 | \r | |
688 | @param Event The Event need to be process\r | |
689 | @param Context The context of the event.\r | |
7c6c064c ED |
690 | \r |
691 | **/\r | |
bfae1330 ED |
692 | VOID\r |
693 | EFIAPI\r | |
694 | RefreshTimeOutProcess (\r | |
695 | IN EFI_EVENT Event,\r | |
696 | IN VOID *Context\r | |
7c6c064c ED |
697 | );\r |
698 | \r | |
ab2cf8ea ED |
699 | /**\r |
700 | Record the highlight menu and top of screen menu info.\r | |
701 | \r | |
702 | @param Highlight The menu opton which is highlight.\r | |
703 | @param TopOfScreen The menu opton which is at the top of the form.\r | |
704 | @param SkipValue The skip line info for the top of screen menu.\r | |
705 | \r | |
706 | **/\r | |
707 | VOID\r | |
708 | UpdateHighlightMenuInfo (\r | |
709 | IN LIST_ENTRY *Highlight,\r | |
710 | IN LIST_ENTRY *TopOfScreen,\r | |
711 | IN UINTN SkipValue\r | |
712 | );\r | |
713 | \r | |
06aad9a2 DB |
714 | /**\r |
715 | Displays a popup window.\r | |
716 | \r | |
717 | @param This A pointer to the EFI_HII_POPUP_PROTOCOL instance.\r | |
718 | @param PopupStyle Popup style to use.\r | |
719 | @param PopupType Type of the popup to display.\r | |
720 | @param HiiHandle HII handle of the string pack containing Message\r | |
721 | @param Message A message to display in the popup box.\r | |
722 | @param UserSelection User selection.\r | |
723 | \r | |
724 | @retval EFI_SUCCESS The popup box was successfully displayed.\r | |
725 | @retval EFI_INVALID_PARAMETER HiiHandle and Message do not define a valid HII string.\r | |
726 | @retval EFI_INVALID_PARAMETER PopupType is not one of the values defined by this specification.\r | |
727 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to display the popup box.\r | |
728 | \r | |
729 | **/\r | |
730 | EFI_STATUS\r | |
731 | EFIAPI\r | |
732 | CreatePopup (\r | |
733 | IN EFI_HII_POPUP_PROTOCOL *This,\r | |
734 | IN EFI_HII_POPUP_STYLE PopupStyle,\r | |
735 | IN EFI_HII_POPUP_TYPE PopupType,\r | |
736 | IN EFI_HII_HANDLE HiiHandle,\r | |
737 | IN EFI_STRING_ID Message,\r | |
738 | OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL\r | |
739 | );\r | |
740 | \r | |
7c6c064c | 741 | #endif\r |