]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
remove the unused msa files in MdeModulePkg.
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.h
CommitLineData
7936fb6a 1/** @file\r
2Private MACRO, structure and function definitions for Setup Browser module. \r
3\r
4Copyright (c) 2007, Intel Corporation\r
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\r
16#ifndef _SETUP_H_\r
17#define _SETUP_H_\r
18\r
19\r
20#include <PiDxe.h>\r
21\r
22#include <Protocol/Print.h>\r
23#include <Protocol/SimpleTextOut.h>\r
24#include <Protocol/SimpleTextIn.h>\r
25#include <Protocol/FormBrowser2.h>\r
26#include <Protocol/DevicePath.h>\r
27#include <Protocol/UnicodeCollation.h>\r
28#include <Protocol/HiiConfigAccess.h>\r
29#include <Protocol/HiiConfigRouting.h>\r
30#include <Protocol/HiiDatabase.h>\r
31#include <Protocol/HiiString.h>\r
32\r
33#include <MdeModuleHii.h>\r
34\r
35#include <Library/GraphicsLib.h>\r
36#include <Library/PrintLib.h>\r
37#include <Library/DebugLib.h>\r
38#include <Library/BaseMemoryLib.h>\r
39#include <Library/UefiRuntimeServicesTableLib.h>\r
40#include <Library/UefiDriverEntryPoint.h>\r
41#include <Library/UefiBootServicesTableLib.h>\r
42#include <Library/BaseLib.h>\r
43#include <Library/MemoryAllocationLib.h>\r
44#include <Library/IfrSupportLib.h>\r
45#include <Library/ExtendedIfrSupportLib.h>\r
46#include <Library/HiiLib.h>\r
47#include <Library/ExtendedHiiLib.h>\r
f511d656 48#include <Library/PcdLib.h>\r
7936fb6a 49\r
50#include "Colors.h"\r
51\r
52//\r
53// This is the generated header file which includes whatever needs to be exported (strings + IFR)\r
54//\r
55\r
56extern UINT8 SetupBrowserStrings[];\r
57\r
58//\r
59// Screen definitions\r
60//\r
61#define BANNER_HEIGHT 6\r
62#define BANNER_COLUMNS 3\r
63\r
64#define FRONT_PAGE_HEADER_HEIGHT 6\r
65#define NONE_FRONT_PAGE_HEADER_HEIGHT 3\r
66#define LEFT_SKIPPED_COLUMNS 4\r
67#define FOOTER_HEIGHT 4\r
68#define STATUS_BAR_HEIGHT 1\r
69#define SCROLL_ARROW_HEIGHT 1\r
70#define POPUP_PAD_SPACE_COUNT 5\r
71#define POPUP_FRAME_WIDTH 2\r
72\r
73//\r
74// Definition for function key setting\r
75//\r
76#define NONE_FUNCTION_KEY_SETTING 0\r
77#define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_ONE | FUNCTION_TWO | FUNCTION_NINE | FUNCTION_TEN)\r
78\r
79#define FUNCTION_ONE (1 << 0)\r
80#define FUNCTION_TWO (1 << 1)\r
81#define FUNCTION_NINE (1 << 2)\r
82#define FUNCTION_TEN (1 << 3)\r
83\r
84typedef struct {\r
85 EFI_GUID FormSetGuid;\r
86 UINTN KeySetting;\r
87} FUNCTIION_KEY_SETTING;\r
88\r
89//\r
90// Character definitions\r
91//\r
92#define CHAR_SPACE 0x0020\r
93#define UPPER_LOWER_CASE_OFFSET 0x20\r
94\r
95//\r
96// Time definitions\r
97//\r
98#define ONE_SECOND 10000000\r
99\r
100//\r
101// Display definitions\r
102//\r
103#define LEFT_HYPER_DELIMITER L'<'\r
104#define RIGHT_HYPER_DELIMITER L'>'\r
105\r
106#define LEFT_ONEOF_DELIMITER L'<'\r
107#define RIGHT_ONEOF_DELIMITER L'>'\r
108\r
109#define LEFT_NUMERIC_DELIMITER L'['\r
110#define RIGHT_NUMERIC_DELIMITER L']'\r
111\r
112#define LEFT_CHECKBOX_DELIMITER L'['\r
113#define RIGHT_CHECKBOX_DELIMITER L']'\r
114\r
115#define CHECK_ON L'X'\r
116#define CHECK_OFF L' '\r
117\r
118#define TIME_SEPARATOR L':'\r
119#define DATE_SEPARATOR L'/'\r
120\r
121#define YES_ANSWER L'Y'\r
122#define NO_ANSWER L'N'\r
123\r
124//\r
125// This is the Input Error Message\r
126//\r
127#define INPUT_ERROR 1\r
128\r
129//\r
130// This is the NV RAM update required Message\r
131//\r
132#define NV_UPDATE_REQUIRED 2\r
133\r
134//\r
135// Refresh the Status Bar with flags\r
136//\r
137#define REFRESH_STATUS_BAR 0xff\r
138\r
139//\r
140// Incremental string lenght of ConfigRequest\r
141//\r
142#define CONFIG_REQUEST_STRING_INCREMENTAL 1024\r
143\r
144//\r
145// HII value compare result\r
146//\r
147#define HII_VALUE_UNDEFINED 0\r
148#define HII_VALUE_EQUAL 1\r
149#define HII_VALUE_LESS_THAN 2\r
150#define HII_VALUE_GREATER_THAN 3\r
151\r
152//\r
153// Incremental size of stack for expression\r
154//\r
155#define EXPRESSION_STACK_SIZE_INCREMENT 0x100\r
156\r
157\r
158#define EFI_SPECIFICATION_ERRATA_VERSION 0\r
159\r
160#define EFI_IFR_SPECIFICATION_VERSION \\r
161 ((((EFI_SPECIFICATION_VERSION) >> 8) & 0xff00) | \\r
162 (((EFI_SPECIFICATION_VERSION) & 0xf) << 4) | \\r
163 ((EFI_SPECIFICATION_ERRATA_VERSION) & 0xf))\r
164\r
165#define SETUP_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('F', 'B', 'D', 'V')\r
166typedef struct {\r
167 UINT32 Signature;\r
168\r
169 EFI_HANDLE Handle;\r
170\r
171 //\r
172 // Produced protocol\r
173 //\r
174 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2;\r
175 EFI_PRINT_PROTOCOL Print;\r
176\r
177} SETUP_DRIVER_PRIVATE_DATA;\r
178\r
179typedef struct {\r
180 EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];\r
181} BANNER_DATA;\r
182\r
183//\r
184// IFR relative definition\r
185//\r
186#define EFI_HII_EXPRESSION_INCONSISTENT_IF 0\r
187#define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1\r
188#define EFI_HII_EXPRESSION_GRAY_OUT_IF 2\r
189#define EFI_HII_EXPRESSION_SUPPRESS_IF 3\r
190#define EFI_HII_EXPRESSION_DISABLE_IF 4\r
191#define EFI_HII_EXPRESSION_VALUE 5\r
192#define EFI_HII_EXPRESSION_RULE 6\r
193\r
194#define EFI_HII_VARSTORE_BUFFER 0\r
195#define EFI_HII_VARSTORE_NAME_VALUE 1\r
196#define EFI_HII_VARSTORE_EFI_VARIABLE 2\r
197\r
198#define FORM_INCONSISTENT_VALIDATION 0\r
199#define FORM_NO_SUBMIT_VALIDATION 1\r
200\r
201typedef struct {\r
202 UINT8 Type;\r
203 EFI_IFR_TYPE_VALUE Value;\r
204} EFI_HII_VALUE;\r
205\r
206#define NAME_VALUE_NODE_SIGNATURE EFI_SIGNATURE_32 ('N', 'V', 'S', 'T')\r
207\r
208typedef struct {\r
209 UINTN Signature;\r
210 LIST_ENTRY Link;\r
211 CHAR16 *Name;\r
212 CHAR16 *Value;\r
213 CHAR16 *EditValue;\r
214} NAME_VALUE_NODE;\r
215\r
216#define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)\r
217\r
218#define FORMSET_STORAGE_SIGNATURE EFI_SIGNATURE_32 ('F', 'S', 'T', 'G')\r
219\r
220typedef struct {\r
221 UINTN Signature;\r
222 LIST_ENTRY Link;\r
223\r
224 UINT8 Type; // Storage type\r
225\r
226 UINT16 VarStoreId;\r
227 EFI_GUID Guid;\r
228\r
229 CHAR16 *Name; // For EFI_IFR_VARSTORE\r
230 UINT16 Size;\r
231 UINT8 *Buffer;\r
232 UINT8 *EditBuffer; // Edit copy for Buffer Storage\r
233\r
234 LIST_ENTRY NameValueListHead; // List of NAME_VALUE_NODE\r
235\r
236 UINT32 Attributes; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute\r
237\r
238 CHAR16 *ConfigHdr; // <ConfigHdr>\r
239 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
240 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r
241 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
242} FORMSET_STORAGE;\r
243\r
244#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)\r
245\r
246#define EXPRESSION_OPCODE_SIGNATURE EFI_SIGNATURE_32 ('E', 'X', 'O', 'P')\r
247\r
248typedef struct {\r
249 UINTN Signature;\r
250 LIST_ENTRY Link;\r
251\r
252 UINT8 Operand;\r
253\r
254 UINT8 Format; // For EFI_IFR_TO_STRING, EFI_IFR_FIND\r
255 UINT8 Flags; // For EFI_IFR_SPAN\r
256 UINT8 RuleId; // For EFI_IFR_RULE_REF\r
257\r
258 EFI_HII_VALUE Value; // For EFI_IFR_EQ_ID_VAL, EFI_IFR_UINT64, EFI_IFR_UINT32, EFI_IFR_UINT16, EFI_IFR_UINT8, EFI_IFR_STRING_REF1\r
259\r
260 EFI_QUESTION_ID QuestionId; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_LIST, EFI_IFR_QUESTION_REF1\r
261 EFI_QUESTION_ID QuestionId2;\r
262\r
263 UINT16 ListLength; // For EFI_IFR_EQ_ID_LIST\r
264 UINT16 *ValueList;\r
265\r
266 EFI_STRING_ID DevicePath; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3\r
267 EFI_GUID Guid;\r
268} EXPRESSION_OPCODE;\r
269\r
270#define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)\r
271\r
272#define FORM_EXPRESSION_SIGNATURE EFI_SIGNATURE_32 ('F', 'E', 'X', 'P')\r
273\r
274typedef struct {\r
275 UINTN Signature;\r
276 LIST_ENTRY Link;\r
277\r
278 UINT8 Type; // Type for this expression\r
279\r
280 UINT8 RuleId; // For EFI_IFR_RULE only\r
281 EFI_STRING_ID Error; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only\r
282\r
283 EFI_HII_VALUE Result; // Expression evaluation result\r
284\r
285 LIST_ENTRY OpCodeListHead; // OpCodes consist of this expression (EXPRESSION_OPCODE)\r
286} FORM_EXPRESSION;\r
287\r
288#define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r
289\r
290#define QUESTION_DEFAULT_SIGNATURE EFI_SIGNATURE_32 ('Q', 'D', 'F', 'T')\r
291\r
292typedef struct {\r
293 UINTN Signature;\r
294 LIST_ENTRY Link;\r
295\r
296 UINT16 DefaultId;\r
297 EFI_HII_VALUE Value; // Default value\r
298\r
299 FORM_EXPRESSION *ValueExpression; // Not-NULL indicates default value is provided by EFI_IFR_VALUE\r
300} QUESTION_DEFAULT;\r
301\r
302#define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)\r
303\r
304#define QUESTION_OPTION_SIGNATURE EFI_SIGNATURE_32 ('Q', 'O', 'P', 'T')\r
305\r
306typedef struct {\r
307 UINTN Signature;\r
308 LIST_ENTRY Link;\r
309\r
310 EFI_STRING_ID Text;\r
311 UINT8 Flags;\r
312 EFI_HII_VALUE Value;\r
313 EFI_IMAGE_ID ImageId;\r
314\r
315 FORM_EXPRESSION *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
316} QUESTION_OPTION;\r
317\r
318#define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r
319\r
320#define FORM_BROWSER_STATEMENT_SIGNATURE EFI_SIGNATURE_32 ('F', 'S', 'T', 'A')\r
321typedef struct {\r
322 UINTN Signature;\r
323 LIST_ENTRY Link;\r
324\r
325 UINT8 Operand; // The operand (first byte) of this Statement or Question\r
326\r
327 //\r
328 // Statement Header\r
329 //\r
330 EFI_STRING_ID Prompt;\r
331 EFI_STRING_ID Help;\r
332 EFI_STRING_ID TextTwo; // For EFI_IFR_TEXT\r
333\r
334 //\r
335 // Question Header\r
336 //\r
337 EFI_QUESTION_ID QuestionId; // The value of zero is reserved\r
338 EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage\r
339 FORMSET_STORAGE *Storage;\r
340 union {\r
341 EFI_STRING_ID VarName;\r
342 UINT16 VarOffset;\r
343 } VarStoreInfo;\r
344 UINT16 StorageWidth;\r
345 UINT8 QuestionFlags;\r
346 CHAR16 *VariableName; // Name/Value or EFI Variable name\r
347 CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."\r
348\r
349 EFI_HII_VALUE HiiValue; // Edit copy for checkbox, numberic, oneof\r
350 UINT8 *BufferValue; // Edit copy for string, password, orderedlist\r
351\r
352 //\r
353 // OpCode specific members\r
354 //\r
355 UINT8 Flags; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,\r
356 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER\r
357 UINT8 MaxContainers; // for EFI_IFR_ORDERED_LIST\r
358\r
359 UINT16 BannerLineNumber; // for EFI_IFR_BANNER, 1-based line number\r
360 EFI_STRING_ID QuestionConfig; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed\r
361\r
362 UINT64 Minimum; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value\r
363 UINT64 Maximum; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length\r
364 UINT64 Step;\r
365\r
366 EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON\r
367 EFI_FORM_ID RefFormId; // for EFI_IFR_REF\r
368 EFI_QUESTION_ID RefQuestionId; // for EFI_IFR_REF2\r
369 EFI_GUID RefFormSetId; // for EFI_IFR_REF3\r
370 EFI_STRING_ID RefDevicePath; // for EFI_IFR_REF4\r
371\r
372 //\r
373 // Get from IFR parsing\r
374 //\r
375 FORM_EXPRESSION *ValueExpression; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly\r
376 LIST_ENTRY DefaultListHead; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values\r
377 LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r
378\r
379 EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE\r
380 UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh\r
381 BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE\r
382\r
383 LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
384 LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)\r
385 FORM_EXPRESSION *GrayOutExpression; // nesting inside of GrayOutIf\r
386 FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf\r
387\r
388} FORM_BROWSER_STATEMENT;\r
389\r
390#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r
391\r
392#define FORM_BROWSER_FORM_SIGNATURE EFI_SIGNATURE_32 ('F', 'F', 'R', 'M')\r
393\r
394typedef struct {\r
395 UINTN Signature;\r
396 LIST_ENTRY Link;\r
397\r
398 UINT16 FormId;\r
399 EFI_STRING_ID FormTitle;\r
400\r
401 EFI_IMAGE_ID ImageId;\r
402\r
403 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
404 LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
405} FORM_BROWSER_FORM;\r
406\r
407#define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r
408\r
409#define FORMSET_DEFAULTSTORE_SIGNATURE EFI_SIGNATURE_32 ('F', 'D', 'F', 'S')\r
410\r
411typedef struct {\r
412 UINTN Signature;\r
413 LIST_ENTRY Link;\r
414\r
415 UINT16 DefaultId;\r
416 EFI_STRING_ID DefaultName;\r
417} FORMSET_DEFAULTSTORE;\r
418\r
419#define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)\r
420\r
421typedef struct {\r
422 EFI_HII_HANDLE HiiHandle;\r
423 EFI_HANDLE DriverHandle;\r
424 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
425 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
426\r
427 UINTN IfrBinaryLength;\r
428 UINT8 *IfrBinaryData;\r
429\r
430 EFI_GUID Guid;\r
431 EFI_STRING_ID FormSetTitle;\r
432 EFI_STRING_ID Help;\r
433 UINT16 Class;\r
434 UINT16 SubClass;\r
435 EFI_IMAGE_ID ImageId;\r
436\r
437 FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions\r
438 EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode\r
439\r
440 LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)\r
441 LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)\r
442 LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)\r
443} FORM_BROWSER_FORMSET;\r
444\r
445\r
446extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r
447extern EFI_HII_STRING_PROTOCOL *mHiiString;\r
448extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r
449\r
450extern BANNER_DATA *BannerData;\r
451extern EFI_HII_HANDLE FrontPageHandle;\r
452extern UINTN gClassOfVfr;\r
453extern UINTN gFunctionKeySetting;\r
454extern BOOLEAN gResetRequired;\r
455extern BOOLEAN gNvUpdateRequired;\r
456extern EFI_HII_HANDLE gHiiHandle;\r
457extern BOOLEAN gFirstIn;\r
458extern UINT16 gDirection;\r
459extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r
460extern BOOLEAN gUpArrow;\r
461extern BOOLEAN gDownArrow;\r
462\r
463//\r
464// Browser Global Strings\r
465//\r
466extern CHAR16 *gFunctionOneString;\r
467extern CHAR16 *gFunctionTwoString;\r
468extern CHAR16 *gFunctionNineString;\r
469extern CHAR16 *gFunctionTenString;\r
470extern CHAR16 *gEnterString;\r
471extern CHAR16 *gEnterCommitString;\r
472extern CHAR16 *gEscapeString;\r
473extern CHAR16 *gSaveFailed;\r
474extern CHAR16 *gMoveHighlight;\r
475extern CHAR16 *gMakeSelection;\r
476extern CHAR16 *gDecNumericInput;\r
477extern CHAR16 *gHexNumericInput;\r
478extern CHAR16 *gToggleCheckBox;\r
479extern CHAR16 *gPromptForData;\r
480extern CHAR16 *gPromptForPassword;\r
481extern CHAR16 *gPromptForNewPassword;\r
482extern CHAR16 *gConfirmPassword;\r
483extern CHAR16 *gConfirmError;\r
484extern CHAR16 *gPassowordInvalid;\r
485extern CHAR16 *gPressEnter;\r
486extern CHAR16 *gEmptyString;\r
487extern CHAR16 *gAreYouSure;\r
488extern CHAR16 *gYesResponse;\r
489extern CHAR16 *gNoResponse;\r
490extern CHAR16 *gMiniString;\r
491extern CHAR16 *gPlusString;\r
492extern CHAR16 *gMinusString;\r
493extern CHAR16 *gAdjustNumber;\r
494\r
495extern CHAR16 gPromptBlockWidth;\r
496extern CHAR16 gOptionBlockWidth;\r
497extern CHAR16 gHelpBlockWidth;\r
498\r
499extern EFI_GUID gZeroGuid;\r
500extern EFI_GUID gTianoHiiIfrGuid;\r
501\r
502//\r
503// Global Procedure Defines\r
504//\r
505\r
506/**\r
507 Initialize the HII String Token to the correct values.\r
508\r
509**/\r
510VOID\r
511InitializeBrowserStrings (\r
512 VOID\r
513 )\r
514;\r
515\r
516/**\r
517 Prints a unicode string to the default console,\r
518 using L"%s" format.\r
519\r
520 @param String String pointer.\r
521\r
522 @return Length of string printed to the console\r
523\r
524**/\r
525UINTN\r
526PrintString (\r
527 IN CHAR16 *String\r
528 )\r
529;\r
530\r
531/**\r
532 Prints a chracter to the default console,\r
533 using L"%c" format.\r
534\r
535 @param Character Character to print.\r
536\r
537 @return Length of string printed to the console.\r
538\r
539**/\r
540UINTN\r
541PrintChar (\r
542 CHAR16 Character\r
543 )\r
544;\r
545\r
546/**\r
547 Prints a formatted unicode string to the default console, at\r
548 the supplied cursor position.\r
549\r
550 @param Column The cursor position to print the string at.\r
551 @param Row The cursor position to print the string at\r
552 @param Fmt Format string\r
553 @param ... Variable argument list for formating string.\r
554\r
555 @return Length of string printed to the console\r
556\r
557**/\r
558UINTN\r
559PrintAt (\r
560 IN UINTN Column,\r
561 IN UINTN Row,\r
562 IN CHAR16 *Fmt,\r
563 ...\r
564 )\r
565;\r
566\r
567/**\r
568 Prints a unicode string to the default console, at\r
569 the supplied cursor position, using L"%s" format.\r
570\r
571 @param Column The cursor position to print the string at.\r
572 @param Row The cursor position to print the string at\r
573 @param String String pointer.\r
574\r
575 @return Length of string printed to the console\r
576\r
577**/\r
578UINTN\r
579PrintStringAt (\r
580 IN UINTN Column,\r
581 IN UINTN Row,\r
582 IN CHAR16 *String\r
583 )\r
584;\r
585\r
586/**\r
587 Prints a chracter to the default console, at\r
588 the supplied cursor position, using L"%c" format.\r
589\r
590 @param Column The cursor position to print the string at.\r
591 @param Row The cursor position to print the string at.\r
592 @param Character Character to print.\r
593\r
594 @return Length of string printed to the console.\r
595\r
596**/\r
597UINTN\r
598PrintCharAt (\r
599 IN UINTN Column,\r
600 IN UINTN Row,\r
601 CHAR16 Character\r
602 )\r
603;\r
604\r
605/**\r
606 Parse opcodes in the formset IFR binary.\r
607\r
608 @param FormSet Pointer of the FormSet data structure.\r
609\r
610 @retval EFI_SUCCESS Opcode parse success.\r
611 @retval Other Opcode parse fail.\r
612\r
613**/\r
614EFI_STATUS\r
615ParseOpCodes (\r
616 IN FORM_BROWSER_FORMSET *FormSet\r
617 )\r
618;\r
619\r
620/**\r
621 Free resources allocated for a FormSet.\r
622\r
623 @param FormSet Pointer of the FormSet\r
624\r
625**/\r
626VOID\r
627DestroyFormSet (\r
628 IN OUT FORM_BROWSER_FORMSET *FormSet\r
629 )\r
630;\r
631\r
632/**\r
633 This function displays the page frame.\r
634\r
635**/\r
636VOID\r
637DisplayPageFrame (\r
638 VOID\r
639 )\r
640;\r
641\r
642/**\r
643 Create a new string in HII Package List.\r
644\r
645 @param String The String to be added\r
646 @param HiiHandle The package list in the HII database to insert the\r
647 specified string.\r
648\r
649 @return The output string.\r
650\r
651**/\r
652EFI_STRING_ID\r
653NewString (\r
654 IN CHAR16 *String,\r
655 IN EFI_HII_HANDLE HiiHandle\r
656 )\r
657;\r
658\r
659/**\r
660 Delete a string from HII Package List.\r
661\r
662 @param StringId Id of the string in HII database.\r
663 @param HiiHandle The HII package list handle.\r
664\r
665 @retval EFI_SUCCESS The string was deleted successfully.\r
666\r
667**/\r
668EFI_STATUS\r
669DeleteString (\r
670 IN EFI_STRING_ID StringId,\r
671 IN EFI_HII_HANDLE HiiHandle\r
672 )\r
673;\r
674\r
675/**\r
676 Get the string based on the StringId and HII Package List Handle.\r
677\r
678 @param Token The String's ID.\r
679 @param HiiHandle The package list in the HII database to search for\r
680 the specified string.\r
681\r
682 @return The output string.\r
683\r
684**/\r
685CHAR16 *\r
686GetToken (\r
687 IN EFI_STRING_ID Token,\r
688 IN EFI_HII_HANDLE HiiHandle\r
689 )\r
690;\r
691\r
692/**\r
693 Draw a pop up windows based on the dimension, number of lines and\r
694 strings specified.\r
695\r
696 @param RequestedWidth The width of the pop-up.\r
697 @param NumberOfLines The number of lines.\r
f4bcc90f 698 @param Marker The variable argument list for the list of string to be printed.\r
7936fb6a 699\r
700**/\r
701VOID\r
702CreateSharedPopUp (\r
703 IN UINTN RequestedWidth,\r
704 IN UINTN NumberOfLines,\r
f4bcc90f 705 IN VA_LIST Marker\r
7936fb6a 706 )\r
707;\r
708\r
709/**\r
710 Routine used to abstract a generic dialog interface and return the selected key or string\r
711\r
712 @param NumberOfLines The number of lines for the dialog box\r
713 @param HotKey Defines whether a single character is parsed\r
714 (TRUE) and returned in KeyValue or a string is\r
715 returned in StringBuffer. Two special characters\r
716 are considered when entering a string, a SCAN_ESC\r
717 and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates\r
718 string input and returns\r
719 @param MaximumStringSize The maximum size in bytes of a typed in string\r
720 (each character is a CHAR16) and the minimum\r
721 string returned is two bytes\r
722 @param StringBuffer The passed in pointer to the buffer which will\r
723 hold the typed in string if HotKey is FALSE\r
724 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..\r
725 @param String Pointer to the first string in the list\r
726 @param ... A series of (quantity == NumberOfLines) text\r
727 strings which will be used to construct the dialog\r
728 box\r
729\r
730 @retval EFI_SUCCESS Displayed dialog and received user interaction\r
731 @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.\r
732 (StringBuffer == NULL) && (HotKey == FALSE))\r
733 @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine\r
734\r
735**/\r
736EFI_STATUS\r
737CreateDialog (\r
738 IN UINTN NumberOfLines,\r
739 IN BOOLEAN HotKey,\r
740 IN UINTN MaximumStringSize,\r
741 OUT CHAR16 *StringBuffer,\r
742 OUT EFI_INPUT_KEY *KeyValue,\r
7936fb6a 743 ...\r
744 )\r
745;\r
746\r
747/**\r
748 Get Question's current Value.\r
749\r
750 @param FormSet FormSet data structure.\r
751 @param Form Form data structure.\r
752 @param Question Question to be initialized.\r
753 @param Cached TRUE: get from Edit copy FALSE: get from original\r
754 Storage\r
755\r
756 @retval EFI_SUCCESS The function completed successfully.\r
757\r
758**/\r
759EFI_STATUS\r
760GetQuestionValue (\r
761 IN FORM_BROWSER_FORMSET *FormSet,\r
762 IN FORM_BROWSER_FORM *Form,\r
763 IN OUT FORM_BROWSER_STATEMENT *Question,\r
764 IN BOOLEAN Cached\r
765 )\r
766;\r
767\r
768/**\r
769 Save Question Value to edit copy(cached) or Storage(uncached).\r
770\r
771 @param FormSet FormSet data structure.\r
772 @param Form Form data structure.\r
773 @param Question Pointer to the Question.\r
774 @param Cached TRUE: set to Edit copy FALSE: set to original\r
775 Storage\r
776\r
777 @retval EFI_SUCCESS The function completed successfully.\r
778\r
779**/\r
780EFI_STATUS\r
781SetQuestionValue (\r
782 IN FORM_BROWSER_FORMSET *FormSet,\r
783 IN FORM_BROWSER_FORM *Form,\r
784 IN OUT FORM_BROWSER_STATEMENT *Question,\r
785 IN BOOLEAN Cached\r
786 )\r
787;\r
788\r
789/**\r
790 Perform inconsistent check for a Form.\r
791\r
792 @param FormSet FormSet data structure.\r
793 @param Form Form data structure.\r
794 @param Question The Question to be validated.\r
795 @param Type Validation type: InConsistent or NoSubmit\r
796\r
797 @retval EFI_SUCCESS Form validation pass.\r
798 @retval other Form validation failed.\r
799\r
800**/\r
801EFI_STATUS\r
802ValidateQuestion (\r
803 IN FORM_BROWSER_FORMSET *FormSet,\r
804 IN FORM_BROWSER_FORM *Form,\r
805 IN FORM_BROWSER_STATEMENT *Question,\r
806 IN UINTN Type\r
807 )\r
808;\r
809\r
810/**\r
811 Submit a Form.\r
812\r
813 @param FormSet FormSet data structure.\r
814 @param Form Form data structure.\r
815\r
816 @retval EFI_SUCCESS The function completed successfully.\r
817\r
818**/\r
819EFI_STATUS\r
820SubmitForm (\r
821 IN FORM_BROWSER_FORMSET *FormSet,\r
822 IN FORM_BROWSER_FORM *Form\r
823 )\r
824;\r
825\r
826/**\r
827 Reset Question to its default value.\r
828\r
829 @param FormSet The form set.\r
830 @param Form The form.\r
831 @param Question The question.\r
832 @param DefaultId The Class of the default.\r
833\r
834 @retval EFI_SUCCESS Question is reset to default value.\r
835\r
836**/\r
837EFI_STATUS\r
838GetQuestionDefault (\r
839 IN FORM_BROWSER_FORMSET *FormSet,\r
840 IN FORM_BROWSER_FORM *Form,\r
841 IN FORM_BROWSER_STATEMENT *Question,\r
842 IN UINT16 DefaultId\r
843 )\r
844;\r
845\r
846/**\r
847 Get current setting of Questions.\r
848\r
849 @param FormSet FormSet data structure.\r
850\r
851 @retval EFI_SUCCESS The function completed successfully.\r
852\r
853**/\r
854EFI_STATUS\r
855InitializeCurrentSetting (\r
856 IN OUT FORM_BROWSER_FORMSET *FormSet\r
857 )\r
858;\r
859\r
860/**\r
861 Initialize the internal data structure of a FormSet.\r
862\r
863 @param Handle PackageList Handle\r
864 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
865 GUID), take the first FormSet found in package\r
866 list.\r
867 @param FormSet FormSet data structure.\r
868\r
869 @retval EFI_SUCCESS The function completed successfully.\r
870 @retval EFI_NOT_FOUND The specified FormSet could not be found.\r
871\r
872**/\r
873EFI_STATUS\r
874InitializeFormSet (\r
875 IN EFI_HII_HANDLE Handle,\r
876 IN OUT EFI_GUID *FormSetGuid,\r
877 OUT FORM_BROWSER_FORMSET *FormSet\r
878 )\r
879;\r
880\r
881/**\r
882 Reset Questions in a Form to their default value.\r
883\r
884 @param FormSet FormSet data structure.\r
885 @param Form The Form which to be reset.\r
886 @param DefaultId The Class of the default.\r
887\r
888 @retval EFI_SUCCESS The function completed successfully.\r
889\r
890**/\r
891EFI_STATUS\r
892ExtractFormDefault (\r
893 IN FORM_BROWSER_FORMSET *FormSet,\r
894 IN FORM_BROWSER_FORM *Form,\r
895 IN UINT16 DefaultId\r
896 )\r
897;\r
898\r
899/**\r
900 Initialize Question's Edit copy from Storage.\r
901\r
902 @param FormSet FormSet data structure.\r
903 @param Form Form data structure.\r
904\r
905 @retval EFI_SUCCESS The function completed successfully.\r
906\r
907**/\r
908EFI_STATUS\r
909LoadFormConfig (\r
910 IN FORM_BROWSER_FORMSET *FormSet,\r
911 IN FORM_BROWSER_FORM *Form\r
912 )\r
913;\r
914\r
915/**\r
916 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.\r
917\r
918 @param Storage The Storage to be conveted.\r
919 @param ConfigResp The returned <ConfigResp>.\r
920\r
921 @retval EFI_SUCCESS Convert success.\r
922 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
923\r
924**/\r
925EFI_STATUS\r
926StorageToConfigResp (\r
927 IN FORMSET_STORAGE *Storage,\r
928 IN CHAR16 **ConfigResp\r
929 )\r
930;\r
931\r
932/**\r
933 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.\r
934\r
935 @param Storage The Storage to receive the settings.\r
936 @param ConfigResp The <ConfigResp> to be converted.\r
937\r
938 @retval EFI_SUCCESS Convert success.\r
939 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
940\r
941**/\r
942EFI_STATUS\r
943ConfigRespToStorage (\r
944 IN FORMSET_STORAGE *Storage,\r
945 IN CHAR16 *ConfigResp\r
946 )\r
947;\r
948\r
949/**\r
950 Fill storage's edit copy with settings requested from Configuration Driver.\r
951\r
952 @param FormSet FormSet data structure.\r
953 @param Storage Buffer Storage.\r
954\r
955 @retval EFI_SUCCESS The function completed successfully.\r
956\r
957**/\r
958EFI_STATUS\r
959LoadStorage (\r
960 IN FORM_BROWSER_FORMSET *FormSet,\r
961 IN FORMSET_STORAGE *Storage\r
962 )\r
963;\r
964\r
965/**\r
966 Fetch the Ifr binary data of a FormSet.\r
967\r
968 @param Handle PackageList Handle\r
969 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
970 GUID), take the first FormSet found in package\r
971 list.\r
972 @param BinaryLength The length of the FormSet IFR binary.\r
973 @param BinaryData The buffer designed to receive the FormSet.\r
974\r
975 @retval EFI_SUCCESS Buffer filled with the requested FormSet.\r
976 BufferLength was updated.\r
977 @retval EFI_INVALID_PARAMETER The handle is unknown.\r
978 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot\r
979 be found with the requested FormId.\r
980\r
981**/\r
982EFI_STATUS\r
983GetIfrBinaryData (\r
984 IN EFI_HII_HANDLE Handle,\r
985 IN OUT EFI_GUID *FormSetGuid,\r
986 OUT UINTN *BinaryLength,\r
987 OUT UINT8 **BinaryData\r
988 )\r
989;\r
990\r
991/**\r
992 This is the routine which an external caller uses to direct the browser\r
993 where to obtain it's information.\r
994\r
995\r
996 @param This The Form Browser protocol instanse.\r
997 @param Handles A pointer to an array of Handles. If HandleCount > 1 we\r
998 display a list of the formsets for the handles specified.\r
999 @param HandleCount The number of Handles specified in Handle.\r
1000 @param FormSetGuid This field points to the EFI_GUID which must match the Guid\r
1001 field in the EFI_IFR_FORM_SET op-code for the specified\r
1002 forms-based package. If FormSetGuid is NULL, then this\r
1003 function will display the first found forms package.\r
1004 @param FormId This field specifies which EFI_IFR_FORM to render as the first\r
1005 displayable page. If this field has a value of 0x0000, then\r
1006 the forms browser will render the specified forms in their encoded order.\r
1007 ScreenDimenions - This allows the browser to be called so that it occupies a\r
1008 portion of the physical screen instead of dynamically determining the screen dimensions.\r
1009 ActionRequest - Points to the action recommended by the form.\r
1010 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in \r
1011 characters.\r
1012 @param ActionRequest Points to the action recommended by the form.\r
1013\r
1014 @retval EFI_SUCCESS The function completed successfully.\r
1015 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1016 @retval EFI_NOT_FOUND No valid forms could be found to display.\r
1017\r
1018**/\r
1019EFI_STATUS\r
1020EFIAPI\r
1021SendForm (\r
1022 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1023 IN EFI_HII_HANDLE *Handles,\r
1024 IN UINTN HandleCount,\r
1025 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1026 IN UINT16 FormId, OPTIONAL\r
1027 IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL\r
1028 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL\r
1029 )\r
1030;\r
1031\r
1032/**\r
1033 This function is called by a callback handler to retrieve uncommitted state\r
1034 data from the browser.\r
1035\r
1036 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
1037 instance.\r
1038 @param ResultsDataSize A pointer to the size of the buffer associated\r
1039 with ResultsData.\r
1040 @param ResultsData A string returned from an IFR browser or\r
1041 equivalent. The results string will have no\r
1042 routing information in them.\r
1043 @param RetrieveData A BOOLEAN field which allows an agent to retrieve\r
1044 (if RetrieveData = TRUE) data from the uncommitted\r
1045 browser state information or set (if RetrieveData\r
1046 = FALSE) data in the uncommitted browser state\r
1047 information.\r
1048 @param VariableGuid An optional field to indicate the target variable\r
1049 GUID name to use.\r
1050 @param VariableName An optional field to indicate the target\r
1051 human-readable variable name.\r
1052\r
1053 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1054 distribution.\r
1055 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to\r
1056 contain the results data.\r
1057\r
1058**/\r
1059EFI_STATUS\r
1060EFIAPI\r
1061BrowserCallback (\r
1062 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1063 IN OUT UINTN *ResultsDataSize,\r
1064 IN OUT EFI_STRING ResultsData,\r
1065 IN BOOLEAN RetrieveData,\r
1066 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
1067 IN CONST CHAR16 *VariableName OPTIONAL\r
1068 )\r
1069;\r
1070\r
1071#endif\r