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