]>
Commit | Line | Data |
---|---|---|
7936fb6a | 1 | /** @file\r |
d66e6c16 | 2 | Private MACRO, structure and function definitions for Setup Browser module.\r |
7936fb6a | 3 | \r |
892eccc8 | 4 | Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r |
e5eed7d3 | 5 | This program and the accompanying materials\r |
7936fb6a | 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 | |
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 | 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 | |
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 |
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 | |
94f3aae7 | 131 | #define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')\r |
7936fb6a | 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 | |
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 | |
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 | |
7936fb6a | 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 | |
2573712e LG |
178 | typedef union {\r |
179 | EFI_STRING_ID VarName;\r | |
180 | UINT16 VarOffset;\r | |
181 | } VAR_STORE_INFO;\r | |
182 | \r | |
f3f2e05d | 183 | #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')\r |
7936fb6a | 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 | |
2654f642 | 197 | EFI_QUESTION_ID QuestionId; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1\r |
7936fb6a | 198 | EFI_QUESTION_ID QuestionId2;\r |
199 | \r | |
2654f642 | 200 | UINT16 ListLength; // For EFI_IFR_EQ_ID_VAL_LIST\r |
7936fb6a | 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 | |
2573712e | 205 | \r |
94f3aae7 | 206 | BROWSER_STORAGE *VarStorage; // For EFI_IFR_SET, EFI_IFR_GET\r |
2573712e LG |
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 | |
7936fb6a | 212 | } EXPRESSION_OPCODE;\r |
213 | \r | |
214 | #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)\r | |
215 | \r | |
f3f2e05d | 216 | #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')\r |
7936fb6a | 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 | |
1c0d306f ED |
229 | UINT8 TimeOut; // For EFI_IFR_WARNING_IF\r |
230 | \r | |
7936fb6a | 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 | |
31585af4 ED |
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 | |
f3f2e05d | 244 | #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')\r |
7936fb6a | 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 | |
f3f2e05d | 258 | #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')\r |
7936fb6a | 259 | \r |
260 | typedef struct {\r | |
31585af4 ED |
261 | UINTN Signature;\r |
262 | LIST_ENTRY Link;\r | |
7c6c064c ED |
263 | \r |
264 | EFI_IFR_ONE_OF_OPTION *OpCode; // OneOfOption Data\r | |
7936fb6a | 265 | \r |
31585af4 ED |
266 | EFI_STRING_ID Text;\r |
267 | UINT8 Flags;\r | |
268 | EFI_HII_VALUE Value;\r | |
269 | EFI_IMAGE_ID ImageId;\r | |
7936fb6a | 270 | \r |
31585af4 | 271 | FORM_EXPRESSION_LIST *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r |
7936fb6a | 272 | } QUESTION_OPTION;\r |
273 | \r | |
274 | #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r | |
275 | \r | |
31585af4 ED |
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 | |
077c7aee ED |
290 | typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT;\r |
291 | \r | |
f3f2e05d | 292 | #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')\r |
1ccdbf2a | 293 | \r |
077c7aee | 294 | struct _FORM_BROWSER_STATEMENT{\r |
7936fb6a | 295 | UINTN Signature;\r |
296 | LIST_ENTRY Link;\r | |
297 | \r | |
298 | UINT8 Operand; // The operand (first byte) of this Statement or Question\r | |
7c6c064c | 299 | EFI_IFR_OP_HEADER *OpCode;\r |
7936fb6a | 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 | |
7c6c064c ED |
308 | //\r |
309 | // Fake Question Id, used for statement not has true QuestionId.\r | |
310 | //\r | |
311 | EFI_QUESTION_ID FakeQuestionId;\r | |
312 | \r | |
7936fb6a | 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 | |
94f3aae7 | 318 | BROWSER_STORAGE *Storage;\r |
1ccdbf2a | 319 | VAR_STORE_INFO VarStoreInfo;\r |
7936fb6a | 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 | |
d02847d3 | 327 | UINT8 ValueType; // Data type for orderedlist value array\r |
7936fb6a | 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 | |
211cc6e5 | 344 | EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID\r |
f67c4382 | 345 | BOOLEAN Locked; // Whether this statement is locked.\r |
7c6c064c | 346 | BOOLEAN ValueChanged; // Whether this statement's value is changed.\r |
7936fb6a | 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 | |
077c7aee ED |
356 | \r |
357 | FORM_BROWSER_STATEMENT *ParentStatement;\r | |
7936fb6a | 358 | \r |
359 | LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r | |
360 | LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)\r | |
1c0d306f | 361 | LIST_ENTRY WarningListHead; // nested warning expression list (FORM_EXPRESSION)\r |
31585af4 | 362 | FORM_EXPRESSION_LIST *Expression; // nesting inside of GrayOutIf/DisableIf/SuppressIf\r |
7936fb6a | 363 | \r |
2573712e LG |
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 | |
077c7aee | 366 | };\r |
7936fb6a | 367 | \r |
368 | #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r | |
369 | \r | |
b18e7050 ED |
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 | |
94f3aae7 | 379 | BROWSER_STORAGE *Storage;\r |
b18e7050 ED |
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 | |
f3f2e05d | 383 | #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r |
2573712e | 384 | #define STANDARD_MAP_FORM_TYPE 0x01\r |
7936fb6a | 385 | \r |
386 | typedef struct {\r | |
31585af4 ED |
387 | UINTN Signature;\r |
388 | LIST_ENTRY Link;\r | |
7936fb6a | 389 | \r |
31585af4 ED |
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 | |
7936fb6a | 393 | \r |
31585af4 | 394 | EFI_IMAGE_ID ImageId;\r |
7936fb6a | 395 | \r |
31585af4 ED |
396 | BOOLEAN ModalForm; // Whether this is a modal form.\r |
397 | BOOLEAN Locked; // Whether this form is locked.\r | |
b00964a9 | 398 | \r |
31585af4 ED |
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 | |
7936fb6a | 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 | |
f3f2e05d | 407 | #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')\r |
7936fb6a | 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 | |
48a9d5f7 LG |
419 | #define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')\r |
420 | \r | |
7936fb6a | 421 | typedef struct {\r |
48a9d5f7 LG |
422 | UINTN Signature;\r |
423 | LIST_ENTRY Link;\r | |
424 | EFI_HII_HANDLE HiiHandle; // unique id for formset.\r | |
7936fb6a | 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 | |
7c6c064c | 432 | BOOLEAN QuestionInited; // Have finished question initilization?\r |
7936fb6a | 433 | EFI_GUID Guid;\r |
434 | EFI_STRING_ID FormSetTitle;\r | |
435 | EFI_STRING_ID Help;\r | |
0a1147ed LG |
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 | |
7936fb6a | 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 | |
7c6c064c | 445 | LIST_ENTRY StatementListOSF; // Statement list out side of the form.\r |
7936fb6a | 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 | |
0c66bc76 | 449 | LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r |
7936fb6a | 450 | } FORM_BROWSER_FORMSET;\r |
25361615 | 451 | #define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)\r |
b9feb4bd | 452 | \r |
7c6c064c ED |
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 | |
b9feb4bd | 460 | \r |
48a9d5f7 | 461 | typedef struct {\r |
7c6c064c | 462 | EFI_HII_HANDLE Handle;\r |
48a9d5f7 | 463 | \r |
7c6c064c ED |
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 | |
48a9d5f7 | 500 | \r |
5a9f73bf ED |
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 | |
09cdd7d2 ED |
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 | |
816a7110 ED |
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 | |
7936fb6a | 542 | extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r |
7936fb6a | 543 | extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r |
80a047f0 | 544 | extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText;\r |
7c6c064c | 545 | extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;\r |
7936fb6a | 546 | \r |
7936fb6a | 547 | extern BOOLEAN gResetRequired;\r |
7c6c064c | 548 | extern BOOLEAN gExitRequired;\r |
798e4d22 | 549 | extern BOOLEAN gFinishRetrieveCall;\r |
48a9d5f7 LG |
550 | extern LIST_ENTRY gBrowserFormSetList;\r |
551 | extern LIST_ENTRY gBrowserHotKeyList;\r | |
552 | extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r | |
553 | extern EXIT_HANDLER ExitHandlerFunction;\r | |
7c6c064c | 554 | extern EFI_HII_HANDLE mCurrentHiiHandle;\r |
184f3a02 | 555 | extern SETUP_DRIVER_PRIVATE_DATA mPrivateData;\r |
7936fb6a | 556 | //\r |
557 | // Browser Global Strings\r | |
558 | //\r | |
7936fb6a | 559 | extern CHAR16 *gEmptyString;\r |
7936fb6a | 560 | \r |
561 | extern EFI_GUID gZeroGuid;\r | |
7936fb6a | 562 | \r |
7c6c064c ED |
563 | extern UI_MENU_SELECTION *gCurrentSelection;\r |
564 | \r | |
7936fb6a | 565 | //\r |
566 | // Global Procedure Defines\r | |
567 | //\r | |
7c6c064c | 568 | #include "Expression.h"\r |
7936fb6a | 569 | \r |
570 | /**\r | |
571 | Initialize the HII String Token to the correct values.\r | |
572 | \r | |
573 | **/\r | |
574 | VOID\r | |
575 | InitializeBrowserStrings (\r | |
576 | VOID\r | |
ed66e1bc | 577 | );\r |
7936fb6a | 578 | \r |
7936fb6a | 579 | /**\r |
580 | Parse opcodes in the formset IFR binary.\r | |
581 | \r | |
582 | @param FormSet Pointer of the FormSet data structure.\r | |
583 | \r | |
584 | @retval EFI_SUCCESS Opcode parse success.\r | |
585 | @retval Other Opcode parse fail.\r | |
586 | \r | |
587 | **/\r | |
588 | EFI_STATUS\r | |
589 | ParseOpCodes (\r | |
590 | IN FORM_BROWSER_FORMSET *FormSet\r | |
ed66e1bc | 591 | );\r |
7936fb6a | 592 | \r |
593 | /**\r | |
594 | Free resources allocated for a FormSet.\r | |
595 | \r | |
596 | @param FormSet Pointer of the FormSet\r | |
597 | \r | |
598 | **/\r | |
599 | VOID\r | |
600 | DestroyFormSet (\r | |
601 | IN OUT FORM_BROWSER_FORMSET *FormSet\r | |
ed66e1bc | 602 | );\r |
7936fb6a | 603 | \r |
7936fb6a | 604 | \r |
605 | /**\r | |
606 | Create a new string in HII Package List.\r | |
607 | \r | |
608 | @param String The String to be added\r | |
609 | @param HiiHandle The package list in the HII database to insert the\r | |
610 | specified string.\r | |
611 | \r | |
612 | @return The output string.\r | |
613 | \r | |
614 | **/\r | |
615 | EFI_STRING_ID\r | |
616 | NewString (\r | |
617 | IN CHAR16 *String,\r | |
618 | IN EFI_HII_HANDLE HiiHandle\r | |
ed66e1bc | 619 | );\r |
7936fb6a | 620 | \r |
621 | /**\r | |
622 | Delete a string from HII Package List.\r | |
623 | \r | |
624 | @param StringId Id of the string in HII database.\r | |
625 | @param HiiHandle The HII package list handle.\r | |
626 | \r | |
627 | @retval EFI_SUCCESS The string was deleted successfully.\r | |
628 | \r | |
629 | **/\r | |
630 | EFI_STATUS\r | |
631 | DeleteString (\r | |
632 | IN EFI_STRING_ID StringId,\r | |
633 | IN EFI_HII_HANDLE HiiHandle\r | |
ed66e1bc | 634 | );\r |
7936fb6a | 635 | \r |
636 | /**\r | |
637 | Get the string based on the StringId and HII Package List Handle.\r | |
638 | \r | |
639 | @param Token The String's ID.\r | |
640 | @param HiiHandle The package list in the HII database to search for\r | |
641 | the specified string.\r | |
642 | \r | |
643 | @return The output string.\r | |
644 | \r | |
645 | **/\r | |
646 | CHAR16 *\r | |
647 | GetToken (\r | |
648 | IN EFI_STRING_ID Token,\r | |
649 | IN EFI_HII_HANDLE HiiHandle\r | |
ed66e1bc | 650 | );\r |
7936fb6a | 651 | \r |
2573712e LG |
652 | /**\r |
653 | Get Value for given Name from a NameValue Storage.\r | |
654 | \r | |
655 | @param Storage The NameValue Storage.\r | |
656 | @param Name The Name.\r | |
657 | @param Value The retured Value.\r | |
816a7110 | 658 | @param GetValueFrom Where to get source value, from EditValue or Value.\r |
2573712e LG |
659 | \r |
660 | @retval EFI_SUCCESS Value found for given Name.\r | |
661 | @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r | |
662 | \r | |
663 | **/\r | |
664 | EFI_STATUS\r | |
665 | GetValueByName (\r | |
94f3aae7 | 666 | IN BROWSER_STORAGE *Storage,\r |
816a7110 ED |
667 | IN CHAR16 *Name,\r |
668 | IN OUT CHAR16 **Value,\r | |
669 | IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r | |
2573712e LG |
670 | );\r |
671 | \r | |
672 | /**\r | |
673 | Set Value of given Name in a NameValue Storage.\r | |
674 | \r | |
675 | @param Storage The NameValue Storage.\r | |
676 | @param Name The Name.\r | |
677 | @param Value The Value to set.\r | |
816a7110 | 678 | @param SetValueTo Whether update editValue or Value.\r |
7c6c064c | 679 | @param ReturnNode The node use the input name.\r |
2573712e LG |
680 | \r |
681 | @retval EFI_SUCCESS Value found for given Name.\r | |
682 | @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r | |
683 | \r | |
684 | **/\r | |
685 | EFI_STATUS\r | |
686 | SetValueByName (\r | |
7c6c064c ED |
687 | IN BROWSER_STORAGE *Storage,\r |
688 | IN CHAR16 *Name,\r | |
689 | IN CHAR16 *Value,\r | |
690 | IN GET_SET_QUESTION_VALUE_WITH SetValueTo,\r | |
691 | OUT NAME_VALUE_NODE **ReturnNode\r | |
692 | );\r | |
693 | \r | |
694 | /**\r | |
695 | Validate whether this question's value has changed.\r | |
696 | \r | |
697 | @param FormSet FormSet data structure.\r | |
698 | @param Form Form data structure.\r | |
699 | @param Question Question to be initialized.\r | |
700 | @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r | |
701 | \r | |
702 | @retval TRUE Question's value has changed.\r | |
703 | @retval FALSE Question's value has not changed\r | |
704 | \r | |
705 | **/\r | |
706 | BOOLEAN\r | |
707 | IsQuestionValueChanged (\r | |
708 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
709 | IN FORM_BROWSER_FORM *Form,\r | |
710 | IN OUT FORM_BROWSER_STATEMENT *Question,\r | |
711 | IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r | |
2573712e LG |
712 | );\r |
713 | \r | |
892eccc8 ED |
714 | /**\r |
715 | Validate the FormSet. If the formset is not validate, remove it from the list.\r | |
716 | \r | |
717 | @param FormSet The input FormSet which need to validate.\r | |
718 | \r | |
719 | @retval TRUE The handle is validate.\r | |
720 | @retval FALSE The handle is invalidate.\r | |
721 | \r | |
722 | **/\r | |
723 | BOOLEAN\r | |
724 | ValidateFormSet (\r | |
725 | FORM_BROWSER_FORMSET *FormSet\r | |
726 | );\r | |
727 | \r | |
728 | /**\r | |
729 | Update the ValueChanged status for questions.\r | |
730 | \r | |
731 | @param FormSet FormSet data structure.\r | |
732 | @param Form Form data structure.\r | |
733 | @param SettingScope Setting Scope for Default action.\r | |
734 | \r | |
735 | **/\r | |
736 | VOID \r | |
737 | UpdateStatementStatus (\r | |
738 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
739 | IN FORM_BROWSER_FORM *Form, \r | |
740 | IN BROWSER_SETTING_SCOPE SettingScope\r | |
741 | );\r | |
742 | \r | |
7936fb6a | 743 | /**\r |
744 | Get Question's current Value.\r | |
745 | \r | |
746 | @param FormSet FormSet data structure.\r | |
747 | @param Form Form data structure.\r | |
748 | @param Question Question to be initialized.\r | |
816a7110 | 749 | @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r |
7936fb6a | 750 | \r |
751 | @retval EFI_SUCCESS The function completed successfully.\r | |
752 | \r | |
753 | **/\r | |
754 | EFI_STATUS\r | |
755 | GetQuestionValue (\r | |
756 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
757 | IN FORM_BROWSER_FORM *Form,\r | |
758 | IN OUT FORM_BROWSER_STATEMENT *Question,\r | |
816a7110 | 759 | IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r |
ed66e1bc | 760 | );\r |
7936fb6a | 761 | \r |
762 | /**\r | |
763 | Save Question Value to edit copy(cached) or Storage(uncached).\r | |
764 | \r | |
765 | @param FormSet FormSet data structure.\r | |
766 | @param Form Form data structure.\r | |
767 | @param Question Pointer to the Question.\r | |
816a7110 | 768 | @param SetValueTo Update the question value to editbuffer , buffer or hii driver.\r |
7936fb6a | 769 | \r |
770 | @retval EFI_SUCCESS The function completed successfully.\r | |
771 | \r | |
772 | **/\r | |
773 | EFI_STATUS\r | |
774 | SetQuestionValue (\r | |
775 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
776 | IN FORM_BROWSER_FORM *Form,\r | |
777 | IN OUT FORM_BROWSER_STATEMENT *Question,\r | |
816a7110 | 778 | IN GET_SET_QUESTION_VALUE_WITH SetValueTo\r |
ed66e1bc | 779 | );\r |
7936fb6a | 780 | \r |
781 | /**\r | |
782 | Perform inconsistent check for a Form.\r | |
783 | \r | |
784 | @param FormSet FormSet data structure.\r | |
785 | @param Form Form data structure.\r | |
786 | @param Question The Question to be validated.\r | |
787 | @param Type Validation type: InConsistent or NoSubmit\r | |
788 | \r | |
789 | @retval EFI_SUCCESS Form validation pass.\r | |
790 | @retval other Form validation failed.\r | |
791 | \r | |
792 | **/\r | |
793 | EFI_STATUS\r | |
794 | ValidateQuestion (\r | |
795 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
796 | IN FORM_BROWSER_FORM *Form,\r | |
797 | IN FORM_BROWSER_STATEMENT *Question,\r | |
798 | IN UINTN Type\r | |
ed66e1bc | 799 | );\r |
7936fb6a | 800 | \r |
48a9d5f7 | 801 | \r |
7936fb6a | 802 | /**\r |
48a9d5f7 | 803 | Discard data based on the input setting scope (Form, FormSet or System).\r |
7936fb6a | 804 | \r |
805 | @param FormSet FormSet data structure.\r | |
806 | @param Form Form data structure.\r | |
48a9d5f7 | 807 | @param SettingScope Setting Scope for Discard action.\r |
b18e7050 ED |
808 | \r |
809 | @retval EFI_SUCCESS The function completed successfully.\r | |
48a9d5f7 | 810 | @retval EFI_UNSUPPORTED Unsupport SettingScope.\r |
b18e7050 ED |
811 | \r |
812 | **/\r | |
813 | EFI_STATUS\r | |
814 | DiscardForm (\r | |
815 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
816 | IN FORM_BROWSER_FORM *Form,\r | |
48a9d5f7 | 817 | IN BROWSER_SETTING_SCOPE SettingScope\r |
b18e7050 ED |
818 | );\r |
819 | \r | |
820 | /**\r | |
48a9d5f7 | 821 | Submit data based on the input Setting level (Form, FormSet or System).\r |
b18e7050 ED |
822 | \r |
823 | @param FormSet FormSet data structure.\r | |
824 | @param Form Form data structure.\r | |
48a9d5f7 | 825 | @param SettingScope Setting Scope for Submit action.\r |
7936fb6a | 826 | \r |
827 | @retval EFI_SUCCESS The function completed successfully.\r | |
48a9d5f7 | 828 | @retval EFI_UNSUPPORTED Unsupport SettingScope.\r |
7936fb6a | 829 | \r |
830 | **/\r | |
831 | EFI_STATUS\r | |
832 | SubmitForm (\r | |
833 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
b18e7050 | 834 | IN FORM_BROWSER_FORM *Form,\r |
48a9d5f7 | 835 | IN BROWSER_SETTING_SCOPE SettingScope\r |
ed66e1bc | 836 | );\r |
7936fb6a | 837 | \r |
838 | /**\r | |
839 | Reset Question to its default value.\r | |
840 | \r | |
841 | @param FormSet The form set.\r | |
842 | @param Form The form.\r | |
843 | @param Question The question.\r | |
844 | @param DefaultId The Class of the default.\r | |
845 | \r | |
846 | @retval EFI_SUCCESS Question is reset to default value.\r | |
847 | \r | |
848 | **/\r | |
849 | EFI_STATUS\r | |
850 | GetQuestionDefault (\r | |
851 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
852 | IN FORM_BROWSER_FORM *Form,\r | |
853 | IN FORM_BROWSER_STATEMENT *Question,\r | |
854 | IN UINT16 DefaultId\r | |
ed66e1bc | 855 | );\r |
7936fb6a | 856 | \r |
857 | /**\r | |
858 | Get current setting of Questions.\r | |
859 | \r | |
860 | @param FormSet FormSet data structure.\r | |
861 | \r | |
7936fb6a | 862 | **/\r |
7c6c064c | 863 | VOID\r |
7936fb6a | 864 | InitializeCurrentSetting (\r |
865 | IN OUT FORM_BROWSER_FORMSET *FormSet\r | |
ed66e1bc | 866 | );\r |
7936fb6a | 867 | \r |
868 | /**\r | |
869 | Initialize the internal data structure of a FormSet.\r | |
870 | \r | |
871 | @param Handle PackageList Handle\r | |
872 | @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r | |
873 | GUID), take the first FormSet found in package\r | |
874 | list.\r | |
875 | @param FormSet FormSet data structure.\r | |
876 | \r | |
877 | @retval EFI_SUCCESS The function completed successfully.\r | |
878 | @retval EFI_NOT_FOUND The specified FormSet could not be found.\r | |
879 | \r | |
880 | **/\r | |
881 | EFI_STATUS\r | |
882 | InitializeFormSet (\r | |
883 | IN EFI_HII_HANDLE Handle,\r | |
884 | IN OUT EFI_GUID *FormSetGuid,\r | |
7c6c064c | 885 | OUT FORM_BROWSER_FORMSET *FormSet \r |
ed66e1bc | 886 | );\r |
7936fb6a | 887 | \r |
888 | /**\r | |
9776099f | 889 | Reset Questions to their initial value or default value in a Form, Formset or System.\r |
7936fb6a | 890 | \r |
09cdd7d2 ED |
891 | GetDefaultValueScope parameter decides which questions will reset \r |
892 | to its default value.\r | |
893 | \r | |
7936fb6a | 894 | @param FormSet FormSet data structure.\r |
48a9d5f7 | 895 | @param Form Form data structure.\r |
7936fb6a | 896 | @param DefaultId The Class of the default.\r |
48a9d5f7 | 897 | @param SettingScope Setting Scope for Default action.\r |
09cdd7d2 | 898 | @param GetDefaultValueScope Get default value scope.\r |
3347d410 | 899 | @param Storage Get default value only for this storage.\r |
9776099f ED |
900 | @param RetrieveValueFirst Whether call the retrieve call back to\r |
901 | get the initial value before get default\r | |
902 | value.\r | |
7936fb6a | 903 | \r |
904 | @retval EFI_SUCCESS The function completed successfully.\r | |
48a9d5f7 | 905 | @retval EFI_UNSUPPORTED Unsupport SettingScope.\r |
7936fb6a | 906 | \r |
907 | **/\r | |
908 | EFI_STATUS\r | |
48a9d5f7 | 909 | ExtractDefault (\r |
7936fb6a | 910 | IN FORM_BROWSER_FORMSET *FormSet,\r |
48a9d5f7 LG |
911 | IN FORM_BROWSER_FORM *Form,\r |
912 | IN UINT16 DefaultId,\r | |
3347d410 | 913 | IN BROWSER_SETTING_SCOPE SettingScope,\r |
09cdd7d2 | 914 | IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope,\r |
94f3aae7 | 915 | IN BROWSER_STORAGE *Storage,\r |
9776099f | 916 | IN BOOLEAN RetrieveValueFirst\r |
ed66e1bc | 917 | );\r |
7936fb6a | 918 | \r |
919 | /**\r | |
920 | Initialize Question's Edit copy from Storage.\r | |
921 | \r | |
eccfeab1 LG |
922 | @param Selection Selection contains the information about \r |
923 | the Selection, form and formset to be displayed.\r | |
924 | Selection action may be updated in retrieve callback.\r | |
7d1b202d | 925 | If Selection is NULL, only initialize Question value.\r |
7936fb6a | 926 | @param FormSet FormSet data structure.\r |
927 | @param Form Form data structure.\r | |
928 | \r | |
929 | @retval EFI_SUCCESS The function completed successfully.\r | |
930 | \r | |
931 | **/\r | |
932 | EFI_STATUS\r | |
933 | LoadFormConfig (\r | |
eccfeab1 LG |
934 | IN OUT UI_MENU_SELECTION *Selection,\r |
935 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
936 | IN FORM_BROWSER_FORM *Form\r | |
ed66e1bc | 937 | );\r |
7936fb6a | 938 | \r |
d66e6c16 | 939 | /**\r |
940 | Initialize Question's Edit copy from Storage for the whole Formset.\r | |
941 | \r | |
eccfeab1 LG |
942 | @param Selection Selection contains the information about \r |
943 | the Selection, form and formset to be displayed.\r | |
944 | Selection action may be updated in retrieve callback.\r | |
7d1b202d | 945 | If Selection is NULL, only initialize Question value.\r |
d66e6c16 | 946 | @param FormSet FormSet data structure.\r |
947 | \r | |
948 | @retval EFI_SUCCESS The function completed successfully.\r | |
949 | \r | |
950 | **/\r | |
951 | EFI_STATUS\r | |
952 | LoadFormSetConfig (\r | |
eccfeab1 LG |
953 | IN OUT UI_MENU_SELECTION *Selection,\r |
954 | IN FORM_BROWSER_FORMSET *FormSet\r | |
d66e6c16 | 955 | );\r |
956 | \r | |
7936fb6a | 957 | /**\r |
958 | Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.\r | |
959 | \r | |
94f3aae7 | 960 | @param Storage The Storage to be conveted.\r |
7936fb6a | 961 | @param ConfigResp The returned <ConfigResp>.\r |
94f3aae7 | 962 | @param ConfigRequest The ConfigRequest string.\r |
7c6c064c | 963 | @param GetEditBuf Get the data from editbuffer or buffer.\r |
7936fb6a | 964 | \r |
965 | @retval EFI_SUCCESS Convert success.\r | |
966 | @retval EFI_INVALID_PARAMETER Incorrect storage type.\r | |
967 | \r | |
968 | **/\r | |
969 | EFI_STATUS\r | |
970 | StorageToConfigResp (\r | |
94f3aae7 | 971 | IN BROWSER_STORAGE *Storage,\r |
b18e7050 | 972 | IN CHAR16 **ConfigResp,\r |
7c6c064c ED |
973 | IN CHAR16 *ConfigRequest,\r |
974 | IN BOOLEAN GetEditBuf\r | |
ed66e1bc | 975 | );\r |
7936fb6a | 976 | \r |
977 | /**\r | |
978 | Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.\r | |
979 | \r | |
980 | @param Storage The Storage to receive the settings.\r | |
981 | @param ConfigResp The <ConfigResp> to be converted.\r | |
982 | \r | |
983 | @retval EFI_SUCCESS Convert success.\r | |
984 | @retval EFI_INVALID_PARAMETER Incorrect storage type.\r | |
985 | \r | |
986 | **/\r | |
987 | EFI_STATUS\r | |
988 | ConfigRespToStorage (\r | |
94f3aae7 | 989 | IN BROWSER_STORAGE *Storage,\r |
7936fb6a | 990 | IN CHAR16 *ConfigResp\r |
ed66e1bc | 991 | );\r |
7936fb6a | 992 | \r |
993 | /**\r | |
994 | Fill storage's edit copy with settings requested from Configuration Driver.\r | |
995 | \r | |
996 | @param FormSet FormSet data structure.\r | |
997 | @param Storage Buffer Storage.\r | |
998 | \r | |
7936fb6a | 999 | **/\r |
7c6c064c | 1000 | VOID\r |
7936fb6a | 1001 | LoadStorage (\r |
1002 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
1003 | IN FORMSET_STORAGE *Storage\r | |
ed66e1bc | 1004 | );\r |
7936fb6a | 1005 | \r |
1006 | /**\r | |
1007 | Fetch the Ifr binary data of a FormSet.\r | |
1008 | \r | |
1009 | @param Handle PackageList Handle\r | |
1010 | @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r | |
1011 | GUID), take the first FormSet found in package\r | |
1012 | list.\r | |
1013 | @param BinaryLength The length of the FormSet IFR binary.\r | |
1014 | @param BinaryData The buffer designed to receive the FormSet.\r | |
1015 | \r | |
1016 | @retval EFI_SUCCESS Buffer filled with the requested FormSet.\r | |
1017 | BufferLength was updated.\r | |
1018 | @retval EFI_INVALID_PARAMETER The handle is unknown.\r | |
1019 | @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot\r | |
1020 | be found with the requested FormId.\r | |
1021 | \r | |
1022 | **/\r | |
1023 | EFI_STATUS\r | |
1024 | GetIfrBinaryData (\r | |
1025 | IN EFI_HII_HANDLE Handle,\r | |
1026 | IN OUT EFI_GUID *FormSetGuid,\r | |
1027 | OUT UINTN *BinaryLength,\r | |
1028 | OUT UINT8 **BinaryData\r | |
ed66e1bc | 1029 | );\r |
7936fb6a | 1030 | \r |
ce6d12cc | 1031 | /**\r |
1032 | Save globals used by previous call to SendForm(). SendForm() may be called from \r | |
1033 | HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r | |
1034 | So, save globals of previous call to SendForm() and restore them upon exit.\r | |
1035 | \r | |
1036 | **/\r | |
1037 | VOID\r | |
1038 | SaveBrowserContext (\r | |
1039 | VOID\r | |
1040 | );\r | |
1041 | \r | |
1042 | /**\r | |
1043 | Restore globals used by previous call to SendForm().\r | |
1044 | \r | |
1045 | **/\r | |
1046 | VOID\r | |
1047 | RestoreBrowserContext (\r | |
1048 | VOID\r | |
1049 | );\r | |
1050 | \r | |
7936fb6a | 1051 | /**\r |
1052 | This is the routine which an external caller uses to direct the browser\r | |
1053 | where to obtain it's information.\r | |
1054 | \r | |
1055 | \r | |
1056 | @param This The Form Browser protocol instanse.\r | |
1057 | @param Handles A pointer to an array of Handles. If HandleCount > 1 we\r | |
1058 | display a list of the formsets for the handles specified.\r | |
1059 | @param HandleCount The number of Handles specified in Handle.\r | |
1060 | @param FormSetGuid This field points to the EFI_GUID which must match the Guid\r | |
1061 | field in the EFI_IFR_FORM_SET op-code for the specified\r | |
1062 | forms-based package. If FormSetGuid is NULL, then this\r | |
1063 | function will display the first found forms package.\r | |
1064 | @param FormId This field specifies which EFI_IFR_FORM to render as the first\r | |
1065 | displayable page. If this field has a value of 0x0000, then\r | |
1066 | the forms browser will render the specified forms in their encoded order.\r | |
1067 | ScreenDimenions - This allows the browser to be called so that it occupies a\r | |
1068 | portion of the physical screen instead of dynamically determining the screen dimensions.\r | |
1069 | ActionRequest - Points to the action recommended by the form.\r | |
d66e6c16 | 1070 | @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in\r |
7936fb6a | 1071 | characters.\r |
1072 | @param ActionRequest Points to the action recommended by the form.\r | |
1073 | \r | |
1074 | @retval EFI_SUCCESS The function completed successfully.\r | |
1075 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r | |
1076 | @retval EFI_NOT_FOUND No valid forms could be found to display.\r | |
1077 | \r | |
1078 | **/\r | |
1079 | EFI_STATUS\r | |
1080 | EFIAPI\r | |
1081 | SendForm (\r | |
1082 | IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r | |
1083 | IN EFI_HII_HANDLE *Handles,\r | |
1084 | IN UINTN HandleCount,\r | |
1085 | IN EFI_GUID *FormSetGuid, OPTIONAL\r | |
1086 | IN UINT16 FormId, OPTIONAL\r | |
1087 | IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL\r | |
1088 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL\r | |
ed66e1bc | 1089 | );\r |
7936fb6a | 1090 | \r |
1091 | /**\r | |
1092 | This function is called by a callback handler to retrieve uncommitted state\r | |
1093 | data from the browser.\r | |
1094 | \r | |
1095 | @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r | |
1096 | instance.\r | |
1097 | @param ResultsDataSize A pointer to the size of the buffer associated\r | |
1098 | with ResultsData.\r | |
1099 | @param ResultsData A string returned from an IFR browser or\r | |
1100 | equivalent. The results string will have no\r | |
1101 | routing information in them.\r | |
1102 | @param RetrieveData A BOOLEAN field which allows an agent to retrieve\r | |
1103 | (if RetrieveData = TRUE) data from the uncommitted\r | |
1104 | browser state information or set (if RetrieveData\r | |
1105 | = FALSE) data in the uncommitted browser state\r | |
1106 | information.\r | |
1107 | @param VariableGuid An optional field to indicate the target variable\r | |
1108 | GUID name to use.\r | |
1109 | @param VariableName An optional field to indicate the target\r | |
1110 | human-readable variable name.\r | |
1111 | \r | |
1112 | @retval EFI_SUCCESS The results have been distributed or are awaiting\r | |
1113 | distribution.\r | |
1114 | @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to\r | |
1115 | contain the results data.\r | |
1116 | \r | |
1117 | **/\r | |
1118 | EFI_STATUS\r | |
1119 | EFIAPI\r | |
1120 | BrowserCallback (\r | |
1121 | IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r | |
1122 | IN OUT UINTN *ResultsDataSize,\r | |
1123 | IN OUT EFI_STRING ResultsData,\r | |
1124 | IN BOOLEAN RetrieveData,\r | |
1125 | IN CONST EFI_GUID *VariableGuid, OPTIONAL\r | |
1126 | IN CONST CHAR16 *VariableName OPTIONAL\r | |
ed66e1bc | 1127 | );\r |
7936fb6a | 1128 | \r |
b18e7050 ED |
1129 | /**\r |
1130 | Find menu which will show next time.\r | |
1131 | \r | |
1132 | @param Selection On input, Selection tell setup browser the information\r | |
1133 | about the Selection, form and formset to be displayed.\r | |
1134 | On output, Selection return the screen item that is selected\r | |
1135 | by user.\r | |
7c6c064c ED |
1136 | @param SettingLevel Input Settting level, if it is FormLevel, just exit current form. \r |
1137 | else, we need to exit current formset.\r | |
b18e7050 | 1138 | \r |
7c6c064c ED |
1139 | @retval TRUE Exit current form.\r |
1140 | @retval FALSE User press ESC and keep in current form.\r | |
b18e7050 ED |
1141 | **/\r |
1142 | BOOLEAN\r | |
1143 | FindNextMenu (\r | |
7c6c064c ED |
1144 | IN OUT UI_MENU_SELECTION *Selection,\r |
1145 | IN BROWSER_SETTING_SCOPE SettingLevel\r | |
b18e7050 ED |
1146 | );\r |
1147 | \r | |
1148 | /**\r | |
7c6c064c | 1149 | check whether the form need to update the NV.\r |
b18e7050 | 1150 | \r |
7c6c064c | 1151 | @param Form Form data structure.\r |
b18e7050 | 1152 | \r |
7c6c064c ED |
1153 | @retval TRUE Need to update the NV.\r |
1154 | @retval FALSE No need to update the NV.\r | |
b18e7050 | 1155 | **/\r |
7c6c064c ED |
1156 | BOOLEAN\r |
1157 | IsNvUpdateRequiredForForm (\r | |
1158 | IN FORM_BROWSER_FORM *Form\r | |
b18e7050 ED |
1159 | );\r |
1160 | \r | |
1161 | /**\r | |
1162 | check whether the formset need to update the NV.\r | |
1163 | \r | |
1164 | @param FormSet FormSet data structure.\r | |
1165 | \r | |
1166 | @retval TRUE Need to update the NV.\r | |
1167 | @retval FALSE No need to update the NV.\r | |
1168 | **/\r | |
7c6c064c ED |
1169 | BOOLEAN\r |
1170 | IsNvUpdateRequiredForFormSet (\r | |
25361615 | 1171 | IN FORM_BROWSER_FORMSET *FormSet\r |
b9feb4bd ED |
1172 | );\r |
1173 | \r | |
b18e7050 ED |
1174 | /**\r |
1175 | Call the call back function for the question and process the return action.\r | |
1176 | \r | |
1177 | @param Selection On input, Selection tell setup browser the information\r | |
1178 | about the Selection, form and formset to be displayed.\r | |
1179 | On output, Selection return the screen item that is selected\r | |
1180 | by user.\r | |
798e4d22 ED |
1181 | @param FormSet The formset this question belong to.\r |
1182 | @param Form The form this question belong to.\r | |
1183 | @param Question The Question which need to call.\r | |
b18e7050 ED |
1184 | @param Action The action request.\r |
1185 | @param SkipSaveOrDiscard Whether skip save or discard action.\r | |
1186 | \r | |
1187 | @retval EFI_SUCCESS The call back function excutes successfully.\r | |
1188 | @return Other value if the call back function failed to excute. \r | |
1189 | **/\r | |
1190 | EFI_STATUS \r | |
1191 | ProcessCallBackFunction (\r | |
1192 | IN OUT UI_MENU_SELECTION *Selection,\r | |
798e4d22 ED |
1193 | IN FORM_BROWSER_FORMSET *FormSet,\r |
1194 | IN FORM_BROWSER_FORM *Form,\r | |
b18e7050 ED |
1195 | IN FORM_BROWSER_STATEMENT *Question,\r |
1196 | IN EFI_BROWSER_ACTION Action,\r | |
1197 | IN BOOLEAN SkipSaveOrDiscard\r | |
1198 | );\r | |
9776099f ED |
1199 | \r |
1200 | /**\r | |
1201 | Call the retrieve type call back function for one question to get the initialize data.\r | |
1202 | \r | |
1203 | This function only used when in the initialize stage, because in this stage, the \r | |
1204 | Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.\r | |
1205 | \r | |
1206 | @param ConfigAccess The config access protocol produced by the hii driver.\r | |
1207 | @param Statement The Question which need to call.\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 | );\r | |
48a9d5f7 LG |
1217 | \r |
1218 | /**\r | |
1219 | Find the matched FormSet context in the backup maintain list based on HiiHandle.\r | |
1220 | \r | |
1221 | @param Handle The Hii Handle.\r | |
1222 | \r | |
1223 | @return the found FormSet context. If no found, NULL will return.\r | |
1224 | \r | |
1225 | **/\r | |
1226 | FORM_BROWSER_FORMSET * \r | |
1227 | GetFormSetFromHiiHandle (\r | |
1228 | EFI_HII_HANDLE Handle\r | |
1229 | );\r | |
1230 | \r | |
1231 | /**\r | |
1232 | Check whether the input HII handle is the FormSet that is being used.\r | |
1233 | \r | |
1234 | @param Handle The Hii Handle.\r | |
1235 | \r | |
1236 | @retval TRUE HII handle is being used.\r | |
1237 | @retval FALSE HII handle is not being used.\r | |
1238 | \r | |
1239 | **/\r | |
1240 | BOOLEAN\r | |
1241 | IsHiiHandleInBrowserContext (\r | |
1242 | EFI_HII_HANDLE Handle\r | |
1243 | );\r | |
1244 | \r | |
1245 | /**\r | |
1246 | Configure what scope the hot key will impact.\r | |
1247 | All hot keys have the same scope. The mixed hot keys with the different level are not supported.\r | |
1248 | If no scope is set, the default scope will be FormSet level.\r | |
1249 | After all registered hot keys are removed, previous Scope can reset to another level.\r | |
1250 | \r | |
1251 | @param[in] Scope Scope level to be set. \r | |
1252 | \r | |
1253 | @retval EFI_SUCCESS Scope is set correctly.\r | |
1254 | @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE. \r | |
1255 | @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.\r | |
1256 | \r | |
1257 | **/\r | |
1258 | EFI_STATUS\r | |
1259 | EFIAPI\r | |
1260 | SetScope (\r | |
1261 | IN BROWSER_SETTING_SCOPE Scope\r | |
1262 | );\r | |
1263 | \r | |
1264 | /**\r | |
1265 | Register the hot key with its browser action, or unregistered the hot key.\r | |
1266 | Only support hot key that is not printable character (control key, function key, etc.).\r | |
1267 | If the action value is zero, the hot key will be unregistered if it has been registered.\r | |
1268 | If the same hot key has been registered, the new action and help string will override the previous ones.\r | |
1269 | \r | |
1270 | @param[in] KeyData A pointer to a buffer that describes the keystroke\r | |
1271 | information for the hot key. Its type is EFI_INPUT_KEY to \r | |
1272 | be supported by all ConsoleIn devices.\r | |
1273 | @param[in] Action Action value that describes what action will be trigged when the hot key is pressed. \r | |
1274 | @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.\r | |
1275 | @param[in] HelpString Help string that describes the hot key information.\r | |
1276 | Its value may be NULL for the unregistered hot key.\r | |
1277 | \r | |
1278 | @retval EFI_SUCCESS Hot key is registered or unregistered.\r | |
1279 | @retval EFI_INVALID_PARAMETER KeyData is NULL.\r | |
1280 | @retval EFI_NOT_FOUND KeyData is not found to be unregistered.\r | |
1281 | @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.\r | |
1282 | **/\r | |
1283 | EFI_STATUS\r | |
1284 | EFIAPI\r | |
1285 | RegisterHotKey (\r | |
1286 | IN EFI_INPUT_KEY *KeyData,\r | |
1287 | IN UINT32 Action,\r | |
1288 | IN UINT16 DefaultId,\r | |
1289 | IN EFI_STRING HelpString OPTIONAL\r | |
1290 | );\r | |
1291 | \r | |
1292 | /**\r | |
1293 | Register Exit handler function. \r | |
1294 | When more than one handler function is registered, the latter one will override the previous one. \r | |
1295 | When NULL handler is specified, the previous Exit handler will be unregistered. \r | |
1296 | \r | |
1297 | @param[in] Handler Pointer to handler function. \r | |
1298 | \r | |
1299 | **/\r | |
1300 | VOID\r | |
1301 | EFIAPI\r | |
1302 | RegiserExitHandler (\r | |
1303 | IN EXIT_HANDLER Handler\r | |
1304 | );\r | |
1305 | \r | |
7c6c064c ED |
1306 | /**\r |
1307 | \r | |
1308 | Check whether the browser data has been modified. \r | |
1309 | \r | |
1310 | @retval TRUE Browser data is changed.\r | |
1311 | @retval FALSE No browser data is changed.\r | |
1312 | \r | |
1313 | **/\r | |
1314 | BOOLEAN \r | |
1315 | EFIAPI\r | |
1316 | IsBrowserDataModified (\r | |
1317 | VOID\r | |
1318 | );\r | |
1319 | \r | |
1320 | /**\r | |
1321 | \r | |
1322 | Execute the action requested by the Action parameter. \r | |
1323 | \r | |
1324 | @param[in] Action Execute the request action.\r | |
1325 | @param[in] DefaultId The default Id info when need to load default value.\r | |
1326 | \r | |
1327 | @retval EFI_SUCCESS Execute the request action succss.\r | |
1328 | @retval EFI_INVALID_PARAMETER The input action value is invalid.\r | |
1329 | \r | |
1330 | **/\r | |
1331 | EFI_STATUS \r | |
1332 | EFIAPI\r | |
1333 | ExecuteAction (\r | |
1334 | IN UINT32 Action,\r | |
1335 | IN UINT16 DefaultId\r | |
1336 | );\r | |
1337 | \r | |
48a9d5f7 LG |
1338 | /**\r |
1339 | Create reminder to let user to choose save or discard the changed browser data.\r | |
1340 | Caller can use it to actively check the changed browser data.\r | |
1341 | \r | |
1342 | @retval BROWSER_NO_CHANGES No browser data is changed.\r | |
1343 | @retval BROWSER_SAVE_CHANGES The changed browser data is saved.\r | |
1344 | @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.\r | |
27bace9b | 1345 | @retval BROWSER_KEEP_CURRENT Browser keep current changes.\r |
48a9d5f7 LG |
1346 | \r |
1347 | **/\r | |
1348 | UINT32\r | |
1349 | EFIAPI\r | |
1350 | SaveReminder (\r | |
1351 | VOID\r | |
1352 | );\r | |
1353 | \r | |
1354 | /**\r | |
1355 | Find the registered HotKey based on KeyData.\r | |
1356 | \r | |
1357 | @param[in] KeyData A pointer to a buffer that describes the keystroke\r | |
1358 | information for the hot key.\r | |
1359 | \r | |
1360 | @return The registered HotKey context. If no found, NULL will return.\r | |
1361 | **/\r | |
1362 | BROWSER_HOT_KEY *\r | |
1363 | GetHotKeyFromRegisterList (\r | |
1364 | IN EFI_INPUT_KEY *KeyData\r | |
1365 | );\r | |
1366 | \r | |
7c6c064c ED |
1367 | /**\r |
1368 | \r | |
1369 | Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r | |
1370 | \r | |
1371 | @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r | |
1372 | \r | |
1373 | @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r | |
1374 | \r | |
1375 | **/\r | |
1376 | FORM_BROWSER_STATEMENT *\r | |
1377 | GetBrowserStatement (\r | |
1378 | IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r | |
1379 | );\r | |
1380 | \r | |
1381 | /**\r | |
1382 | Password may be stored as encrypted by Configuration Driver. When change a\r | |
1383 | password, user will be challenged with old password. To validate user input old\r | |
1384 | password, we will send the clear text to Configuration Driver via Callback().\r | |
1385 | Configuration driver is responsible to check the passed in password and return\r | |
1386 | the validation result. If validation pass, state machine in password Callback()\r | |
1387 | will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.\r | |
1388 | After user type in new password twice, Callback() will be invoked to send the\r | |
1389 | new password to Configuration Driver.\r | |
1390 | \r | |
1391 | @param Selection Pointer to UI_MENU_SELECTION.\r | |
1392 | @param MenuOption The MenuOption for this password Question.\r | |
1393 | @param String The clear text of password.\r | |
1394 | \r | |
1395 | @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.\r | |
1396 | @return In state of BROWSER_STATE_VALIDATE_PASSWORD:\r | |
1397 | @retval EFI_SUCCESS Password correct, Browser will prompt for new\r | |
1398 | password.\r | |
1399 | @retval EFI_NOT_READY Password incorrect, Browser will show error\r | |
1400 | message.\r | |
1401 | @retval Other Browser will do nothing.\r | |
1402 | @return In state of BROWSER_STATE_SET_PASSWORD:\r | |
1403 | @retval EFI_SUCCESS Set password success.\r | |
1404 | @retval Other Set password failed.\r | |
1405 | \r | |
1406 | **/\r | |
1407 | EFI_STATUS\r | |
1408 | PasswordCallback (\r | |
1409 | IN UI_MENU_SELECTION *Selection,\r | |
1410 | IN FORM_BROWSER_STATEMENT *Question,\r | |
1411 | IN CHAR16 *String\r | |
1412 | );\r | |
1413 | \r | |
1414 | /**\r | |
1415 | Display error message for invalid password.\r | |
1416 | \r | |
1417 | **/\r | |
1418 | VOID\r | |
1419 | PasswordInvalid (\r | |
1420 | VOID\r | |
1421 | );\r | |
1422 | \r | |
1423 | /**\r | |
1424 | The worker function that send the displays to the screen. On output,\r | |
1425 | the selection made by user is returned.\r | |
1426 | \r | |
1427 | @param Selection On input, Selection tell setup browser the information\r | |
1428 | about the Selection, form and formset to be displayed.\r | |
1429 | On output, Selection return the screen item that is selected\r | |
1430 | by user.\r | |
1431 | \r | |
1432 | @retval EFI_SUCCESS The page is displayed successfully.\r | |
1433 | @return Other value if the page failed to be diplayed.\r | |
1434 | \r | |
1435 | **/\r | |
1436 | EFI_STATUS\r | |
1437 | SetupBrowser (\r | |
1438 | IN OUT UI_MENU_SELECTION *Selection\r | |
1439 | );\r | |
1440 | \r | |
1441 | /**\r | |
1442 | Free up the resource allocated for all strings required\r | |
1443 | by Setup Browser.\r | |
1444 | \r | |
1445 | **/\r | |
1446 | VOID\r | |
1447 | FreeBrowserStrings (\r | |
1448 | VOID\r | |
1449 | );\r | |
1450 | \r | |
1451 | /**\r | |
1452 | Create a menu with specified formset GUID and form ID, and add it as a child\r | |
1453 | of the given parent menu.\r | |
1454 | \r | |
1455 | @param HiiHandle Hii handle related to this formset.\r | |
1456 | @param FormSetGuid The Formset Guid of menu to be added.\r | |
1457 | @param FormId The Form ID of menu to be added.\r | |
1458 | @param QuestionId The question id of this menu to be added.\r | |
1459 | \r | |
1460 | @return A pointer to the newly added menu or NULL if memory is insufficient.\r | |
1461 | \r | |
1462 | **/\r | |
1463 | FORM_ENTRY_INFO *\r | |
1464 | UiAddMenuList (\r | |
1465 | IN EFI_HII_HANDLE HiiHandle,\r | |
1466 | IN EFI_GUID *FormSetGuid,\r | |
1467 | IN UINT16 FormId,\r | |
1468 | IN UINT16 QuestionId\r | |
1469 | );\r | |
1470 | \r | |
1471 | /**\r | |
1472 | Search Menu with given FormSetGuid and FormId in all cached menu list.\r | |
1473 | \r | |
1474 | @param HiiHandle HiiHandle for FormSet.\r | |
1475 | @param FormSetGuid The Formset GUID of the menu to search.\r | |
1476 | @param FormId The Form ID of menu to search.\r | |
1477 | \r | |
1478 | @return A pointer to menu found or NULL if not found.\r | |
1479 | \r | |
1480 | **/\r | |
1481 | FORM_ENTRY_INFO *\r | |
1482 | UiFindMenuList (\r | |
1483 | IN EFI_HII_HANDLE HiiHandle, \r | |
1484 | IN EFI_GUID *FormSetGuid,\r | |
1485 | IN UINT16 FormId\r | |
1486 | );\r | |
1487 | \r | |
1488 | /**\r | |
1489 | Free Menu list linked list.\r | |
1490 | \r | |
1491 | @param MenuListHead One Menu list point in the menu list.\r | |
1492 | \r | |
1493 | **/\r | |
1494 | VOID\r | |
1495 | UiFreeMenuList (\r | |
1496 | LIST_ENTRY *MenuListHead\r | |
1497 | );\r | |
1498 | \r | |
1499 | /**\r | |
1500 | Find parent menu for current menu.\r | |
1501 | \r | |
1502 | @param CurrentMenu Current Menu\r | |
1503 | \r | |
1504 | @retval The parent menu for current menu.\r | |
1505 | **/\r | |
1506 | FORM_ENTRY_INFO *\r | |
1507 | UiFindParentMenu (\r | |
1508 | IN FORM_ENTRY_INFO *CurrentMenu\r | |
1509 | );\r | |
1510 | \r | |
1511 | /**\r | |
1512 | Search an Option of a Question by its value.\r | |
1513 | \r | |
1514 | @param Question The Question\r | |
1515 | @param OptionValue Value for Option to be searched.\r | |
1516 | \r | |
1517 | @retval Pointer Pointer to the found Option.\r | |
1518 | @retval NULL Option not found.\r | |
1519 | \r | |
1520 | **/\r | |
1521 | QUESTION_OPTION *\r | |
1522 | ValueToOption (\r | |
1523 | IN FORM_BROWSER_STATEMENT *Question,\r | |
1524 | IN EFI_HII_VALUE *OptionValue\r | |
1525 | );\r | |
1526 | /**\r | |
1527 | Return data element in an Array by its Index.\r | |
1528 | \r | |
1529 | @param Array The data array.\r | |
1530 | @param Type Type of the data in this array.\r | |
1531 | @param Index Zero based index for data in this array.\r | |
1532 | \r | |
1533 | @retval Value The data to be returned\r | |
1534 | \r | |
1535 | **/\r | |
1536 | UINT64\r | |
1537 | GetArrayData (\r | |
1538 | IN VOID *Array,\r | |
1539 | IN UINT8 Type,\r | |
1540 | IN UINTN Index\r | |
1541 | );\r | |
1542 | \r | |
1543 | /**\r | |
1544 | Set value of a data element in an Array by its Index.\r | |
1545 | \r | |
1546 | @param Array The data array.\r | |
1547 | @param Type Type of the data in this array.\r | |
1548 | @param Index Zero based index for data in this array.\r | |
1549 | @param Value The value to be set.\r | |
1550 | \r | |
1551 | **/\r | |
1552 | VOID\r | |
1553 | SetArrayData (\r | |
1554 | IN VOID *Array,\r | |
1555 | IN UINT8 Type,\r | |
1556 | IN UINTN Index,\r | |
1557 | IN UINT64 Value\r | |
1558 | );\r | |
1559 | \r | |
1560 | /**\r | |
1561 | Compare two Hii value.\r | |
1562 | \r | |
1563 | @param Value1 Expression value to compare on left-hand.\r | |
1564 | @param Value2 Expression value to compare on right-hand.\r | |
1565 | @param Result Return value after compare.\r | |
1566 | retval 0 Two operators equal.\r | |
1567 | return Positive value if Value1 is greater than Value2.\r | |
1568 | retval Negative value if Value1 is less than Value2.\r | |
1569 | @param HiiHandle Only required for string compare.\r | |
1570 | \r | |
1571 | @retval other Could not perform compare on two values.\r | |
1572 | @retval EFI_SUCCESS Compare the value success.\r | |
1573 | \r | |
1574 | **/\r | |
1575 | EFI_STATUS\r | |
1576 | CompareHiiValue (\r | |
1577 | IN EFI_HII_VALUE *Value1,\r | |
1578 | IN EFI_HII_VALUE *Value2,\r | |
1579 | OUT INTN *Result,\r | |
1580 | IN EFI_HII_HANDLE HiiHandle OPTIONAL\r | |
1581 | );\r | |
1582 | \r | |
1583 | /**\r | |
1584 | Perform Password check. \r | |
1585 | Passwork may be encrypted by driver that requires the specific check.\r | |
1586 | \r | |
1587 | @param Form Form where Password Statement is in.\r | |
1588 | @param Statement Password statement\r | |
1589 | @param PasswordString Password string to be checked. It may be NULL.\r | |
1590 | NULL means to restore password.\r | |
1591 | "" string can be used to checked whether old password does exist.\r | |
1592 | \r | |
1593 | @return Status Status of Password check.\r | |
1594 | **/\r | |
1595 | EFI_STATUS\r | |
1596 | EFIAPI\r | |
1597 | PasswordCheck (\r | |
1598 | IN FORM_DISPLAY_ENGINE_FORM *Form,\r | |
1599 | IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,\r | |
1600 | IN EFI_STRING PasswordString OPTIONAL\r | |
1601 | );\r | |
1602 | \r | |
1603 | /**\r | |
1604 | \r | |
1605 | Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r | |
1606 | \r | |
1607 | @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r | |
1608 | \r | |
1609 | @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r | |
1610 | \r | |
1611 | **/\r | |
1612 | FORM_BROWSER_STATEMENT *\r | |
1613 | GetBrowserStatement (\r | |
1614 | IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r | |
1615 | );\r | |
1616 | \r | |
1617 | /**\r | |
1618 | \r | |
1619 | Initialize the Display form structure data.\r | |
1620 | \r | |
1621 | **/\r | |
1622 | VOID\r | |
1623 | InitializeDisplayFormData (\r | |
1624 | VOID\r | |
1625 | );\r | |
1626 | \r | |
1627 | \r | |
0a6f8af5 ED |
1628 | /**\r |
1629 | Base on the current formset info, clean the ConfigRequest string in browser storage.\r | |
1630 | \r | |
1631 | @param FormSet Pointer of the FormSet\r | |
1632 | \r | |
1633 | **/\r | |
1634 | VOID\r | |
1635 | CleanBrowserStorage (\r | |
1636 | IN OUT FORM_BROWSER_FORMSET *FormSet\r | |
1637 | );\r | |
07d7dbae ED |
1638 | \r |
1639 | /**\r | |
1640 | Find HII Handle in the HII database associated with given Device Path.\r | |
1641 | \r | |
1642 | If DevicePath is NULL, then ASSERT.\r | |
1643 | \r | |
1644 | @param DevicePath Device Path associated with the HII package list\r | |
1645 | handle.\r | |
1646 | @param FormsetGuid The formset guid for this formset.\r | |
1647 | \r | |
1648 | @retval Handle HII package list Handle associated with the Device\r | |
1649 | Path.\r | |
1650 | @retval NULL Hii Package list handle is not found.\r | |
1651 | \r | |
1652 | **/\r | |
1653 | EFI_HII_HANDLE\r | |
1654 | DevicePathToHiiHandle (\r | |
1655 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
1656 | IN EFI_GUID *FormsetGuid\r | |
1657 | );\r | |
1658 | \r | |
9d34cac8 ED |
1659 | /**\r |
1660 | Adjust the config request info, remove the request elements which already in AllConfigRequest string.\r | |
1661 | \r | |
1662 | @param Storage Form set Storage.\r | |
1663 | @param Request The input request string.\r | |
1664 | @param RespString Whether the input is ConfigRequest or ConfigResp format.\r | |
1665 | \r | |
1666 | @retval TRUE Has element not covered by current used elements, need to continue to call ExtractConfig\r | |
1667 | @retval FALSE All elements covered by current used elements.\r | |
1668 | \r | |
1669 | **/\r | |
1670 | BOOLEAN \r | |
1671 | ConfigRequestAdjust (\r | |
1672 | IN BROWSER_STORAGE *Storage,\r | |
1673 | IN CHAR16 *Request,\r | |
1674 | IN BOOLEAN RespString\r | |
1675 | );\r | |
1676 | \r | |
7936fb6a | 1677 | #endif\r |