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