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