]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
Keep consistent about the return value between the caller and callee.
[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
80a047f0 4Copyright (c) 2007 - 2013, 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
7c6c064c
ED
25#include <Protocol/FormBrowserEx2.h>\r
26#include <Protocol/DisplayProtocol.h>\r
7936fb6a 27#include <Protocol/DevicePath.h>\r
28#include <Protocol/UnicodeCollation.h>\r
29#include <Protocol/HiiConfigAccess.h>\r
30#include <Protocol/HiiConfigRouting.h>\r
31#include <Protocol/HiiDatabase.h>\r
32#include <Protocol/HiiString.h>\r
cbf73e50 33#include <Protocol/UserManager.h>\r
80a047f0 34#include <Protocol/DevicePathFromText.h>\r
7936fb6a 35\r
5c526736 36#include <Guid/MdeModuleHii.h>\r
0a1147ed 37#include <Guid/HiiPlatformSetupFormset.h>\r
2573712e 38#include <Guid/HiiFormMapMethodGuid.h>\r
7936fb6a 39\r
7936fb6a 40#include <Library/PrintLib.h>\r
41#include <Library/DebugLib.h>\r
42#include <Library/BaseMemoryLib.h>\r
43#include <Library/UefiRuntimeServicesTableLib.h>\r
44#include <Library/UefiDriverEntryPoint.h>\r
45#include <Library/UefiBootServicesTableLib.h>\r
46#include <Library/BaseLib.h>\r
47#include <Library/MemoryAllocationLib.h>\r
7936fb6a 48#include <Library/HiiLib.h>\r
f511d656 49#include <Library/PcdLib.h>\r
cb7d01c0 50#include <Library/DevicePathLib.h>\r
7c6c064c 51#include <Library/UefiLib.h>\r
7936fb6a 52\r
7936fb6a 53\r
54//\r
55// This is the generated header file which includes whatever needs to be exported (strings + IFR)\r
56//\r
57\r
7c6c064c
ED
58#define UI_ACTION_NONE 0\r
59#define UI_ACTION_REFRESH_FORM 1\r
60#define UI_ACTION_REFRESH_FORMSET 2\r
61#define UI_ACTION_EXIT 3\r
7936fb6a 62\r
63//\r
7936fb6a 64//\r
65// Time definitions\r
66//\r
67#define ONE_SECOND 10000000\r
68\r
7936fb6a 69// Incremental string lenght of ConfigRequest\r
70//\r
71#define CONFIG_REQUEST_STRING_INCREMENTAL 1024\r
72\r
7936fb6a 73//\r
74// Incremental size of stack for expression\r
75//\r
76#define EXPRESSION_STACK_SIZE_INCREMENT 0x100\r
77\r
0269d14b 78#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 79\r
7936fb6a 80\r
f3f2e05d 81#define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')\r
7936fb6a 82typedef struct {\r
83 UINT32 Signature;\r
84\r
85 EFI_HANDLE Handle;\r
86\r
87 //\r
88 // Produced protocol\r
89 //\r
7c6c064c
ED
90 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2;\r
91 EFI_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx;\r
7936fb6a 92\r
7c6c064c 93 EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2;\r
7936fb6a 94\r
7c6c064c 95} SETUP_DRIVER_PRIVATE_DATA;\r
25361615 96\r
7936fb6a 97//\r
98// IFR relative definition\r
99//\r
100#define EFI_HII_EXPRESSION_INCONSISTENT_IF 0\r
101#define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1\r
102#define EFI_HII_EXPRESSION_GRAY_OUT_IF 2\r
103#define EFI_HII_EXPRESSION_SUPPRESS_IF 3\r
104#define EFI_HII_EXPRESSION_DISABLE_IF 4\r
105#define EFI_HII_EXPRESSION_VALUE 5\r
106#define EFI_HII_EXPRESSION_RULE 6\r
2573712e
LG
107#define EFI_HII_EXPRESSION_READ 7\r
108#define EFI_HII_EXPRESSION_WRITE 8\r
1c0d306f 109#define EFI_HII_EXPRESSION_WARNING_IF 9\r
7936fb6a 110\r
111#define EFI_HII_VARSTORE_BUFFER 0\r
112#define EFI_HII_VARSTORE_NAME_VALUE 1\r
c0462ea7
ED
113#define EFI_HII_VARSTORE_EFI_VARIABLE 2 // EFI Varstore type follow UEFI spec before 2.3.1.\r
114#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 // EFI varstore type follow UEFI spec 2.3.1 and later.\r
7936fb6a 115\r
116#define FORM_INCONSISTENT_VALIDATION 0\r
117#define FORM_NO_SUBMIT_VALIDATION 1\r
118\r
f3f2e05d 119#define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')\r
7936fb6a 120\r
121typedef struct {\r
122 UINTN Signature;\r
123 LIST_ENTRY Link;\r
124 CHAR16 *Name;\r
125 CHAR16 *Value;\r
126 CHAR16 *EditValue;\r
127} NAME_VALUE_NODE;\r
128\r
129#define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)\r
130\r
94f3aae7 131#define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')\r
7936fb6a 132\r
133typedef struct {\r
134 UINTN Signature;\r
135 LIST_ENTRY Link;\r
136\r
137 UINT8 Type; // Storage type\r
138\r
fae73624
ED
139 BOOLEAN Initialized; // Whether this varstore is initialized, efi varstore not used.\r
140\r
141 EFI_HII_HANDLE HiiHandle; // HiiHandle for this varstore, efi varstore not used.\r
7936fb6a 142 EFI_GUID Guid;\r
143\r
144 CHAR16 *Name; // For EFI_IFR_VARSTORE\r
145 UINT16 Size;\r
146 UINT8 *Buffer;\r
147 UINT8 *EditBuffer; // Edit copy for Buffer Storage\r
148\r
149 LIST_ENTRY NameValueListHead; // List of NAME_VALUE_NODE\r
150\r
151 UINT32 Attributes; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute\r
152\r
153 CHAR16 *ConfigHdr; // <ConfigHdr>\r
efffd9c1
ED
154 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
155 // <RequestElement> includes all fields which is used by current form sets.\r
156 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
94f3aae7
ED
157} BROWSER_STORAGE;\r
158\r
159#define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)\r
160\r
161#define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')\r
162\r
163typedef struct {\r
164 UINTN Signature;\r
165 LIST_ENTRY Link;\r
166\r
167 UINT16 VarStoreId;\r
168\r
169 BROWSER_STORAGE *BrowserStorage;\r
170\r
7936fb6a 171 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
7c6c064c 172 CHAR16 *ConfigElements;// Elements need to load initial data.\r
7936fb6a 173 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r
174 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
175} FORMSET_STORAGE;\r
176\r
177#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)\r
178\r
2573712e
LG
179typedef union {\r
180 EFI_STRING_ID VarName;\r
181 UINT16 VarOffset;\r
182} VAR_STORE_INFO;\r
183\r
f3f2e05d 184#define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')\r
7936fb6a 185\r
186typedef struct {\r
187 UINTN Signature;\r
188 LIST_ENTRY Link;\r
189\r
190 UINT8 Operand;\r
191\r
192 UINT8 Format; // For EFI_IFR_TO_STRING, EFI_IFR_FIND\r
193 UINT8 Flags; // For EFI_IFR_SPAN\r
194 UINT8 RuleId; // For EFI_IFR_RULE_REF\r
195\r
196 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
197\r
2654f642 198 EFI_QUESTION_ID QuestionId; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1\r
7936fb6a 199 EFI_QUESTION_ID QuestionId2;\r
200\r
2654f642 201 UINT16 ListLength; // For EFI_IFR_EQ_ID_VAL_LIST\r
7936fb6a 202 UINT16 *ValueList;\r
203\r
204 EFI_STRING_ID DevicePath; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3\r
205 EFI_GUID Guid;\r
2573712e 206\r
94f3aae7 207 BROWSER_STORAGE *VarStorage; // For EFI_IFR_SET, EFI_IFR_GET\r
2573712e
LG
208 VAR_STORE_INFO VarStoreInfo;// For EFI_IFR_SET, EFI_IFR_GET\r
209 UINT8 ValueType; // For EFI_IFR_SET, EFI_IFR_GET\r
210 UINT8 ValueWidth; // For EFI_IFR_SET, EFI_IFR_GET\r
211 CHAR16 *ValueName; // For EFI_IFR_SET, EFI_IFR_GET\r
212 LIST_ENTRY MapExpressionList; // nested expressions inside of Map opcode.\r
7936fb6a 213} EXPRESSION_OPCODE;\r
214\r
215#define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)\r
216\r
f3f2e05d 217#define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')\r
7936fb6a 218\r
219typedef struct {\r
220 UINTN Signature;\r
221 LIST_ENTRY Link;\r
222\r
223 UINT8 Type; // Type for this expression\r
224\r
225 UINT8 RuleId; // For EFI_IFR_RULE only\r
226 EFI_STRING_ID Error; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only\r
227\r
228 EFI_HII_VALUE Result; // Expression evaluation result\r
229\r
1c0d306f
ED
230 UINT8 TimeOut; // For EFI_IFR_WARNING_IF\r
231\r
7936fb6a 232 LIST_ENTRY OpCodeListHead; // OpCodes consist of this expression (EXPRESSION_OPCODE)\r
233} FORM_EXPRESSION;\r
234\r
235#define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r
236\r
31585af4
ED
237#define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')\r
238\r
239typedef struct {\r
240 UINTN Signature;\r
241 UINTN Count;\r
242 FORM_EXPRESSION *Expression[1]; // Array[Count] of expressions\r
243} FORM_EXPRESSION_LIST;\r
244\r
f3f2e05d 245#define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')\r
7936fb6a 246\r
247typedef struct {\r
248 UINTN Signature;\r
249 LIST_ENTRY Link;\r
250\r
251 UINT16 DefaultId;\r
252 EFI_HII_VALUE Value; // Default value\r
253\r
254 FORM_EXPRESSION *ValueExpression; // Not-NULL indicates default value is provided by EFI_IFR_VALUE\r
255} QUESTION_DEFAULT;\r
256\r
257#define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)\r
258\r
f3f2e05d 259#define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')\r
7936fb6a 260\r
261typedef struct {\r
31585af4
ED
262 UINTN Signature;\r
263 LIST_ENTRY Link;\r
7c6c064c
ED
264 \r
265 EFI_IFR_ONE_OF_OPTION *OpCode; // OneOfOption Data\r
7936fb6a 266\r
31585af4
ED
267 EFI_STRING_ID Text;\r
268 UINT8 Flags;\r
269 EFI_HII_VALUE Value;\r
270 EFI_IMAGE_ID ImageId;\r
7936fb6a 271\r
31585af4 272 FORM_EXPRESSION_LIST *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
7936fb6a 273} QUESTION_OPTION;\r
274\r
275#define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r
276\r
31585af4
ED
277typedef enum {\r
278 ExpressFalse = 0,\r
279 ExpressGrayOut, \r
280 ExpressSuppress,\r
281 ExpressDisable\r
282} EXPRESS_RESULT;\r
283\r
284typedef enum {\r
285 ExpressNone = 0,\r
286 ExpressForm, \r
287 ExpressStatement,\r
288 ExpressOption\r
289} EXPRESS_LEVEL;\r
290\r
077c7aee
ED
291typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT;\r
292\r
f3f2e05d 293#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')\r
1ccdbf2a 294\r
077c7aee 295struct _FORM_BROWSER_STATEMENT{\r
7936fb6a 296 UINTN Signature;\r
297 LIST_ENTRY Link;\r
298\r
299 UINT8 Operand; // The operand (first byte) of this Statement or Question\r
7c6c064c 300 EFI_IFR_OP_HEADER *OpCode;\r
7936fb6a 301\r
302 //\r
303 // Statement Header\r
304 //\r
305 EFI_STRING_ID Prompt;\r
306 EFI_STRING_ID Help;\r
307 EFI_STRING_ID TextTwo; // For EFI_IFR_TEXT\r
308\r
7c6c064c
ED
309 //\r
310 // Fake Question Id, used for statement not has true QuestionId.\r
311 //\r
312 EFI_QUESTION_ID FakeQuestionId;\r
313\r
7936fb6a 314 //\r
315 // Question Header\r
316 //\r
317 EFI_QUESTION_ID QuestionId; // The value of zero is reserved\r
318 EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage\r
94f3aae7 319 BROWSER_STORAGE *Storage;\r
1ccdbf2a 320 VAR_STORE_INFO VarStoreInfo;\r
7936fb6a 321 UINT16 StorageWidth;\r
322 UINT8 QuestionFlags;\r
323 CHAR16 *VariableName; // Name/Value or EFI Variable name\r
324 CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."\r
325\r
326 EFI_HII_VALUE HiiValue; // Edit copy for checkbox, numberic, oneof\r
327 UINT8 *BufferValue; // Edit copy for string, password, orderedlist\r
d02847d3 328 UINT8 ValueType; // Data type for orderedlist value array\r
7936fb6a 329\r
330 //\r
331 // OpCode specific members\r
332 //\r
333 UINT8 Flags; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,\r
334 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER\r
335 UINT8 MaxContainers; // for EFI_IFR_ORDERED_LIST\r
336\r
337 UINT16 BannerLineNumber; // for EFI_IFR_BANNER, 1-based line number\r
338 EFI_STRING_ID QuestionConfig; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed\r
339\r
340 UINT64 Minimum; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value\r
341 UINT64 Maximum; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length\r
342 UINT64 Step;\r
343\r
344 EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON\r
211cc6e5 345 EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID\r
f67c4382 346 BOOLEAN Locked; // Whether this statement is locked.\r
7c6c064c 347 BOOLEAN ValueChanged; // Whether this statement's value is changed.\r
7936fb6a 348 //\r
349 // Get from IFR parsing\r
350 //\r
351 FORM_EXPRESSION *ValueExpression; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly\r
352 LIST_ENTRY DefaultListHead; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values\r
353 LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r
354\r
355 EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE\r
356 UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh\r
077c7aee
ED
357\r
358 FORM_BROWSER_STATEMENT *ParentStatement;\r
7936fb6a 359\r
360 LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
361 LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)\r
1c0d306f 362 LIST_ENTRY WarningListHead; // nested warning expression list (FORM_EXPRESSION)\r
31585af4 363 FORM_EXPRESSION_LIST *Expression; // nesting inside of GrayOutIf/DisableIf/SuppressIf\r
7936fb6a 364\r
2573712e
LG
365 FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.\r
366 FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.\r
077c7aee 367};\r
7936fb6a 368\r
369#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r
370\r
b18e7050
ED
371#define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')\r
372typedef struct {\r
373 UINTN Signature;\r
374 LIST_ENTRY Link;\r
375\r
376 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
377 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest> \r
378 UINTN SpareStrLen;\r
379\r
94f3aae7 380 BROWSER_STORAGE *Storage;\r
b18e7050
ED
381} FORM_BROWSER_CONFIG_REQUEST;\r
382#define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)\r
383\r
f3f2e05d 384#define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r
2573712e 385#define STANDARD_MAP_FORM_TYPE 0x01\r
7936fb6a 386\r
387typedef struct {\r
31585af4
ED
388 UINTN Signature;\r
389 LIST_ENTRY Link;\r
7936fb6a 390\r
31585af4
ED
391 UINT16 FormId; // FormId of normal form or formmap form.\r
392 EFI_STRING_ID FormTitle; // FormTile of normal form, or FormMapMethod title of formmap form.\r
393 UINT16 FormType; // Specific form type for the different form.\r
7936fb6a 394\r
31585af4 395 EFI_IMAGE_ID ImageId;\r
7936fb6a 396\r
31585af4
ED
397 BOOLEAN ModalForm; // Whether this is a modal form.\r
398 BOOLEAN Locked; // Whether this form is locked.\r
b00964a9 399\r
31585af4
ED
400 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
401 LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
402 LIST_ENTRY ConfigRequestHead; // List of configreques for all storage.\r
403 FORM_EXPRESSION_LIST *SuppressExpression; // nesting inside of SuppressIf\r
7936fb6a 404} FORM_BROWSER_FORM;\r
405\r
406#define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r
407\r
f3f2e05d 408#define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')\r
7936fb6a 409\r
410typedef struct {\r
411 UINTN Signature;\r
412 LIST_ENTRY Link;\r
413\r
414 UINT16 DefaultId;\r
415 EFI_STRING_ID DefaultName;\r
416} FORMSET_DEFAULTSTORE;\r
417\r
418#define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)\r
419\r
48a9d5f7
LG
420#define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')\r
421\r
7936fb6a 422typedef struct {\r
48a9d5f7
LG
423 UINTN Signature;\r
424 LIST_ENTRY Link;\r
425 EFI_HII_HANDLE HiiHandle; // unique id for formset.\r
7936fb6a 426 EFI_HANDLE DriverHandle;\r
427 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
428 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
429\r
430 UINTN IfrBinaryLength;\r
431 UINT8 *IfrBinaryData;\r
432\r
7c6c064c 433 BOOLEAN QuestionInited; // Have finished question initilization?\r
7936fb6a 434 EFI_GUID Guid;\r
435 EFI_STRING_ID FormSetTitle;\r
436 EFI_STRING_ID Help;\r
0a1147ed
LG
437 UINT8 NumberOfClassGuid;\r
438 EFI_GUID ClassGuid[3]; // Up to three ClassGuid\r
439 UINT16 Class; // Tiano extended Class code\r
440 UINT16 SubClass; // Tiano extended Subclass code\r
7936fb6a 441 EFI_IMAGE_ID ImageId;\r
442\r
443 FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions\r
444 EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode\r
445\r
7c6c064c 446 LIST_ENTRY StatementListOSF; // Statement list out side of the form.\r
7936fb6a 447 LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)\r
448 LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)\r
449 LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)\r
0c66bc76 450 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
7936fb6a 451} FORM_BROWSER_FORMSET;\r
25361615 452#define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)\r
b9feb4bd 453\r
7c6c064c
ED
454typedef struct {\r
455 LIST_ENTRY Link;\r
456 EFI_EVENT RefreshEvent;\r
457} FORM_BROWSER_REFRESH_EVENT_NODE;\r
458\r
459#define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)\r
460\r
b9feb4bd 461\r
48a9d5f7 462typedef struct {\r
7c6c064c 463 EFI_HII_HANDLE Handle;\r
48a9d5f7 464\r
7c6c064c
ED
465 //\r
466 // Target formset/form/Question information\r
467 //\r
468 EFI_GUID FormSetGuid;\r
469 UINT16 FormId;\r
470 UINT16 QuestionId;\r
471 UINTN Sequence; // used for time/date only.\r
472\r
473 UINTN TopRow;\r
474 UINTN BottomRow;\r
475 UINTN PromptCol;\r
476 UINTN OptionCol;\r
477 UINTN CurrentRow;\r
478\r
479 //\r
480 // Ation for Browser to taken:\r
481 // UI_ACTION_NONE - navigation inside a form\r
482 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form\r
483 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary\r
484 //\r
485 UINTN Action;\r
486\r
487 //\r
488 // Current selected fomset/form/Question\r
489 //\r
490 FORM_BROWSER_FORMSET *FormSet;\r
491 FORM_BROWSER_FORM *Form;\r
492 FORM_BROWSER_STATEMENT *Statement;\r
493\r
494 //\r
495 // Whether the Form is editable\r
496 //\r
497 BOOLEAN FormEditable;\r
498\r
499 FORM_ENTRY_INFO *CurrentMenu;\r
500} UI_MENU_SELECTION;\r
48a9d5f7 501\r
5a9f73bf
ED
502#define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')\r
503\r
504typedef struct {\r
505 UINTN Signature;\r
506 LIST_ENTRY Link;\r
507\r
508 //\r
509 // Globals defined in Setup.c\r
510 //\r
511 BOOLEAN ResetRequired;\r
512 BOOLEAN ExitRequired;\r
513 EFI_HII_HANDLE HiiHandle;\r
514 EFI_GUID FormSetGuid;\r
515 EFI_FORM_ID FormId;\r
516 UI_MENU_SELECTION *Selection;\r
517\r
518 LIST_ENTRY FormHistoryList;\r
519} BROWSER_CONTEXT;\r
520\r
521#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)\r
522\r
09cdd7d2
ED
523//\r
524// Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.\r
525//\r
526typedef enum {\r
527 GetDefaultForNoStorage, // Get default value for question which not has storage.\r
528 GetDefaultForStorage, // Get default value for question which has storage.\r
529 GetDefaultForAll, // Get default value for all questions.\r
530 GetDefaultForMax // Invalid value.\r
531} BROWSER_GET_DEFAULT_VALUE;\r
532\r
816a7110
ED
533//\r
534// Get/set question value from/to.\r
535//\r
536typedef enum {\r
537 GetSetValueWithEditBuffer, // Get/Set question value from/to editbuffer in the storage.\r
538 GetSetValueWithBuffer, // Get/Set question value from/to buffer in the storage.\r
539 GetSetValueWithHiiDriver, // Get/Set question value from/to hii driver.\r
540 GetSetValueWithMax // Invalid value.\r
541} GET_SET_QUESTION_VALUE_WITH;\r
542\r
7936fb6a 543extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r
7936fb6a 544extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r
80a047f0 545extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText;\r
7c6c064c 546extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;\r
7936fb6a 547\r
7936fb6a 548extern BOOLEAN gResetRequired;\r
7c6c064c 549extern BOOLEAN gExitRequired;\r
798e4d22 550extern BOOLEAN gFinishRetrieveCall;\r
48a9d5f7
LG
551extern LIST_ENTRY gBrowserFormSetList;\r
552extern LIST_ENTRY gBrowserHotKeyList;\r
553extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r
554extern EXIT_HANDLER ExitHandlerFunction;\r
7c6c064c 555extern EFI_HII_HANDLE mCurrentHiiHandle;\r
184f3a02 556extern SETUP_DRIVER_PRIVATE_DATA mPrivateData;\r
7936fb6a 557//\r
558// Browser Global Strings\r
559//\r
7936fb6a 560extern CHAR16 *gEmptyString;\r
7936fb6a 561\r
562extern EFI_GUID gZeroGuid;\r
7936fb6a 563\r
7c6c064c
ED
564extern UI_MENU_SELECTION *gCurrentSelection;\r
565\r
7936fb6a 566//\r
567// Global Procedure Defines\r
568//\r
7c6c064c 569#include "Expression.h"\r
7936fb6a 570\r
571/**\r
572 Initialize the HII String Token to the correct values.\r
573\r
574**/\r
575VOID\r
576InitializeBrowserStrings (\r
577 VOID\r
ed66e1bc 578 );\r
7936fb6a 579\r
7936fb6a 580/**\r
581 Parse opcodes in the formset IFR binary.\r
582\r
583 @param FormSet Pointer of the FormSet data structure.\r
584\r
585 @retval EFI_SUCCESS Opcode parse success.\r
586 @retval Other Opcode parse fail.\r
587\r
588**/\r
589EFI_STATUS\r
590ParseOpCodes (\r
591 IN FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 592 );\r
7936fb6a 593\r
594/**\r
595 Free resources allocated for a FormSet.\r
596\r
597 @param FormSet Pointer of the FormSet\r
598\r
599**/\r
600VOID\r
601DestroyFormSet (\r
602 IN OUT FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 603 );\r
7936fb6a 604\r
7936fb6a 605\r
606/**\r
607 Create a new string in HII Package List.\r
608\r
609 @param String The String to be added\r
610 @param HiiHandle The package list in the HII database to insert the\r
611 specified string.\r
612\r
613 @return The output string.\r
614\r
615**/\r
616EFI_STRING_ID\r
617NewString (\r
618 IN CHAR16 *String,\r
619 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 620 );\r
7936fb6a 621\r
622/**\r
623 Delete a string from HII Package List.\r
624\r
625 @param StringId Id of the string in HII database.\r
626 @param HiiHandle The HII package list handle.\r
627\r
628 @retval EFI_SUCCESS The string was deleted successfully.\r
629\r
630**/\r
631EFI_STATUS\r
632DeleteString (\r
633 IN EFI_STRING_ID StringId,\r
634 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 635 );\r
7936fb6a 636\r
637/**\r
638 Get the string based on the StringId and HII Package List Handle.\r
639\r
640 @param Token The String's ID.\r
641 @param HiiHandle The package list in the HII database to search for\r
642 the specified string.\r
643\r
644 @return The output string.\r
645\r
646**/\r
647CHAR16 *\r
648GetToken (\r
649 IN EFI_STRING_ID Token,\r
650 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 651 );\r
7936fb6a 652\r
2573712e
LG
653/**\r
654 Get Value for given Name from a NameValue Storage.\r
655\r
656 @param Storage The NameValue Storage.\r
657 @param Name The Name.\r
658 @param Value The retured Value.\r
816a7110 659 @param GetValueFrom Where to get source value, from EditValue or Value.\r
2573712e
LG
660\r
661 @retval EFI_SUCCESS Value found for given Name.\r
662 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
663\r
664**/\r
665EFI_STATUS\r
666GetValueByName (\r
94f3aae7 667 IN BROWSER_STORAGE *Storage,\r
816a7110
ED
668 IN CHAR16 *Name,\r
669 IN OUT CHAR16 **Value,\r
670 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
2573712e
LG
671 );\r
672\r
673/**\r
674 Set Value of given Name in a NameValue Storage.\r
675\r
676 @param Storage The NameValue Storage.\r
677 @param Name The Name.\r
678 @param Value The Value to set.\r
816a7110 679 @param SetValueTo Whether update editValue or Value.\r
7c6c064c 680 @param ReturnNode The node use the input name.\r
2573712e
LG
681\r
682 @retval EFI_SUCCESS Value found for given Name.\r
683 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
684\r
685**/\r
686EFI_STATUS\r
687SetValueByName (\r
7c6c064c
ED
688 IN BROWSER_STORAGE *Storage,\r
689 IN CHAR16 *Name,\r
690 IN CHAR16 *Value,\r
691 IN GET_SET_QUESTION_VALUE_WITH SetValueTo,\r
692 OUT NAME_VALUE_NODE **ReturnNode\r
693 );\r
694\r
695/**\r
696 Validate whether this question's value has changed.\r
697\r
698 @param FormSet FormSet data structure.\r
699 @param Form Form data structure.\r
700 @param Question Question to be initialized.\r
701 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r
702\r
703 @retval TRUE Question's value has changed.\r
704 @retval FALSE Question's value has not changed\r
705\r
706**/\r
707BOOLEAN\r
708IsQuestionValueChanged (\r
709 IN FORM_BROWSER_FORMSET *FormSet,\r
710 IN FORM_BROWSER_FORM *Form,\r
711 IN OUT FORM_BROWSER_STATEMENT *Question,\r
712 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
2573712e
LG
713 );\r
714\r
7936fb6a 715/**\r
716 Get Question's current Value.\r
717\r
718 @param FormSet FormSet data structure.\r
719 @param Form Form data structure.\r
720 @param Question Question to be initialized.\r
816a7110 721 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r
7936fb6a 722\r
723 @retval EFI_SUCCESS The function completed successfully.\r
724\r
725**/\r
726EFI_STATUS\r
727GetQuestionValue (\r
728 IN FORM_BROWSER_FORMSET *FormSet,\r
729 IN FORM_BROWSER_FORM *Form,\r
730 IN OUT FORM_BROWSER_STATEMENT *Question,\r
816a7110 731 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
ed66e1bc 732 );\r
7936fb6a 733\r
734/**\r
735 Save Question Value to edit copy(cached) or Storage(uncached).\r
736\r
737 @param FormSet FormSet data structure.\r
738 @param Form Form data structure.\r
739 @param Question Pointer to the Question.\r
816a7110 740 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.\r
7936fb6a 741\r
742 @retval EFI_SUCCESS The function completed successfully.\r
743\r
744**/\r
745EFI_STATUS\r
746SetQuestionValue (\r
747 IN FORM_BROWSER_FORMSET *FormSet,\r
748 IN FORM_BROWSER_FORM *Form,\r
749 IN OUT FORM_BROWSER_STATEMENT *Question,\r
816a7110 750 IN GET_SET_QUESTION_VALUE_WITH SetValueTo\r
ed66e1bc 751 );\r
7936fb6a 752\r
753/**\r
754 Perform inconsistent check for a Form.\r
755\r
756 @param FormSet FormSet data structure.\r
757 @param Form Form data structure.\r
758 @param Question The Question to be validated.\r
759 @param Type Validation type: InConsistent or NoSubmit\r
760\r
761 @retval EFI_SUCCESS Form validation pass.\r
762 @retval other Form validation failed.\r
763\r
764**/\r
765EFI_STATUS\r
766ValidateQuestion (\r
767 IN FORM_BROWSER_FORMSET *FormSet,\r
768 IN FORM_BROWSER_FORM *Form,\r
769 IN FORM_BROWSER_STATEMENT *Question,\r
770 IN UINTN Type\r
ed66e1bc 771 );\r
7936fb6a 772\r
48a9d5f7 773\r
7936fb6a 774/**\r
48a9d5f7 775 Discard data based on the input setting scope (Form, FormSet or System).\r
7936fb6a 776\r
777 @param FormSet FormSet data structure.\r
778 @param Form Form data structure.\r
48a9d5f7 779 @param SettingScope Setting Scope for Discard action.\r
b18e7050
ED
780\r
781 @retval EFI_SUCCESS The function completed successfully.\r
48a9d5f7 782 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
b18e7050
ED
783\r
784**/\r
785EFI_STATUS\r
786DiscardForm (\r
787 IN FORM_BROWSER_FORMSET *FormSet,\r
788 IN FORM_BROWSER_FORM *Form,\r
48a9d5f7 789 IN BROWSER_SETTING_SCOPE SettingScope\r
b18e7050
ED
790 );\r
791\r
792/**\r
48a9d5f7 793 Submit data based on the input Setting level (Form, FormSet or System).\r
b18e7050
ED
794\r
795 @param FormSet FormSet data structure.\r
796 @param Form Form data structure.\r
48a9d5f7 797 @param SettingScope Setting Scope for Submit action.\r
7936fb6a 798\r
799 @retval EFI_SUCCESS The function completed successfully.\r
48a9d5f7 800 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
7936fb6a 801\r
802**/\r
803EFI_STATUS\r
804SubmitForm (\r
805 IN FORM_BROWSER_FORMSET *FormSet,\r
b18e7050 806 IN FORM_BROWSER_FORM *Form,\r
48a9d5f7 807 IN BROWSER_SETTING_SCOPE SettingScope\r
ed66e1bc 808 );\r
7936fb6a 809\r
810/**\r
811 Reset Question to its default value.\r
812\r
813 @param FormSet The form set.\r
814 @param Form The form.\r
815 @param Question The question.\r
816 @param DefaultId The Class of the default.\r
817\r
818 @retval EFI_SUCCESS Question is reset to default value.\r
819\r
820**/\r
821EFI_STATUS\r
822GetQuestionDefault (\r
823 IN FORM_BROWSER_FORMSET *FormSet,\r
824 IN FORM_BROWSER_FORM *Form,\r
825 IN FORM_BROWSER_STATEMENT *Question,\r
826 IN UINT16 DefaultId\r
ed66e1bc 827 );\r
7936fb6a 828\r
829/**\r
830 Get current setting of Questions.\r
831\r
832 @param FormSet FormSet data structure.\r
833\r
7936fb6a 834**/\r
7c6c064c 835VOID\r
7936fb6a 836InitializeCurrentSetting (\r
837 IN OUT FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 838 );\r
7936fb6a 839\r
840/**\r
841 Initialize the internal data structure of a FormSet.\r
842\r
843 @param Handle PackageList Handle\r
844 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
845 GUID), take the first FormSet found in package\r
846 list.\r
847 @param FormSet FormSet data structure.\r
848\r
849 @retval EFI_SUCCESS The function completed successfully.\r
850 @retval EFI_NOT_FOUND The specified FormSet could not be found.\r
851\r
852**/\r
853EFI_STATUS\r
854InitializeFormSet (\r
855 IN EFI_HII_HANDLE Handle,\r
856 IN OUT EFI_GUID *FormSetGuid,\r
7c6c064c 857 OUT FORM_BROWSER_FORMSET *FormSet \r
ed66e1bc 858 );\r
7936fb6a 859\r
860/**\r
9776099f 861 Reset Questions to their initial value or default value in a Form, Formset or System.\r
7936fb6a 862\r
09cdd7d2
ED
863 GetDefaultValueScope parameter decides which questions will reset \r
864 to its default value.\r
865\r
7936fb6a 866 @param FormSet FormSet data structure.\r
48a9d5f7 867 @param Form Form data structure.\r
7936fb6a 868 @param DefaultId The Class of the default.\r
48a9d5f7 869 @param SettingScope Setting Scope for Default action.\r
09cdd7d2 870 @param GetDefaultValueScope Get default value scope.\r
3347d410 871 @param Storage Get default value only for this storage.\r
9776099f
ED
872 @param RetrieveValueFirst Whether call the retrieve call back to\r
873 get the initial value before get default\r
874 value.\r
7936fb6a 875\r
876 @retval EFI_SUCCESS The function completed successfully.\r
48a9d5f7 877 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
7936fb6a 878\r
879**/\r
880EFI_STATUS\r
48a9d5f7 881ExtractDefault (\r
7936fb6a 882 IN FORM_BROWSER_FORMSET *FormSet,\r
48a9d5f7
LG
883 IN FORM_BROWSER_FORM *Form,\r
884 IN UINT16 DefaultId,\r
3347d410 885 IN BROWSER_SETTING_SCOPE SettingScope,\r
09cdd7d2 886 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope,\r
94f3aae7 887 IN BROWSER_STORAGE *Storage,\r
9776099f 888 IN BOOLEAN RetrieveValueFirst\r
ed66e1bc 889 );\r
7936fb6a 890\r
891/**\r
892 Initialize Question's Edit copy from Storage.\r
893\r
eccfeab1
LG
894 @param Selection Selection contains the information about \r
895 the Selection, form and formset to be displayed.\r
896 Selection action may be updated in retrieve callback.\r
7d1b202d 897 If Selection is NULL, only initialize Question value.\r
7936fb6a 898 @param FormSet FormSet data structure.\r
899 @param Form Form data structure.\r
900\r
901 @retval EFI_SUCCESS The function completed successfully.\r
902\r
903**/\r
904EFI_STATUS\r
905LoadFormConfig (\r
eccfeab1
LG
906 IN OUT UI_MENU_SELECTION *Selection,\r
907 IN FORM_BROWSER_FORMSET *FormSet,\r
908 IN FORM_BROWSER_FORM *Form\r
ed66e1bc 909 );\r
7936fb6a 910\r
d66e6c16 911/**\r
912 Initialize Question's Edit copy from Storage for the whole Formset.\r
913\r
eccfeab1
LG
914 @param Selection Selection contains the information about \r
915 the Selection, form and formset to be displayed.\r
916 Selection action may be updated in retrieve callback.\r
7d1b202d 917 If Selection is NULL, only initialize Question value.\r
d66e6c16 918 @param FormSet FormSet data structure.\r
919\r
920 @retval EFI_SUCCESS The function completed successfully.\r
921\r
922**/\r
923EFI_STATUS\r
924LoadFormSetConfig (\r
eccfeab1
LG
925 IN OUT UI_MENU_SELECTION *Selection,\r
926 IN FORM_BROWSER_FORMSET *FormSet\r
d66e6c16 927 );\r
928\r
7936fb6a 929/**\r
930 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.\r
931\r
94f3aae7 932 @param Storage The Storage to be conveted.\r
7936fb6a 933 @param ConfigResp The returned <ConfigResp>.\r
94f3aae7 934 @param ConfigRequest The ConfigRequest string.\r
7c6c064c 935 @param GetEditBuf Get the data from editbuffer or buffer.\r
7936fb6a 936\r
937 @retval EFI_SUCCESS Convert success.\r
938 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
939\r
940**/\r
941EFI_STATUS\r
942StorageToConfigResp (\r
94f3aae7 943 IN BROWSER_STORAGE *Storage,\r
b18e7050 944 IN CHAR16 **ConfigResp,\r
7c6c064c
ED
945 IN CHAR16 *ConfigRequest,\r
946 IN BOOLEAN GetEditBuf\r
ed66e1bc 947 );\r
7936fb6a 948\r
949/**\r
950 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.\r
951\r
952 @param Storage The Storage to receive the settings.\r
953 @param ConfigResp The <ConfigResp> to be converted.\r
954\r
955 @retval EFI_SUCCESS Convert success.\r
956 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
957\r
958**/\r
959EFI_STATUS\r
960ConfigRespToStorage (\r
94f3aae7 961 IN BROWSER_STORAGE *Storage,\r
7936fb6a 962 IN CHAR16 *ConfigResp\r
ed66e1bc 963 );\r
7936fb6a 964\r
965/**\r
966 Fill storage's edit copy with settings requested from Configuration Driver.\r
967\r
968 @param FormSet FormSet data structure.\r
969 @param Storage Buffer Storage.\r
970\r
7936fb6a 971**/\r
7c6c064c 972VOID\r
7936fb6a 973LoadStorage (\r
974 IN FORM_BROWSER_FORMSET *FormSet,\r
975 IN FORMSET_STORAGE *Storage\r
ed66e1bc 976 );\r
7936fb6a 977\r
978/**\r
979 Fetch the Ifr binary data of a FormSet.\r
980\r
981 @param Handle PackageList Handle\r
982 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
983 GUID), take the first FormSet found in package\r
984 list.\r
985 @param BinaryLength The length of the FormSet IFR binary.\r
986 @param BinaryData The buffer designed to receive the FormSet.\r
987\r
988 @retval EFI_SUCCESS Buffer filled with the requested FormSet.\r
989 BufferLength was updated.\r
990 @retval EFI_INVALID_PARAMETER The handle is unknown.\r
991 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot\r
992 be found with the requested FormId.\r
993\r
994**/\r
995EFI_STATUS\r
996GetIfrBinaryData (\r
997 IN EFI_HII_HANDLE Handle,\r
998 IN OUT EFI_GUID *FormSetGuid,\r
999 OUT UINTN *BinaryLength,\r
1000 OUT UINT8 **BinaryData\r
ed66e1bc 1001 );\r
7936fb6a 1002\r
ce6d12cc 1003/**\r
1004 Save globals used by previous call to SendForm(). SendForm() may be called from \r
1005 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r
1006 So, save globals of previous call to SendForm() and restore them upon exit.\r
1007\r
1008**/\r
1009VOID\r
1010SaveBrowserContext (\r
1011 VOID\r
1012 );\r
1013\r
1014/**\r
1015 Restore globals used by previous call to SendForm().\r
1016\r
1017**/\r
1018VOID\r
1019RestoreBrowserContext (\r
1020 VOID\r
1021 );\r
1022\r
7936fb6a 1023/**\r
1024 This is the routine which an external caller uses to direct the browser\r
1025 where to obtain it's information.\r
1026\r
1027\r
1028 @param This The Form Browser protocol instanse.\r
1029 @param Handles A pointer to an array of Handles. If HandleCount > 1 we\r
1030 display a list of the formsets for the handles specified.\r
1031 @param HandleCount The number of Handles specified in Handle.\r
1032 @param FormSetGuid This field points to the EFI_GUID which must match the Guid\r
1033 field in the EFI_IFR_FORM_SET op-code for the specified\r
1034 forms-based package. If FormSetGuid is NULL, then this\r
1035 function will display the first found forms package.\r
1036 @param FormId This field specifies which EFI_IFR_FORM to render as the first\r
1037 displayable page. If this field has a value of 0x0000, then\r
1038 the forms browser will render the specified forms in their encoded order.\r
1039 ScreenDimenions - This allows the browser to be called so that it occupies a\r
1040 portion of the physical screen instead of dynamically determining the screen dimensions.\r
1041 ActionRequest - Points to the action recommended by the form.\r
d66e6c16 1042 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in\r
7936fb6a 1043 characters.\r
1044 @param ActionRequest Points to the action recommended by the form.\r
1045\r
1046 @retval EFI_SUCCESS The function completed successfully.\r
1047 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1048 @retval EFI_NOT_FOUND No valid forms could be found to display.\r
1049\r
1050**/\r
1051EFI_STATUS\r
1052EFIAPI\r
1053SendForm (\r
1054 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1055 IN EFI_HII_HANDLE *Handles,\r
1056 IN UINTN HandleCount,\r
1057 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1058 IN UINT16 FormId, OPTIONAL\r
1059 IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL\r
1060 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL\r
ed66e1bc 1061 );\r
7936fb6a 1062\r
1063/**\r
1064 This function is called by a callback handler to retrieve uncommitted state\r
1065 data from the browser.\r
1066\r
1067 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
1068 instance.\r
1069 @param ResultsDataSize A pointer to the size of the buffer associated\r
1070 with ResultsData.\r
1071 @param ResultsData A string returned from an IFR browser or\r
1072 equivalent. The results string will have no\r
1073 routing information in them.\r
1074 @param RetrieveData A BOOLEAN field which allows an agent to retrieve\r
1075 (if RetrieveData = TRUE) data from the uncommitted\r
1076 browser state information or set (if RetrieveData\r
1077 = FALSE) data in the uncommitted browser state\r
1078 information.\r
1079 @param VariableGuid An optional field to indicate the target variable\r
1080 GUID name to use.\r
1081 @param VariableName An optional field to indicate the target\r
1082 human-readable variable name.\r
1083\r
1084 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1085 distribution.\r
1086 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to\r
1087 contain the results data.\r
1088\r
1089**/\r
1090EFI_STATUS\r
1091EFIAPI\r
1092BrowserCallback (\r
1093 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1094 IN OUT UINTN *ResultsDataSize,\r
1095 IN OUT EFI_STRING ResultsData,\r
1096 IN BOOLEAN RetrieveData,\r
1097 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
1098 IN CONST CHAR16 *VariableName OPTIONAL\r
ed66e1bc 1099 );\r
7936fb6a 1100\r
b18e7050
ED
1101/**\r
1102 Find menu which will show next time.\r
1103\r
1104 @param Selection On input, Selection tell setup browser the information\r
1105 about the Selection, form and formset to be displayed.\r
1106 On output, Selection return the screen item that is selected\r
1107 by user.\r
7c6c064c
ED
1108 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form. \r
1109 else, we need to exit current formset.\r
b18e7050 1110 \r
7c6c064c
ED
1111 @retval TRUE Exit current form.\r
1112 @retval FALSE User press ESC and keep in current form.\r
b18e7050
ED
1113**/\r
1114BOOLEAN\r
1115FindNextMenu (\r
7c6c064c
ED
1116 IN OUT UI_MENU_SELECTION *Selection,\r
1117 IN BROWSER_SETTING_SCOPE SettingLevel\r
b18e7050
ED
1118 );\r
1119\r
1120/**\r
7c6c064c 1121 check whether the form need to update the NV.\r
b18e7050 1122\r
7c6c064c 1123 @param Form Form data structure.\r
b18e7050 1124\r
7c6c064c
ED
1125 @retval TRUE Need to update the NV.\r
1126 @retval FALSE No need to update the NV.\r
b18e7050 1127**/\r
7c6c064c
ED
1128BOOLEAN\r
1129IsNvUpdateRequiredForForm (\r
1130 IN FORM_BROWSER_FORM *Form\r
b18e7050
ED
1131 );\r
1132\r
1133/**\r
1134 check whether the formset need to update the NV.\r
1135\r
1136 @param FormSet FormSet data structure.\r
1137\r
1138 @retval TRUE Need to update the NV.\r
1139 @retval FALSE No need to update the NV.\r
1140**/\r
7c6c064c
ED
1141BOOLEAN\r
1142IsNvUpdateRequiredForFormSet (\r
25361615 1143 IN FORM_BROWSER_FORMSET *FormSet\r
b9feb4bd
ED
1144 );\r
1145\r
7c6c064c
ED
1146/**\r
1147 Check whether the storage data for current form set is changed.\r
1148\r
1149 @param FormSet FormSet data structure.\r
1150\r
1151 @retval TRUE Data is changed.\r
1152 @retval FALSE Data is not changed.\r
1153**/\r
1154BOOLEAN \r
1155IsStorageDataChangedForFormSet (\r
1156 IN FORM_BROWSER_FORMSET *FormSet\r
1157 );\r
1158\r
b18e7050
ED
1159/**\r
1160 Call the call back function for the question and process the return action.\r
1161\r
1162 @param Selection On input, Selection tell setup browser the information\r
1163 about the Selection, form and formset to be displayed.\r
1164 On output, Selection return the screen item that is selected\r
1165 by user.\r
798e4d22
ED
1166 @param FormSet The formset this question belong to.\r
1167 @param Form The form this question belong to.\r
1168 @param Question The Question which need to call.\r
b18e7050
ED
1169 @param Action The action request.\r
1170 @param SkipSaveOrDiscard Whether skip save or discard action.\r
1171\r
1172 @retval EFI_SUCCESS The call back function excutes successfully.\r
1173 @return Other value if the call back function failed to excute. \r
1174**/\r
1175EFI_STATUS \r
1176ProcessCallBackFunction (\r
1177 IN OUT UI_MENU_SELECTION *Selection,\r
798e4d22
ED
1178 IN FORM_BROWSER_FORMSET *FormSet,\r
1179 IN FORM_BROWSER_FORM *Form,\r
b18e7050
ED
1180 IN FORM_BROWSER_STATEMENT *Question,\r
1181 IN EFI_BROWSER_ACTION Action,\r
1182 IN BOOLEAN SkipSaveOrDiscard\r
1183 );\r
9776099f
ED
1184 \r
1185/**\r
1186 Call the retrieve type call back function for one question to get the initialize data.\r
1187 \r
1188 This function only used when in the initialize stage, because in this stage, the \r
1189 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.\r
1190\r
1191 @param ConfigAccess The config access protocol produced by the hii driver.\r
1192 @param Statement The Question which need to call.\r
1193\r
1194 @retval EFI_SUCCESS The call back function excutes successfully.\r
1195 @return Other value if the call back function failed to excute. \r
1196**/\r
1197EFI_STATUS \r
1198ProcessRetrieveForQuestion (\r
1199 IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,\r
1200 IN FORM_BROWSER_STATEMENT *Statement\r
1201 );\r
48a9d5f7
LG
1202\r
1203/**\r
1204 Find the matched FormSet context in the backup maintain list based on HiiHandle.\r
1205 \r
1206 @param Handle The Hii Handle.\r
1207 \r
1208 @return the found FormSet context. If no found, NULL will return.\r
1209\r
1210**/\r
1211FORM_BROWSER_FORMSET * \r
1212GetFormSetFromHiiHandle (\r
1213 EFI_HII_HANDLE Handle\r
1214 );\r
1215\r
1216/**\r
1217 Check whether the input HII handle is the FormSet that is being used.\r
1218 \r
1219 @param Handle The Hii Handle.\r
1220 \r
1221 @retval TRUE HII handle is being used.\r
1222 @retval FALSE HII handle is not being used.\r
1223\r
1224**/\r
1225BOOLEAN\r
1226IsHiiHandleInBrowserContext (\r
1227 EFI_HII_HANDLE Handle\r
1228 );\r
1229\r
1230/**\r
1231 Configure what scope the hot key will impact.\r
1232 All hot keys have the same scope. The mixed hot keys with the different level are not supported.\r
1233 If no scope is set, the default scope will be FormSet level.\r
1234 After all registered hot keys are removed, previous Scope can reset to another level.\r
1235 \r
1236 @param[in] Scope Scope level to be set. \r
1237 \r
1238 @retval EFI_SUCCESS Scope is set correctly.\r
1239 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE. \r
1240 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.\r
1241\r
1242**/\r
1243EFI_STATUS\r
1244EFIAPI\r
1245SetScope (\r
1246 IN BROWSER_SETTING_SCOPE Scope\r
1247 );\r
1248\r
1249/**\r
1250 Register the hot key with its browser action, or unregistered the hot key.\r
1251 Only support hot key that is not printable character (control key, function key, etc.).\r
1252 If the action value is zero, the hot key will be unregistered if it has been registered.\r
1253 If the same hot key has been registered, the new action and help string will override the previous ones.\r
1254 \r
1255 @param[in] KeyData A pointer to a buffer that describes the keystroke\r
1256 information for the hot key. Its type is EFI_INPUT_KEY to \r
1257 be supported by all ConsoleIn devices.\r
1258 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed. \r
1259 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.\r
1260 @param[in] HelpString Help string that describes the hot key information.\r
1261 Its value may be NULL for the unregistered hot key.\r
1262 \r
1263 @retval EFI_SUCCESS Hot key is registered or unregistered.\r
1264 @retval EFI_INVALID_PARAMETER KeyData is NULL.\r
1265 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.\r
1266 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.\r
1267**/\r
1268EFI_STATUS\r
1269EFIAPI\r
1270RegisterHotKey (\r
1271 IN EFI_INPUT_KEY *KeyData,\r
1272 IN UINT32 Action,\r
1273 IN UINT16 DefaultId,\r
1274 IN EFI_STRING HelpString OPTIONAL\r
1275 );\r
1276\r
1277/**\r
1278 Register Exit handler function. \r
1279 When more than one handler function is registered, the latter one will override the previous one. \r
1280 When NULL handler is specified, the previous Exit handler will be unregistered. \r
1281 \r
1282 @param[in] Handler Pointer to handler function. \r
1283\r
1284**/\r
1285VOID\r
1286EFIAPI\r
1287RegiserExitHandler (\r
1288 IN EXIT_HANDLER Handler\r
1289 );\r
1290\r
7c6c064c
ED
1291/**\r
1292 \r
1293 Check whether the browser data has been modified. \r
1294\r
1295 @retval TRUE Browser data is changed.\r
1296 @retval FALSE No browser data is changed.\r
1297\r
1298**/\r
1299BOOLEAN \r
1300EFIAPI\r
1301IsBrowserDataModified (\r
1302 VOID\r
1303 );\r
1304\r
1305/**\r
1306 \r
1307 Execute the action requested by the Action parameter. \r
1308\r
1309 @param[in] Action Execute the request action.\r
1310 @param[in] DefaultId The default Id info when need to load default value.\r
1311\r
1312 @retval EFI_SUCCESS Execute the request action succss.\r
1313 @retval EFI_INVALID_PARAMETER The input action value is invalid.\r
1314\r
1315**/\r
1316EFI_STATUS \r
1317EFIAPI\r
1318ExecuteAction (\r
1319 IN UINT32 Action,\r
1320 IN UINT16 DefaultId\r
1321 );\r
1322\r
48a9d5f7
LG
1323/**\r
1324 Create reminder to let user to choose save or discard the changed browser data.\r
1325 Caller can use it to actively check the changed browser data.\r
1326\r
1327 @retval BROWSER_NO_CHANGES No browser data is changed.\r
1328 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.\r
1329 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.\r
27bace9b 1330 @retval BROWSER_KEEP_CURRENT Browser keep current changes.\r
48a9d5f7
LG
1331\r
1332**/\r
1333UINT32\r
1334EFIAPI\r
1335SaveReminder (\r
1336 VOID\r
1337 );\r
1338\r
1339/**\r
1340 Find the registered HotKey based on KeyData.\r
1341 \r
1342 @param[in] KeyData A pointer to a buffer that describes the keystroke\r
1343 information for the hot key.\r
1344\r
1345 @return The registered HotKey context. If no found, NULL will return.\r
1346**/\r
1347BROWSER_HOT_KEY *\r
1348GetHotKeyFromRegisterList (\r
1349 IN EFI_INPUT_KEY *KeyData\r
1350 );\r
1351\r
7c6c064c
ED
1352/**\r
1353\r
1354 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r
1355\r
1356 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r
1357\r
1358 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r
1359\r
1360**/\r
1361FORM_BROWSER_STATEMENT *\r
1362GetBrowserStatement (\r
1363 IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
1364 );\r
1365 \r
1366/**\r
1367 Password may be stored as encrypted by Configuration Driver. When change a\r
1368 password, user will be challenged with old password. To validate user input old\r
1369 password, we will send the clear text to Configuration Driver via Callback().\r
1370 Configuration driver is responsible to check the passed in password and return\r
1371 the validation result. If validation pass, state machine in password Callback()\r
1372 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.\r
1373 After user type in new password twice, Callback() will be invoked to send the\r
1374 new password to Configuration Driver.\r
1375\r
1376 @param Selection Pointer to UI_MENU_SELECTION.\r
1377 @param MenuOption The MenuOption for this password Question.\r
1378 @param String The clear text of password.\r
1379\r
1380 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.\r
1381 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:\r
1382 @retval EFI_SUCCESS Password correct, Browser will prompt for new\r
1383 password.\r
1384 @retval EFI_NOT_READY Password incorrect, Browser will show error\r
1385 message.\r
1386 @retval Other Browser will do nothing.\r
1387 @return In state of BROWSER_STATE_SET_PASSWORD:\r
1388 @retval EFI_SUCCESS Set password success.\r
1389 @retval Other Set password failed.\r
1390\r
1391**/\r
1392EFI_STATUS\r
1393PasswordCallback (\r
1394 IN UI_MENU_SELECTION *Selection,\r
1395 IN FORM_BROWSER_STATEMENT *Question,\r
1396 IN CHAR16 *String\r
1397 );\r
1398\r
1399/**\r
1400 Display error message for invalid password.\r
1401\r
1402**/\r
1403VOID\r
1404PasswordInvalid (\r
1405 VOID\r
1406 );\r
1407\r
1408/**\r
1409 The worker function that send the displays to the screen. On output,\r
1410 the selection made by user is returned.\r
1411\r
1412 @param Selection On input, Selection tell setup browser the information\r
1413 about the Selection, form and formset to be displayed.\r
1414 On output, Selection return the screen item that is selected\r
1415 by user.\r
1416\r
1417 @retval EFI_SUCCESS The page is displayed successfully.\r
1418 @return Other value if the page failed to be diplayed.\r
1419\r
1420**/\r
1421EFI_STATUS\r
1422SetupBrowser (\r
1423 IN OUT UI_MENU_SELECTION *Selection\r
1424 );\r
1425 \r
1426/**\r
1427 Free up the resource allocated for all strings required\r
1428 by Setup Browser.\r
1429\r
1430**/\r
1431VOID\r
1432FreeBrowserStrings (\r
1433 VOID\r
1434 );\r
1435\r
1436/**\r
1437 Create a menu with specified formset GUID and form ID, and add it as a child\r
1438 of the given parent menu.\r
1439\r
1440 @param HiiHandle Hii handle related to this formset.\r
1441 @param FormSetGuid The Formset Guid of menu to be added.\r
1442 @param FormId The Form ID of menu to be added.\r
1443 @param QuestionId The question id of this menu to be added.\r
1444\r
1445 @return A pointer to the newly added menu or NULL if memory is insufficient.\r
1446\r
1447**/\r
1448FORM_ENTRY_INFO *\r
1449UiAddMenuList (\r
1450 IN EFI_HII_HANDLE HiiHandle,\r
1451 IN EFI_GUID *FormSetGuid,\r
1452 IN UINT16 FormId,\r
1453 IN UINT16 QuestionId\r
1454 );\r
1455\r
1456/**\r
1457 Search Menu with given FormSetGuid and FormId in all cached menu list.\r
1458\r
1459 @param HiiHandle HiiHandle for FormSet.\r
1460 @param FormSetGuid The Formset GUID of the menu to search.\r
1461 @param FormId The Form ID of menu to search.\r
1462\r
1463 @return A pointer to menu found or NULL if not found.\r
1464\r
1465**/\r
1466FORM_ENTRY_INFO *\r
1467UiFindMenuList (\r
1468 IN EFI_HII_HANDLE HiiHandle, \r
1469 IN EFI_GUID *FormSetGuid,\r
1470 IN UINT16 FormId\r
1471 );\r
1472\r
1473/**\r
1474 Free Menu list linked list.\r
1475\r
1476 @param MenuListHead One Menu list point in the menu list.\r
1477\r
1478**/\r
1479VOID\r
1480UiFreeMenuList (\r
1481 LIST_ENTRY *MenuListHead\r
1482 );\r
1483\r
1484/**\r
1485 Find parent menu for current menu.\r
1486\r
1487 @param CurrentMenu Current Menu\r
1488\r
1489 @retval The parent menu for current menu.\r
1490**/\r
1491FORM_ENTRY_INFO *\r
1492UiFindParentMenu (\r
1493 IN FORM_ENTRY_INFO *CurrentMenu\r
1494 );\r
1495\r
1496/**\r
1497 Search an Option of a Question by its value.\r
1498\r
1499 @param Question The Question\r
1500 @param OptionValue Value for Option to be searched.\r
1501\r
1502 @retval Pointer Pointer to the found Option.\r
1503 @retval NULL Option not found.\r
1504\r
1505**/\r
1506QUESTION_OPTION *\r
1507ValueToOption (\r
1508 IN FORM_BROWSER_STATEMENT *Question,\r
1509 IN EFI_HII_VALUE *OptionValue\r
1510 );\r
1511/**\r
1512 Return data element in an Array by its Index.\r
1513\r
1514 @param Array The data array.\r
1515 @param Type Type of the data in this array.\r
1516 @param Index Zero based index for data in this array.\r
1517\r
1518 @retval Value The data to be returned\r
1519\r
1520**/\r
1521UINT64\r
1522GetArrayData (\r
1523 IN VOID *Array,\r
1524 IN UINT8 Type,\r
1525 IN UINTN Index\r
1526 );\r
1527\r
1528/**\r
1529 Set value of a data element in an Array by its Index.\r
1530\r
1531 @param Array The data array.\r
1532 @param Type Type of the data in this array.\r
1533 @param Index Zero based index for data in this array.\r
1534 @param Value The value to be set.\r
1535\r
1536**/\r
1537VOID\r
1538SetArrayData (\r
1539 IN VOID *Array,\r
1540 IN UINT8 Type,\r
1541 IN UINTN Index,\r
1542 IN UINT64 Value\r
1543 );\r
1544\r
1545/**\r
1546 Compare two Hii value.\r
1547 \r
1548 @param Value1 Expression value to compare on left-hand.\r
1549 @param Value2 Expression value to compare on right-hand.\r
1550 @param Result Return value after compare.\r
1551 retval 0 Two operators equal.\r
1552 return Positive value if Value1 is greater than Value2.\r
1553 retval Negative value if Value1 is less than Value2.\r
1554 @param HiiHandle Only required for string compare.\r
1555 \r
1556 @retval other Could not perform compare on two values.\r
1557 @retval EFI_SUCCESS Compare the value success.\r
1558 \r
1559**/\r
1560EFI_STATUS\r
1561CompareHiiValue (\r
1562 IN EFI_HII_VALUE *Value1,\r
1563 IN EFI_HII_VALUE *Value2,\r
1564 OUT INTN *Result,\r
1565 IN EFI_HII_HANDLE HiiHandle OPTIONAL\r
1566 );\r
1567\r
1568/**\r
1569 Perform Password check. \r
1570 Passwork may be encrypted by driver that requires the specific check.\r
1571 \r
1572 @param Form Form where Password Statement is in.\r
1573 @param Statement Password statement\r
1574 @param PasswordString Password string to be checked. It may be NULL.\r
1575 NULL means to restore password.\r
1576 "" string can be used to checked whether old password does exist.\r
1577 \r
1578 @return Status Status of Password check.\r
1579**/\r
1580EFI_STATUS\r
1581EFIAPI\r
1582PasswordCheck (\r
1583 IN FORM_DISPLAY_ENGINE_FORM *Form,\r
1584 IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,\r
1585 IN EFI_STRING PasswordString OPTIONAL\r
1586 );\r
1587\r
1588/**\r
1589\r
1590 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r
1591\r
1592 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r
1593\r
1594 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r
1595\r
1596**/\r
1597FORM_BROWSER_STATEMENT *\r
1598GetBrowserStatement (\r
1599 IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
1600 );\r
1601 \r
1602/**\r
1603\r
1604 Initialize the Display form structure data.\r
1605\r
1606**/\r
1607VOID\r
1608InitializeDisplayFormData (\r
1609 VOID\r
1610 );\r
1611\r
1612\r
0a6f8af5
ED
1613/**\r
1614 Base on the current formset info, clean the ConfigRequest string in browser storage.\r
1615\r
1616 @param FormSet Pointer of the FormSet\r
1617\r
1618**/\r
1619VOID\r
1620CleanBrowserStorage (\r
1621 IN OUT FORM_BROWSER_FORMSET *FormSet\r
1622 );\r
07d7dbae
ED
1623\r
1624/**\r
1625 Find HII Handle in the HII database associated with given Device Path.\r
1626\r
1627 If DevicePath is NULL, then ASSERT.\r
1628\r
1629 @param DevicePath Device Path associated with the HII package list\r
1630 handle.\r
1631 @param FormsetGuid The formset guid for this formset.\r
1632\r
1633 @retval Handle HII package list Handle associated with the Device\r
1634 Path.\r
1635 @retval NULL Hii Package list handle is not found.\r
1636\r
1637**/\r
1638EFI_HII_HANDLE\r
1639DevicePathToHiiHandle (\r
1640 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
1641 IN EFI_GUID *FormsetGuid\r
1642 );\r
1643\r
7936fb6a 1644#endif\r