]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
ArmPlatformPkg/Bds: Fix the update of existing boot entries
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.h
CommitLineData
7936fb6a 1/** @file\r
d66e6c16 2Private MACRO, structure and function definitions for Setup Browser module.\r
7936fb6a 3\r
0269d14b 4Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
7936fb6a 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
39099938 20#include <PiDxe.h>\r
7936fb6a 21\r
7936fb6a 22#include <Protocol/SimpleTextOut.h>\r
23#include <Protocol/SimpleTextIn.h>\r
24#include <Protocol/FormBrowser2.h>\r
25#include <Protocol/DevicePath.h>\r
26#include <Protocol/UnicodeCollation.h>\r
27#include <Protocol/HiiConfigAccess.h>\r
28#include <Protocol/HiiConfigRouting.h>\r
29#include <Protocol/HiiDatabase.h>\r
30#include <Protocol/HiiString.h>\r
cbf73e50 31#include <Protocol/UserManager.h>\r
7936fb6a 32\r
5c526736 33#include <Guid/MdeModuleHii.h>\r
0a1147ed 34#include <Guid/HiiPlatformSetupFormset.h>\r
2573712e 35#include <Guid/HiiFormMapMethodGuid.h>\r
7936fb6a 36\r
7936fb6a 37#include <Library/PrintLib.h>\r
38#include <Library/DebugLib.h>\r
39#include <Library/BaseMemoryLib.h>\r
40#include <Library/UefiRuntimeServicesTableLib.h>\r
41#include <Library/UefiDriverEntryPoint.h>\r
42#include <Library/UefiBootServicesTableLib.h>\r
43#include <Library/BaseLib.h>\r
44#include <Library/MemoryAllocationLib.h>\r
7936fb6a 45#include <Library/HiiLib.h>\r
f511d656 46#include <Library/PcdLib.h>\r
cb7d01c0 47#include <Library/DevicePathLib.h>\r
7936fb6a 48\r
49#include "Colors.h"\r
50\r
51//\r
52// This is the generated header file which includes whatever needs to be exported (strings + IFR)\r
53//\r
54\r
55extern UINT8 SetupBrowserStrings[];\r
56\r
57//\r
58// Screen definitions\r
59//\r
60#define BANNER_HEIGHT 6\r
61#define BANNER_COLUMNS 3\r
c3161b25 62#define BANNER_LEFT_COLUMN_INDENT 1\r
7936fb6a 63\r
64#define FRONT_PAGE_HEADER_HEIGHT 6\r
65#define NONE_FRONT_PAGE_HEADER_HEIGHT 3\r
b6ca1fd8 66#define LEFT_SKIPPED_COLUMNS 3\r
7936fb6a 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
8b0fc5c1 77#define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_NINE | FUNCTION_TEN)\r
7936fb6a 78\r
7936fb6a 79#define FUNCTION_NINE (1 << 2)\r
80#define FUNCTION_TEN (1 << 3)\r
81\r
82typedef struct {\r
83 EFI_GUID FormSetGuid;\r
84 UINTN KeySetting;\r
85} FUNCTIION_KEY_SETTING;\r
86\r
87//\r
88// Character definitions\r
89//\r
90#define CHAR_SPACE 0x0020\r
91#define UPPER_LOWER_CASE_OFFSET 0x20\r
92\r
93//\r
94// Time definitions\r
95//\r
96#define ONE_SECOND 10000000\r
97\r
98//\r
99// Display definitions\r
100//\r
101#define LEFT_HYPER_DELIMITER L'<'\r
102#define RIGHT_HYPER_DELIMITER L'>'\r
103\r
104#define LEFT_ONEOF_DELIMITER L'<'\r
105#define RIGHT_ONEOF_DELIMITER L'>'\r
106\r
107#define LEFT_NUMERIC_DELIMITER L'['\r
108#define RIGHT_NUMERIC_DELIMITER L']'\r
109\r
110#define LEFT_CHECKBOX_DELIMITER L'['\r
111#define RIGHT_CHECKBOX_DELIMITER L']'\r
112\r
113#define CHECK_ON L'X'\r
114#define CHECK_OFF L' '\r
115\r
116#define TIME_SEPARATOR L':'\r
117#define DATE_SEPARATOR L'/'\r
118\r
119#define YES_ANSWER L'Y'\r
120#define NO_ANSWER L'N'\r
121\r
122//\r
123// This is the Input Error Message\r
124//\r
125#define INPUT_ERROR 1\r
126\r
127//\r
128// This is the NV RAM update required Message\r
129//\r
130#define NV_UPDATE_REQUIRED 2\r
131\r
132//\r
133// Refresh the Status Bar with flags\r
134//\r
135#define REFRESH_STATUS_BAR 0xff\r
136\r
137//\r
138// Incremental string lenght of ConfigRequest\r
139//\r
140#define CONFIG_REQUEST_STRING_INCREMENTAL 1024\r
141\r
142//\r
143// HII value compare result\r
144//\r
145#define HII_VALUE_UNDEFINED 0\r
146#define HII_VALUE_EQUAL 1\r
147#define HII_VALUE_LESS_THAN 2\r
148#define HII_VALUE_GREATER_THAN 3\r
149\r
150//\r
151// Incremental size of stack for expression\r
152//\r
153#define EXPRESSION_STACK_SIZE_INCREMENT 0x100\r
154\r
0269d14b 155#define EFI_IFR_SPECIFICATION_VERSION (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))\r
7936fb6a 156\r
7936fb6a 157\r
f3f2e05d 158#define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')\r
7936fb6a 159typedef struct {\r
160 UINT32 Signature;\r
161\r
162 EFI_HANDLE Handle;\r
163\r
164 //\r
165 // Produced protocol\r
166 //\r
167 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2;\r
7936fb6a 168\r
169} SETUP_DRIVER_PRIVATE_DATA;\r
170\r
171typedef struct {\r
172 EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];\r
173} BANNER_DATA;\r
174\r
175//\r
176// IFR relative definition\r
177//\r
178#define EFI_HII_EXPRESSION_INCONSISTENT_IF 0\r
179#define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1\r
180#define EFI_HII_EXPRESSION_GRAY_OUT_IF 2\r
181#define EFI_HII_EXPRESSION_SUPPRESS_IF 3\r
182#define EFI_HII_EXPRESSION_DISABLE_IF 4\r
183#define EFI_HII_EXPRESSION_VALUE 5\r
184#define EFI_HII_EXPRESSION_RULE 6\r
2573712e
LG
185#define EFI_HII_EXPRESSION_READ 7\r
186#define EFI_HII_EXPRESSION_WRITE 8\r
7936fb6a 187\r
188#define EFI_HII_VARSTORE_BUFFER 0\r
189#define EFI_HII_VARSTORE_NAME_VALUE 1\r
190#define EFI_HII_VARSTORE_EFI_VARIABLE 2\r
cce6230f 191#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3\r
7936fb6a 192\r
193#define FORM_INCONSISTENT_VALIDATION 0\r
194#define FORM_NO_SUBMIT_VALIDATION 1\r
195\r
40245175
LG
196#define FORMSET_CLASS_PLATFORM_SETUP 0x0001\r
197#define FORMSET_CLASS_FRONT_PAGE 0x0002\r
0a1147ed 198\r
7936fb6a 199typedef struct {\r
200 UINT8 Type;\r
201 EFI_IFR_TYPE_VALUE Value;\r
202} EFI_HII_VALUE;\r
203\r
f3f2e05d 204#define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')\r
7936fb6a 205\r
206typedef struct {\r
207 UINTN Signature;\r
208 LIST_ENTRY Link;\r
209 CHAR16 *Name;\r
210 CHAR16 *Value;\r
211 CHAR16 *EditValue;\r
212} NAME_VALUE_NODE;\r
213\r
214#define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)\r
215\r
f3f2e05d 216#define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')\r
7936fb6a 217\r
218typedef struct {\r
219 UINTN Signature;\r
220 LIST_ENTRY Link;\r
221\r
222 UINT8 Type; // Storage type\r
223\r
224 UINT16 VarStoreId;\r
225 EFI_GUID Guid;\r
226\r
227 CHAR16 *Name; // For EFI_IFR_VARSTORE\r
228 UINT16 Size;\r
229 UINT8 *Buffer;\r
230 UINT8 *EditBuffer; // Edit copy for Buffer Storage\r
231\r
232 LIST_ENTRY NameValueListHead; // List of NAME_VALUE_NODE\r
233\r
234 UINT32 Attributes; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute\r
235\r
236 CHAR16 *ConfigHdr; // <ConfigHdr>\r
237 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
238 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r
239 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
240} FORMSET_STORAGE;\r
241\r
242#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)\r
243\r
2573712e
LG
244typedef union {\r
245 EFI_STRING_ID VarName;\r
246 UINT16 VarOffset;\r
247} VAR_STORE_INFO;\r
248\r
f3f2e05d 249#define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')\r
7936fb6a 250\r
251typedef struct {\r
252 UINTN Signature;\r
253 LIST_ENTRY Link;\r
254\r
255 UINT8 Operand;\r
256\r
257 UINT8 Format; // For EFI_IFR_TO_STRING, EFI_IFR_FIND\r
258 UINT8 Flags; // For EFI_IFR_SPAN\r
259 UINT8 RuleId; // For EFI_IFR_RULE_REF\r
260\r
261 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
262\r
2654f642 263 EFI_QUESTION_ID QuestionId; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1\r
7936fb6a 264 EFI_QUESTION_ID QuestionId2;\r
265\r
2654f642 266 UINT16 ListLength; // For EFI_IFR_EQ_ID_VAL_LIST\r
7936fb6a 267 UINT16 *ValueList;\r
268\r
269 EFI_STRING_ID DevicePath; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3\r
270 EFI_GUID Guid;\r
2573712e
LG
271\r
272 FORMSET_STORAGE *VarStorage; // For EFI_IFR_SET, EFI_IFR_GET\r
273 VAR_STORE_INFO VarStoreInfo;// For EFI_IFR_SET, EFI_IFR_GET\r
274 UINT8 ValueType; // For EFI_IFR_SET, EFI_IFR_GET\r
275 UINT8 ValueWidth; // For EFI_IFR_SET, EFI_IFR_GET\r
276 CHAR16 *ValueName; // For EFI_IFR_SET, EFI_IFR_GET\r
277 LIST_ENTRY MapExpressionList; // nested expressions inside of Map opcode.\r
7936fb6a 278} EXPRESSION_OPCODE;\r
279\r
280#define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)\r
281\r
f3f2e05d 282#define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')\r
7936fb6a 283\r
284typedef struct {\r
285 UINTN Signature;\r
286 LIST_ENTRY Link;\r
287\r
288 UINT8 Type; // Type for this expression\r
289\r
290 UINT8 RuleId; // For EFI_IFR_RULE only\r
291 EFI_STRING_ID Error; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only\r
292\r
293 EFI_HII_VALUE Result; // Expression evaluation result\r
294\r
295 LIST_ENTRY OpCodeListHead; // OpCodes consist of this expression (EXPRESSION_OPCODE)\r
296} FORM_EXPRESSION;\r
297\r
298#define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r
299\r
f3f2e05d 300#define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')\r
7936fb6a 301\r
302typedef struct {\r
303 UINTN Signature;\r
304 LIST_ENTRY Link;\r
305\r
306 UINT16 DefaultId;\r
307 EFI_HII_VALUE Value; // Default value\r
308\r
309 FORM_EXPRESSION *ValueExpression; // Not-NULL indicates default value is provided by EFI_IFR_VALUE\r
310} QUESTION_DEFAULT;\r
311\r
312#define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)\r
313\r
f3f2e05d 314#define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')\r
7936fb6a 315\r
316typedef struct {\r
317 UINTN Signature;\r
318 LIST_ENTRY Link;\r
319\r
320 EFI_STRING_ID Text;\r
321 UINT8 Flags;\r
322 EFI_HII_VALUE Value;\r
323 EFI_IMAGE_ID ImageId;\r
324\r
325 FORM_EXPRESSION *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
326} QUESTION_OPTION;\r
327\r
328#define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r
329\r
f3f2e05d 330#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')\r
1ccdbf2a 331\r
7936fb6a 332typedef struct {\r
333 UINTN Signature;\r
334 LIST_ENTRY Link;\r
335\r
336 UINT8 Operand; // The operand (first byte) of this Statement or Question\r
337\r
338 //\r
339 // Statement Header\r
340 //\r
341 EFI_STRING_ID Prompt;\r
342 EFI_STRING_ID Help;\r
343 EFI_STRING_ID TextTwo; // For EFI_IFR_TEXT\r
344\r
345 //\r
346 // Question Header\r
347 //\r
348 EFI_QUESTION_ID QuestionId; // The value of zero is reserved\r
349 EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage\r
350 FORMSET_STORAGE *Storage;\r
1ccdbf2a 351 VAR_STORE_INFO VarStoreInfo;\r
7936fb6a 352 UINT16 StorageWidth;\r
353 UINT8 QuestionFlags;\r
354 CHAR16 *VariableName; // Name/Value or EFI Variable name\r
355 CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."\r
356\r
357 EFI_HII_VALUE HiiValue; // Edit copy for checkbox, numberic, oneof\r
358 UINT8 *BufferValue; // Edit copy for string, password, orderedlist\r
d02847d3 359 UINT8 ValueType; // Data type for orderedlist value array\r
7936fb6a 360\r
361 //\r
362 // OpCode specific members\r
363 //\r
364 UINT8 Flags; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,\r
365 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER\r
366 UINT8 MaxContainers; // for EFI_IFR_ORDERED_LIST\r
367\r
368 UINT16 BannerLineNumber; // for EFI_IFR_BANNER, 1-based line number\r
369 EFI_STRING_ID QuestionConfig; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed\r
370\r
371 UINT64 Minimum; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value\r
372 UINT64 Maximum; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length\r
373 UINT64 Step;\r
374\r
375 EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON\r
211cc6e5 376 EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID\r
7936fb6a 377\r
378 //\r
379 // Get from IFR parsing\r
380 //\r
381 FORM_EXPRESSION *ValueExpression; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly\r
382 LIST_ENTRY DefaultListHead; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values\r
383 LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r
384\r
385 EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE\r
386 UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh\r
387 BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE\r
388\r
389 LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
390 LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)\r
391 FORM_EXPRESSION *GrayOutExpression; // nesting inside of GrayOutIf\r
392 FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf\r
0a1147ed 393 FORM_EXPRESSION *DisableExpression; // nesting inside of DisableIf\r
7936fb6a 394\r
2573712e
LG
395 FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.\r
396 FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.\r
7936fb6a 397} FORM_BROWSER_STATEMENT;\r
398\r
399#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r
400\r
b18e7050
ED
401#define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')\r
402typedef struct {\r
403 UINTN Signature;\r
404 LIST_ENTRY Link;\r
405\r
406 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
407 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest> \r
408 UINTN SpareStrLen;\r
409\r
410 FORMSET_STORAGE *Storage;\r
411} FORM_BROWSER_CONFIG_REQUEST;\r
412#define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)\r
413\r
f3f2e05d 414#define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r
2573712e 415#define STANDARD_MAP_FORM_TYPE 0x01\r
7936fb6a 416\r
417typedef struct {\r
418 UINTN Signature;\r
419 LIST_ENTRY Link;\r
420\r
2573712e
LG
421 UINT16 FormId; // FormId of normal form or formmap form.\r
422 EFI_STRING_ID FormTitle; // FormTile of normal form, or FormMapMethod title of formmap form.\r
423 UINT16 FormType; // Specific form type for the different form.\r
7936fb6a 424\r
425 EFI_IMAGE_ID ImageId;\r
426\r
b00964a9
ED
427 BOOLEAN ModalForm; // Whether this is a modal form.\r
428\r
b18e7050
ED
429 BOOLEAN NvUpdateRequired; // Whether this form has NV update request.\r
430\r
7936fb6a 431 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
432 LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
b18e7050 433 LIST_ENTRY ConfigRequestHead; // List of configreques for all storage.\r
0c66bc76 434 FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf\r
7936fb6a 435} FORM_BROWSER_FORM;\r
436\r
437#define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r
438\r
f3f2e05d 439#define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')\r
7936fb6a 440\r
441typedef struct {\r
442 UINTN Signature;\r
443 LIST_ENTRY Link;\r
444\r
445 UINT16 DefaultId;\r
446 EFI_STRING_ID DefaultName;\r
447} FORMSET_DEFAULTSTORE;\r
448\r
449#define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)\r
450\r
451typedef struct {\r
452 EFI_HII_HANDLE HiiHandle;\r
453 EFI_HANDLE DriverHandle;\r
454 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
455 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
456\r
457 UINTN IfrBinaryLength;\r
458 UINT8 *IfrBinaryData;\r
459\r
460 EFI_GUID Guid;\r
461 EFI_STRING_ID FormSetTitle;\r
462 EFI_STRING_ID Help;\r
0a1147ed
LG
463 UINT8 NumberOfClassGuid;\r
464 EFI_GUID ClassGuid[3]; // Up to three ClassGuid\r
465 UINT16 Class; // Tiano extended Class code\r
466 UINT16 SubClass; // Tiano extended Subclass code\r
7936fb6a 467 EFI_IMAGE_ID ImageId;\r
468\r
469 FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions\r
470 EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode\r
471\r
472 LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)\r
473 LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)\r
474 LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)\r
0c66bc76 475 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
7936fb6a 476} FORM_BROWSER_FORMSET;\r
477\r
ce6d12cc 478#define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')\r
479\r
480typedef struct {\r
481 UINTN Signature;\r
482 LIST_ENTRY Link;\r
483\r
484 //\r
485 // Globals defined in Setup.c\r
486 //\r
487 BANNER_DATA *BannerData;\r
488 UINTN ClassOfVfr;\r
489 UINTN FunctionKeySetting;\r
490 BOOLEAN ResetRequired;\r
ce6d12cc 491 UINT16 Direction;\r
492 EFI_SCREEN_DESCRIPTOR ScreenDimensions;\r
493 CHAR16 *FunctionNineString;\r
494 CHAR16 *FunctionTenString;\r
495 CHAR16 *EnterString;\r
496 CHAR16 *EnterCommitString;\r
497 CHAR16 *EnterEscapeString;\r
498 CHAR16 *EscapeString;\r
499 CHAR16 *SaveFailed;\r
500 CHAR16 *MoveHighlight;\r
501 CHAR16 *MakeSelection;\r
502 CHAR16 *DecNumericInput;\r
503 CHAR16 *HexNumericInput;\r
504 CHAR16 *ToggleCheckBox;\r
505 CHAR16 *PromptForData;\r
506 CHAR16 *PromptForPassword;\r
507 CHAR16 *PromptForNewPassword;\r
508 CHAR16 *ConfirmPassword;\r
509 CHAR16 *ConfirmError;\r
510 CHAR16 *PassowordInvalid;\r
511 CHAR16 *PressEnter;\r
512 CHAR16 *EmptyString;\r
513 CHAR16 *AreYouSure;\r
514 CHAR16 *YesResponse;\r
515 CHAR16 *NoResponse;\r
516 CHAR16 *MiniString;\r
517 CHAR16 *PlusString;\r
518 CHAR16 *MinusString;\r
519 CHAR16 *AdjustNumber;\r
520 CHAR16 *SaveChanges;\r
521 CHAR16 *OptionMismatch;\r
2bb526f3 522 CHAR16 *FormSuppress;\r
ce6d12cc 523 CHAR16 PromptBlockWidth;\r
524 CHAR16 OptionBlockWidth;\r
525 CHAR16 HelpBlockWidth;\r
526 FORM_BROWSER_FORMSET *OldFormSet;\r
527\r
528 //\r
529 // Globals defined in Ui.c\r
530 //\r
531 LIST_ENTRY MenuOption;\r
532 VOID *MenuRefreshHead;\r
533} BROWSER_CONTEXT;\r
534\r
535#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)\r
7936fb6a 536\r
537extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r
538extern EFI_HII_STRING_PROTOCOL *mHiiString;\r
539extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r
540\r
0a1147ed
LG
541extern BANNER_DATA *gBannerData;\r
542extern EFI_HII_HANDLE gFrontPageHandle;\r
7936fb6a 543extern UINTN gClassOfVfr;\r
544extern UINTN gFunctionKeySetting;\r
545extern BOOLEAN gResetRequired;\r
7936fb6a 546extern EFI_HII_HANDLE gHiiHandle;\r
7936fb6a 547extern UINT16 gDirection;\r
548extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r
7936fb6a 549\r
d66e6c16 550extern FORM_BROWSER_FORMSET *gOldFormSet;\r
551\r
7936fb6a 552//\r
553// Browser Global Strings\r
554//\r
7936fb6a 555extern CHAR16 *gFunctionNineString;\r
556extern CHAR16 *gFunctionTenString;\r
557extern CHAR16 *gEnterString;\r
558extern CHAR16 *gEnterCommitString;\r
8d00a0f1 559extern CHAR16 *gEnterEscapeString;\r
7936fb6a 560extern CHAR16 *gEscapeString;\r
561extern CHAR16 *gSaveFailed;\r
562extern CHAR16 *gMoveHighlight;\r
563extern CHAR16 *gMakeSelection;\r
564extern CHAR16 *gDecNumericInput;\r
565extern CHAR16 *gHexNumericInput;\r
566extern CHAR16 *gToggleCheckBox;\r
567extern CHAR16 *gPromptForData;\r
568extern CHAR16 *gPromptForPassword;\r
569extern CHAR16 *gPromptForNewPassword;\r
570extern CHAR16 *gConfirmPassword;\r
571extern CHAR16 *gConfirmError;\r
572extern CHAR16 *gPassowordInvalid;\r
573extern CHAR16 *gPressEnter;\r
574extern CHAR16 *gEmptyString;\r
575extern CHAR16 *gAreYouSure;\r
576extern CHAR16 *gYesResponse;\r
577extern CHAR16 *gNoResponse;\r
578extern CHAR16 *gMiniString;\r
579extern CHAR16 *gPlusString;\r
580extern CHAR16 *gMinusString;\r
581extern CHAR16 *gAdjustNumber;\r
ebe43565 582extern CHAR16 *gSaveChanges;\r
8d00a0f1 583extern CHAR16 *gOptionMismatch;\r
0c66bc76 584extern CHAR16 *gFormSuppress;\r
7936fb6a 585\r
586extern CHAR16 gPromptBlockWidth;\r
587extern CHAR16 gOptionBlockWidth;\r
588extern CHAR16 gHelpBlockWidth;\r
589\r
590extern EFI_GUID gZeroGuid;\r
591extern EFI_GUID gTianoHiiIfrGuid;\r
592\r
eccfeab1 593#include "Ui.h"\r
7936fb6a 594//\r
595// Global Procedure Defines\r
596//\r
597\r
598/**\r
599 Initialize the HII String Token to the correct values.\r
600\r
601**/\r
602VOID\r
603InitializeBrowserStrings (\r
604 VOID\r
ed66e1bc 605 );\r
7936fb6a 606\r
607/**\r
608 Prints a unicode string to the default console,\r
609 using L"%s" format.\r
610\r
611 @param String String pointer.\r
612\r
613 @return Length of string printed to the console\r
614\r
615**/\r
616UINTN\r
617PrintString (\r
618 IN CHAR16 *String\r
ed66e1bc 619 );\r
7936fb6a 620\r
621/**\r
622 Prints a chracter to the default console,\r
623 using L"%c" format.\r
624\r
625 @param Character Character to print.\r
626\r
627 @return Length of string printed to the console.\r
628\r
629**/\r
630UINTN\r
631PrintChar (\r
632 CHAR16 Character\r
ed66e1bc 633 );\r
7936fb6a 634\r
635/**\r
636 Prints a formatted unicode string to the default console, at\r
637 the supplied cursor position.\r
638\r
639 @param Column The cursor position to print the string at.\r
640 @param Row The cursor position to print the string at\r
641 @param Fmt Format string\r
642 @param ... Variable argument list for formating string.\r
643\r
644 @return Length of string printed to the console\r
645\r
646**/\r
647UINTN\r
8091267c 648EFIAPI\r
7936fb6a 649PrintAt (\r
650 IN UINTN Column,\r
651 IN UINTN Row,\r
652 IN CHAR16 *Fmt,\r
653 ...\r
ed66e1bc 654 );\r
7936fb6a 655\r
656/**\r
657 Prints a unicode string to the default console, at\r
658 the supplied cursor position, using L"%s" format.\r
659\r
660 @param Column The cursor position to print the string at.\r
661 @param Row The cursor position to print the string at\r
662 @param String String pointer.\r
663\r
664 @return Length of string printed to the console\r
665\r
666**/\r
667UINTN\r
668PrintStringAt (\r
669 IN UINTN Column,\r
670 IN UINTN Row,\r
671 IN CHAR16 *String\r
ed66e1bc 672 );\r
7936fb6a 673\r
674/**\r
675 Prints a chracter to the default console, at\r
676 the supplied cursor position, using L"%c" format.\r
677\r
678 @param Column The cursor position to print the string at.\r
679 @param Row The cursor position to print the string at.\r
680 @param Character Character to print.\r
681\r
682 @return Length of string printed to the console.\r
683\r
684**/\r
685UINTN\r
686PrintCharAt (\r
687 IN UINTN Column,\r
688 IN UINTN Row,\r
689 CHAR16 Character\r
ed66e1bc 690 );\r
7936fb6a 691\r
692/**\r
693 Parse opcodes in the formset IFR binary.\r
694\r
695 @param FormSet Pointer of the FormSet data structure.\r
696\r
697 @retval EFI_SUCCESS Opcode parse success.\r
698 @retval Other Opcode parse fail.\r
699\r
700**/\r
701EFI_STATUS\r
702ParseOpCodes (\r
703 IN FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 704 );\r
7936fb6a 705\r
706/**\r
707 Free resources allocated for a FormSet.\r
708\r
709 @param FormSet Pointer of the FormSet\r
710\r
711**/\r
712VOID\r
713DestroyFormSet (\r
714 IN OUT FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 715 );\r
7936fb6a 716\r
717/**\r
718 This function displays the page frame.\r
719\r
b00964a9
ED
720 @param Selection Selection contains the information about \r
721 the Selection, form and formset to be displayed.\r
722 Selection action may be updated in retrieve callback.\r
7936fb6a 723**/\r
724VOID\r
725DisplayPageFrame (\r
b00964a9 726 IN UI_MENU_SELECTION *Selection\r
ed66e1bc 727 );\r
7936fb6a 728\r
729/**\r
730 Create a new string in HII Package List.\r
731\r
732 @param String The String to be added\r
733 @param HiiHandle The package list in the HII database to insert the\r
734 specified string.\r
735\r
736 @return The output string.\r
737\r
738**/\r
739EFI_STRING_ID\r
740NewString (\r
741 IN CHAR16 *String,\r
742 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 743 );\r
7936fb6a 744\r
745/**\r
746 Delete a string from HII Package List.\r
747\r
748 @param StringId Id of the string in HII database.\r
749 @param HiiHandle The HII package list handle.\r
750\r
751 @retval EFI_SUCCESS The string was deleted successfully.\r
752\r
753**/\r
754EFI_STATUS\r
755DeleteString (\r
756 IN EFI_STRING_ID StringId,\r
757 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 758 );\r
7936fb6a 759\r
760/**\r
761 Get the string based on the StringId and HII Package List Handle.\r
762\r
763 @param Token The String's ID.\r
764 @param HiiHandle The package list in the HII database to search for\r
765 the specified string.\r
766\r
767 @return The output string.\r
768\r
769**/\r
770CHAR16 *\r
771GetToken (\r
772 IN EFI_STRING_ID Token,\r
773 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 774 );\r
7936fb6a 775\r
776/**\r
777 Draw a pop up windows based on the dimension, number of lines and\r
778 strings specified.\r
779\r
780 @param RequestedWidth The width of the pop-up.\r
781 @param NumberOfLines The number of lines.\r
f4bcc90f 782 @param Marker The variable argument list for the list of string to be printed.\r
7936fb6a 783\r
784**/\r
785VOID\r
786CreateSharedPopUp (\r
787 IN UINTN RequestedWidth,\r
788 IN UINTN NumberOfLines,\r
f4bcc90f 789 IN VA_LIST Marker\r
ed66e1bc 790 );\r
7936fb6a 791\r
792/**\r
793 Routine used to abstract a generic dialog interface and return the selected key or string\r
794\r
795 @param NumberOfLines The number of lines for the dialog box\r
796 @param HotKey Defines whether a single character is parsed\r
797 (TRUE) and returned in KeyValue or a string is\r
798 returned in StringBuffer. Two special characters\r
799 are considered when entering a string, a SCAN_ESC\r
800 and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates\r
801 string input and returns\r
802 @param MaximumStringSize The maximum size in bytes of a typed in string\r
803 (each character is a CHAR16) and the minimum\r
804 string returned is two bytes\r
805 @param StringBuffer The passed in pointer to the buffer which will\r
806 hold the typed in string if HotKey is FALSE\r
807 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..\r
7936fb6a 808 @param ... A series of (quantity == NumberOfLines) text\r
809 strings which will be used to construct the dialog\r
810 box\r
811\r
812 @retval EFI_SUCCESS Displayed dialog and received user interaction\r
813 @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.\r
814 (StringBuffer == NULL) && (HotKey == FALSE))\r
815 @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine\r
816\r
817**/\r
818EFI_STATUS\r
8091267c 819EFIAPI\r
7936fb6a 820CreateDialog (\r
821 IN UINTN NumberOfLines,\r
822 IN BOOLEAN HotKey,\r
823 IN UINTN MaximumStringSize,\r
824 OUT CHAR16 *StringBuffer,\r
825 OUT EFI_INPUT_KEY *KeyValue,\r
7936fb6a 826 ...\r
ed66e1bc 827 );\r
7936fb6a 828\r
2573712e
LG
829/**\r
830 Get Value for given Name from a NameValue Storage.\r
831\r
832 @param Storage The NameValue Storage.\r
833 @param Name The Name.\r
834 @param Value The retured Value.\r
835\r
836 @retval EFI_SUCCESS Value found for given Name.\r
837 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
838\r
839**/\r
840EFI_STATUS\r
841GetValueByName (\r
842 IN FORMSET_STORAGE *Storage,\r
843 IN CHAR16 *Name,\r
844 IN OUT CHAR16 **Value\r
845 );\r
846\r
847/**\r
848 Set Value of given Name in a NameValue Storage.\r
849\r
850 @param Storage The NameValue Storage.\r
851 @param Name The Name.\r
852 @param Value The Value to set.\r
b18e7050 853 @param Edit Whether update editValue or Value.\r
2573712e
LG
854\r
855 @retval EFI_SUCCESS Value found for given Name.\r
856 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
857\r
858**/\r
859EFI_STATUS\r
860SetValueByName (\r
861 IN FORMSET_STORAGE *Storage,\r
862 IN CHAR16 *Name,\r
b18e7050
ED
863 IN CHAR16 *Value,\r
864 IN BOOLEAN Edit\r
2573712e
LG
865 );\r
866\r
7936fb6a 867/**\r
868 Get Question's current Value.\r
869\r
870 @param FormSet FormSet data structure.\r
871 @param Form Form data structure.\r
872 @param Question Question to be initialized.\r
873 @param Cached TRUE: get from Edit copy FALSE: get from original\r
874 Storage\r
875\r
876 @retval EFI_SUCCESS The function completed successfully.\r
877\r
878**/\r
879EFI_STATUS\r
880GetQuestionValue (\r
881 IN FORM_BROWSER_FORMSET *FormSet,\r
882 IN FORM_BROWSER_FORM *Form,\r
883 IN OUT FORM_BROWSER_STATEMENT *Question,\r
884 IN BOOLEAN Cached\r
ed66e1bc 885 );\r
7936fb6a 886\r
887/**\r
888 Save Question Value to edit copy(cached) or Storage(uncached).\r
889\r
890 @param FormSet FormSet data structure.\r
891 @param Form Form data structure.\r
892 @param Question Pointer to the Question.\r
893 @param Cached TRUE: set to Edit copy FALSE: set to original\r
894 Storage\r
895\r
896 @retval EFI_SUCCESS The function completed successfully.\r
897\r
898**/\r
899EFI_STATUS\r
900SetQuestionValue (\r
901 IN FORM_BROWSER_FORMSET *FormSet,\r
902 IN FORM_BROWSER_FORM *Form,\r
903 IN OUT FORM_BROWSER_STATEMENT *Question,\r
904 IN BOOLEAN Cached\r
ed66e1bc 905 );\r
7936fb6a 906\r
907/**\r
908 Perform inconsistent check for a Form.\r
909\r
910 @param FormSet FormSet data structure.\r
911 @param Form Form data structure.\r
912 @param Question The Question to be validated.\r
913 @param Type Validation type: InConsistent or NoSubmit\r
914\r
915 @retval EFI_SUCCESS Form validation pass.\r
916 @retval other Form validation failed.\r
917\r
918**/\r
919EFI_STATUS\r
920ValidateQuestion (\r
921 IN FORM_BROWSER_FORMSET *FormSet,\r
922 IN FORM_BROWSER_FORM *Form,\r
923 IN FORM_BROWSER_STATEMENT *Question,\r
924 IN UINTN Type\r
ed66e1bc 925 );\r
7936fb6a 926\r
927/**\r
b18e7050 928 Discard data for form level or formset level.\r
7936fb6a 929\r
930 @param FormSet FormSet data structure.\r
931 @param Form Form data structure.\r
b18e7050
ED
932 @param SingleForm whether submit single form or formset.\r
933\r
934 @retval EFI_SUCCESS The function completed successfully.\r
935\r
936**/\r
937EFI_STATUS\r
938DiscardForm (\r
939 IN FORM_BROWSER_FORMSET *FormSet,\r
940 IN FORM_BROWSER_FORM *Form,\r
941 IN BOOLEAN SingleForm\r
942 );\r
943\r
944/**\r
945 Submit data for form level or formset level.\r
946\r
947 @param FormSet FormSet data structure.\r
948 @param Form Form data structure.\r
949 @param SingleForm whether submit single form or formset.\r
7936fb6a 950\r
951 @retval EFI_SUCCESS The function completed successfully.\r
952\r
953**/\r
954EFI_STATUS\r
955SubmitForm (\r
956 IN FORM_BROWSER_FORMSET *FormSet,\r
b18e7050
ED
957 IN FORM_BROWSER_FORM *Form,\r
958 IN BOOLEAN SingleForm\r
ed66e1bc 959 );\r
7936fb6a 960\r
961/**\r
962 Reset Question to its default value.\r
963\r
964 @param FormSet The form set.\r
965 @param Form The form.\r
966 @param Question The question.\r
967 @param DefaultId The Class of the default.\r
968\r
969 @retval EFI_SUCCESS Question is reset to default value.\r
970\r
971**/\r
972EFI_STATUS\r
973GetQuestionDefault (\r
974 IN FORM_BROWSER_FORMSET *FormSet,\r
975 IN FORM_BROWSER_FORM *Form,\r
976 IN FORM_BROWSER_STATEMENT *Question,\r
977 IN UINT16 DefaultId\r
ed66e1bc 978 );\r
7936fb6a 979\r
980/**\r
981 Get current setting of Questions.\r
982\r
983 @param FormSet FormSet data structure.\r
984\r
985 @retval EFI_SUCCESS The function completed successfully.\r
986\r
987**/\r
988EFI_STATUS\r
989InitializeCurrentSetting (\r
990 IN OUT FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 991 );\r
7936fb6a 992\r
993/**\r
994 Initialize the internal data structure of a FormSet.\r
995\r
996 @param Handle PackageList Handle\r
997 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
998 GUID), take the first FormSet found in package\r
999 list.\r
1000 @param FormSet FormSet data structure.\r
1001\r
1002 @retval EFI_SUCCESS The function completed successfully.\r
1003 @retval EFI_NOT_FOUND The specified FormSet could not be found.\r
1004\r
1005**/\r
1006EFI_STATUS\r
1007InitializeFormSet (\r
1008 IN EFI_HII_HANDLE Handle,\r
1009 IN OUT EFI_GUID *FormSetGuid,\r
1010 OUT FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 1011 );\r
7936fb6a 1012\r
1013/**\r
4f33c838 1014 Reset Questions in a Formset to their default value.\r
7936fb6a 1015\r
1016 @param FormSet FormSet data structure.\r
7936fb6a 1017 @param DefaultId The Class of the default.\r
1018\r
1019 @retval EFI_SUCCESS The function completed successfully.\r
1020\r
1021**/\r
1022EFI_STATUS\r
4f33c838 1023ExtractFormSetDefault (\r
7936fb6a 1024 IN FORM_BROWSER_FORMSET *FormSet,\r
7936fb6a 1025 IN UINT16 DefaultId\r
ed66e1bc 1026 );\r
7936fb6a 1027\r
1028/**\r
1029 Initialize Question's Edit copy from Storage.\r
1030\r
eccfeab1
LG
1031 @param Selection Selection contains the information about \r
1032 the Selection, form and formset to be displayed.\r
1033 Selection action may be updated in retrieve callback.\r
7936fb6a 1034 @param FormSet FormSet data structure.\r
1035 @param Form Form data structure.\r
1036\r
1037 @retval EFI_SUCCESS The function completed successfully.\r
1038\r
1039**/\r
1040EFI_STATUS\r
1041LoadFormConfig (\r
eccfeab1
LG
1042 IN OUT UI_MENU_SELECTION *Selection,\r
1043 IN FORM_BROWSER_FORMSET *FormSet,\r
1044 IN FORM_BROWSER_FORM *Form\r
ed66e1bc 1045 );\r
7936fb6a 1046\r
d66e6c16 1047/**\r
1048 Initialize Question's Edit copy from Storage for the whole Formset.\r
1049\r
eccfeab1
LG
1050 @param Selection Selection contains the information about \r
1051 the Selection, form and formset to be displayed.\r
1052 Selection action may be updated in retrieve callback.\r
d66e6c16 1053 @param FormSet FormSet data structure.\r
1054\r
1055 @retval EFI_SUCCESS The function completed successfully.\r
1056\r
1057**/\r
1058EFI_STATUS\r
1059LoadFormSetConfig (\r
eccfeab1
LG
1060 IN OUT UI_MENU_SELECTION *Selection,\r
1061 IN FORM_BROWSER_FORMSET *FormSet\r
d66e6c16 1062 );\r
1063\r
7936fb6a 1064/**\r
1065 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.\r
1066\r
b18e7050 1067 @param Buffer The Storage to be conveted.\r
7936fb6a 1068 @param ConfigResp The returned <ConfigResp>.\r
b18e7050 1069 @param SingleForm Whether update data for single form or formset level.\r
7936fb6a 1070\r
1071 @retval EFI_SUCCESS Convert success.\r
1072 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
1073\r
1074**/\r
1075EFI_STATUS\r
1076StorageToConfigResp (\r
b18e7050
ED
1077 IN VOID *Buffer,\r
1078 IN CHAR16 **ConfigResp,\r
1079 IN BOOLEAN SingleForm\r
ed66e1bc 1080 );\r
7936fb6a 1081\r
1082/**\r
1083 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.\r
1084\r
1085 @param Storage The Storage to receive the settings.\r
1086 @param ConfigResp The <ConfigResp> to be converted.\r
1087\r
1088 @retval EFI_SUCCESS Convert success.\r
1089 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
1090\r
1091**/\r
1092EFI_STATUS\r
1093ConfigRespToStorage (\r
1094 IN FORMSET_STORAGE *Storage,\r
1095 IN CHAR16 *ConfigResp\r
ed66e1bc 1096 );\r
7936fb6a 1097\r
1098/**\r
1099 Fill storage's edit copy with settings requested from Configuration Driver.\r
1100\r
1101 @param FormSet FormSet data structure.\r
1102 @param Storage Buffer Storage.\r
1103\r
1104 @retval EFI_SUCCESS The function completed successfully.\r
1105\r
1106**/\r
1107EFI_STATUS\r
1108LoadStorage (\r
1109 IN FORM_BROWSER_FORMSET *FormSet,\r
1110 IN FORMSET_STORAGE *Storage\r
ed66e1bc 1111 );\r
7936fb6a 1112\r
1113/**\r
1114 Fetch the Ifr binary data of a FormSet.\r
1115\r
1116 @param Handle PackageList Handle\r
1117 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
1118 GUID), take the first FormSet found in package\r
1119 list.\r
1120 @param BinaryLength The length of the FormSet IFR binary.\r
1121 @param BinaryData The buffer designed to receive the FormSet.\r
1122\r
1123 @retval EFI_SUCCESS Buffer filled with the requested FormSet.\r
1124 BufferLength was updated.\r
1125 @retval EFI_INVALID_PARAMETER The handle is unknown.\r
1126 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot\r
1127 be found with the requested FormId.\r
1128\r
1129**/\r
1130EFI_STATUS\r
1131GetIfrBinaryData (\r
1132 IN EFI_HII_HANDLE Handle,\r
1133 IN OUT EFI_GUID *FormSetGuid,\r
1134 OUT UINTN *BinaryLength,\r
1135 OUT UINT8 **BinaryData\r
ed66e1bc 1136 );\r
7936fb6a 1137\r
ce6d12cc 1138/**\r
1139 Save globals used by previous call to SendForm(). SendForm() may be called from \r
1140 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r
1141 So, save globals of previous call to SendForm() and restore them upon exit.\r
1142\r
1143**/\r
1144VOID\r
1145SaveBrowserContext (\r
1146 VOID\r
1147 );\r
1148\r
1149/**\r
1150 Restore globals used by previous call to SendForm().\r
1151\r
1152**/\r
1153VOID\r
1154RestoreBrowserContext (\r
1155 VOID\r
1156 );\r
1157\r
7936fb6a 1158/**\r
1159 This is the routine which an external caller uses to direct the browser\r
1160 where to obtain it's information.\r
1161\r
1162\r
1163 @param This The Form Browser protocol instanse.\r
1164 @param Handles A pointer to an array of Handles. If HandleCount > 1 we\r
1165 display a list of the formsets for the handles specified.\r
1166 @param HandleCount The number of Handles specified in Handle.\r
1167 @param FormSetGuid This field points to the EFI_GUID which must match the Guid\r
1168 field in the EFI_IFR_FORM_SET op-code for the specified\r
1169 forms-based package. If FormSetGuid is NULL, then this\r
1170 function will display the first found forms package.\r
1171 @param FormId This field specifies which EFI_IFR_FORM to render as the first\r
1172 displayable page. If this field has a value of 0x0000, then\r
1173 the forms browser will render the specified forms in their encoded order.\r
1174 ScreenDimenions - This allows the browser to be called so that it occupies a\r
1175 portion of the physical screen instead of dynamically determining the screen dimensions.\r
1176 ActionRequest - Points to the action recommended by the form.\r
d66e6c16 1177 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in\r
7936fb6a 1178 characters.\r
1179 @param ActionRequest Points to the action recommended by the form.\r
1180\r
1181 @retval EFI_SUCCESS The function completed successfully.\r
1182 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1183 @retval EFI_NOT_FOUND No valid forms could be found to display.\r
1184\r
1185**/\r
1186EFI_STATUS\r
1187EFIAPI\r
1188SendForm (\r
1189 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1190 IN EFI_HII_HANDLE *Handles,\r
1191 IN UINTN HandleCount,\r
1192 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1193 IN UINT16 FormId, OPTIONAL\r
1194 IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL\r
1195 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL\r
ed66e1bc 1196 );\r
7936fb6a 1197\r
1198/**\r
1199 This function is called by a callback handler to retrieve uncommitted state\r
1200 data from the browser.\r
1201\r
1202 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
1203 instance.\r
1204 @param ResultsDataSize A pointer to the size of the buffer associated\r
1205 with ResultsData.\r
1206 @param ResultsData A string returned from an IFR browser or\r
1207 equivalent. The results string will have no\r
1208 routing information in them.\r
1209 @param RetrieveData A BOOLEAN field which allows an agent to retrieve\r
1210 (if RetrieveData = TRUE) data from the uncommitted\r
1211 browser state information or set (if RetrieveData\r
1212 = FALSE) data in the uncommitted browser state\r
1213 information.\r
1214 @param VariableGuid An optional field to indicate the target variable\r
1215 GUID name to use.\r
1216 @param VariableName An optional field to indicate the target\r
1217 human-readable variable name.\r
1218\r
1219 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1220 distribution.\r
1221 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to\r
1222 contain the results data.\r
1223\r
1224**/\r
1225EFI_STATUS\r
1226EFIAPI\r
1227BrowserCallback (\r
1228 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1229 IN OUT UINTN *ResultsDataSize,\r
1230 IN OUT EFI_STRING ResultsData,\r
1231 IN BOOLEAN RetrieveData,\r
1232 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
1233 IN CONST CHAR16 *VariableName OPTIONAL\r
ed66e1bc 1234 );\r
7936fb6a 1235\r
b18e7050
ED
1236/**\r
1237 Find menu which will show next time.\r
1238\r
1239 @param Selection On input, Selection tell setup browser the information\r
1240 about the Selection, form and formset to be displayed.\r
1241 On output, Selection return the screen item that is selected\r
1242 by user.\r
1243 @param Repaint Whether need to repaint the menu.\r
1244 @param NewLine Whether need to show at new line.\r
1245 \r
1246 @retval TRUE Need return.\r
1247 @retval FALSE No need to return.\r
1248**/\r
1249BOOLEAN\r
1250FindNextMenu (\r
1251 IN OUT UI_MENU_SELECTION *Selection,\r
1252 IN BOOLEAN *Repaint, \r
1253 IN BOOLEAN *NewLine \r
1254 );\r
1255\r
1256/**\r
1257 check whether the formset need to update the NV.\r
1258\r
1259 @param FormSet FormSet data structure.\r
1260 @param SetValue Whether set new value or clear old value.\r
1261\r
1262**/\r
1263VOID\r
1264UpdateNvInfoInForm (\r
1265 IN FORM_BROWSER_FORMSET *FormSet,\r
1266 IN BOOLEAN SetValue\r
1267 );\r
1268\r
1269/**\r
1270 check whether the formset need to update the NV.\r
1271\r
1272 @param FormSet FormSet data structure.\r
1273\r
1274 @retval TRUE Need to update the NV.\r
1275 @retval FALSE No need to update the NV.\r
1276**/\r
1277BOOLEAN \r
1278IsNvUpdateRequired (\r
1279 IN FORM_BROWSER_FORMSET *FormSet\r
1280 );\r
1281\r
1282/**\r
1283 Call the call back function for the question and process the return action.\r
1284\r
1285 @param Selection On input, Selection tell setup browser the information\r
1286 about the Selection, form and formset to be displayed.\r
1287 On output, Selection return the screen item that is selected\r
1288 by user.\r
1289 @param Statement The Question which need to call.\r
1290 @param Action The action request.\r
1291 @param SkipSaveOrDiscard Whether skip save or discard action.\r
1292\r
1293 @retval EFI_SUCCESS The call back function excutes successfully.\r
1294 @return Other value if the call back function failed to excute. \r
1295**/\r
1296EFI_STATUS \r
1297ProcessCallBackFunction (\r
1298 IN OUT UI_MENU_SELECTION *Selection,\r
1299 IN FORM_BROWSER_STATEMENT *Question,\r
1300 IN EFI_BROWSER_ACTION Action,\r
1301 IN BOOLEAN SkipSaveOrDiscard\r
1302 );\r
7936fb6a 1303#endif\r