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