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