]>
Commit | Line | Data |
---|---|---|
7936fb6a | 1 | /** @file\r |
d66e6c16 | 2 | Private MACRO, structure and function definitions for Setup Browser module.\r |
7936fb6a | 3 | \r |
0269d14b | 4 | Copyright (c) 2007 - 2011, 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 | |
25 | #include <Protocol/DevicePath.h>\r | |
26 | #include <Protocol/UnicodeCollation.h>\r | |
27 | #include <Protocol/HiiConfigAccess.h>\r | |
28 | #include <Protocol/HiiConfigRouting.h>\r | |
29 | #include <Protocol/HiiDatabase.h>\r | |
30 | #include <Protocol/HiiString.h>\r | |
cbf73e50 | 31 | #include <Protocol/UserManager.h>\r |
7936fb6a | 32 | \r |
5c526736 | 33 | #include <Guid/MdeModuleHii.h>\r |
0a1147ed | 34 | #include <Guid/HiiPlatformSetupFormset.h>\r |
2573712e | 35 | #include <Guid/HiiFormMapMethodGuid.h>\r |
7936fb6a | 36 | \r |
7936fb6a | 37 | #include <Library/PrintLib.h>\r |
38 | #include <Library/DebugLib.h>\r | |
39 | #include <Library/BaseMemoryLib.h>\r | |
40 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
41 | #include <Library/UefiDriverEntryPoint.h>\r | |
42 | #include <Library/UefiBootServicesTableLib.h>\r | |
43 | #include <Library/BaseLib.h>\r | |
44 | #include <Library/MemoryAllocationLib.h>\r | |
7936fb6a | 45 | #include <Library/HiiLib.h>\r |
f511d656 | 46 | #include <Library/PcdLib.h>\r |
cb7d01c0 | 47 | #include <Library/DevicePathLib.h>\r |
7936fb6a | 48 | \r |
49 | #include "Colors.h"\r | |
50 | \r | |
51 | //\r | |
52 | // This is the generated header file which includes whatever needs to be exported (strings + IFR)\r | |
53 | //\r | |
54 | \r | |
55 | extern UINT8 SetupBrowserStrings[];\r | |
56 | \r | |
57 | //\r | |
58 | // Screen definitions\r | |
59 | //\r | |
60 | #define BANNER_HEIGHT 6\r | |
61 | #define BANNER_COLUMNS 3\r | |
c3161b25 | 62 | #define BANNER_LEFT_COLUMN_INDENT 1\r |
7936fb6a | 63 | \r |
64 | #define FRONT_PAGE_HEADER_HEIGHT 6\r | |
65 | #define NONE_FRONT_PAGE_HEADER_HEIGHT 3\r | |
b6ca1fd8 | 66 | #define LEFT_SKIPPED_COLUMNS 3\r |
7936fb6a | 67 | #define FOOTER_HEIGHT 4\r |
68 | #define STATUS_BAR_HEIGHT 1\r | |
69 | #define SCROLL_ARROW_HEIGHT 1\r | |
70 | #define POPUP_PAD_SPACE_COUNT 5\r | |
71 | #define POPUP_FRAME_WIDTH 2\r | |
72 | \r | |
73 | //\r | |
74 | // Definition for function key setting\r | |
75 | //\r | |
76 | #define NONE_FUNCTION_KEY_SETTING 0\r | |
8b0fc5c1 | 77 | #define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_NINE | FUNCTION_TEN)\r |
7936fb6a | 78 | \r |
7936fb6a | 79 | #define FUNCTION_NINE (1 << 2)\r |
80 | #define FUNCTION_TEN (1 << 3)\r | |
81 | \r | |
82 | typedef struct {\r | |
83 | EFI_GUID FormSetGuid;\r | |
84 | UINTN KeySetting;\r | |
85 | } FUNCTIION_KEY_SETTING;\r | |
86 | \r | |
87 | //\r | |
88 | // Character definitions\r | |
89 | //\r | |
90 | #define CHAR_SPACE 0x0020\r | |
91 | #define UPPER_LOWER_CASE_OFFSET 0x20\r | |
92 | \r | |
93 | //\r | |
94 | // Time definitions\r | |
95 | //\r | |
96 | #define ONE_SECOND 10000000\r | |
97 | \r | |
98 | //\r | |
99 | // Display definitions\r | |
100 | //\r | |
101 | #define LEFT_HYPER_DELIMITER L'<'\r | |
102 | #define RIGHT_HYPER_DELIMITER L'>'\r | |
103 | \r | |
104 | #define LEFT_ONEOF_DELIMITER L'<'\r | |
105 | #define RIGHT_ONEOF_DELIMITER L'>'\r | |
106 | \r | |
107 | #define LEFT_NUMERIC_DELIMITER L'['\r | |
108 | #define RIGHT_NUMERIC_DELIMITER L']'\r | |
109 | \r | |
110 | #define LEFT_CHECKBOX_DELIMITER L'['\r | |
111 | #define RIGHT_CHECKBOX_DELIMITER L']'\r | |
112 | \r | |
113 | #define CHECK_ON L'X'\r | |
114 | #define CHECK_OFF L' '\r | |
115 | \r | |
116 | #define TIME_SEPARATOR L':'\r | |
117 | #define DATE_SEPARATOR L'/'\r | |
118 | \r | |
119 | #define YES_ANSWER L'Y'\r | |
120 | #define NO_ANSWER L'N'\r | |
121 | \r | |
122 | //\r | |
123 | // This is the Input Error Message\r | |
124 | //\r | |
125 | #define INPUT_ERROR 1\r | |
126 | \r | |
127 | //\r | |
128 | // This is the NV RAM update required Message\r | |
129 | //\r | |
130 | #define NV_UPDATE_REQUIRED 2\r | |
131 | \r | |
132 | //\r | |
133 | // Refresh the Status Bar with flags\r | |
134 | //\r | |
135 | #define REFRESH_STATUS_BAR 0xff\r | |
136 | \r | |
137 | //\r | |
138 | // Incremental string lenght of ConfigRequest\r | |
139 | //\r | |
140 | #define CONFIG_REQUEST_STRING_INCREMENTAL 1024\r | |
141 | \r | |
142 | //\r | |
143 | // HII value compare result\r | |
144 | //\r | |
145 | #define HII_VALUE_UNDEFINED 0\r | |
146 | #define HII_VALUE_EQUAL 1\r | |
147 | #define HII_VALUE_LESS_THAN 2\r | |
148 | #define HII_VALUE_GREATER_THAN 3\r | |
149 | \r | |
150 | //\r | |
151 | // Incremental size of stack for expression\r | |
152 | //\r | |
153 | #define EXPRESSION_STACK_SIZE_INCREMENT 0x100\r | |
154 | \r | |
0269d14b | 155 | #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 | 156 | \r |
7936fb6a | 157 | \r |
f3f2e05d | 158 | #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')\r |
7936fb6a | 159 | typedef struct {\r |
160 | UINT32 Signature;\r | |
161 | \r | |
162 | EFI_HANDLE Handle;\r | |
163 | \r | |
164 | //\r | |
165 | // Produced protocol\r | |
166 | //\r | |
167 | EFI_FORM_BROWSER2_PROTOCOL FormBrowser2;\r | |
7936fb6a | 168 | \r |
169 | } SETUP_DRIVER_PRIVATE_DATA;\r | |
170 | \r | |
171 | typedef struct {\r | |
172 | EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];\r | |
173 | } BANNER_DATA;\r | |
174 | \r | |
175 | //\r | |
176 | // IFR relative definition\r | |
177 | //\r | |
178 | #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0\r | |
179 | #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1\r | |
180 | #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2\r | |
181 | #define EFI_HII_EXPRESSION_SUPPRESS_IF 3\r | |
182 | #define EFI_HII_EXPRESSION_DISABLE_IF 4\r | |
183 | #define EFI_HII_EXPRESSION_VALUE 5\r | |
184 | #define EFI_HII_EXPRESSION_RULE 6\r | |
2573712e LG |
185 | #define EFI_HII_EXPRESSION_READ 7\r |
186 | #define EFI_HII_EXPRESSION_WRITE 8\r | |
7936fb6a | 187 | \r |
188 | #define EFI_HII_VARSTORE_BUFFER 0\r | |
189 | #define EFI_HII_VARSTORE_NAME_VALUE 1\r | |
190 | #define EFI_HII_VARSTORE_EFI_VARIABLE 2\r | |
191 | \r | |
192 | #define FORM_INCONSISTENT_VALIDATION 0\r | |
193 | #define FORM_NO_SUBMIT_VALIDATION 1\r | |
194 | \r | |
40245175 LG |
195 | #define FORMSET_CLASS_PLATFORM_SETUP 0x0001\r |
196 | #define FORMSET_CLASS_FRONT_PAGE 0x0002\r | |
0a1147ed | 197 | \r |
7936fb6a | 198 | typedef struct {\r |
199 | UINT8 Type;\r | |
200 | EFI_IFR_TYPE_VALUE Value;\r | |
201 | } EFI_HII_VALUE;\r | |
202 | \r | |
f3f2e05d | 203 | #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')\r |
7936fb6a | 204 | \r |
205 | typedef struct {\r | |
206 | UINTN Signature;\r | |
207 | LIST_ENTRY Link;\r | |
208 | CHAR16 *Name;\r | |
209 | CHAR16 *Value;\r | |
210 | CHAR16 *EditValue;\r | |
211 | } NAME_VALUE_NODE;\r | |
212 | \r | |
213 | #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)\r | |
214 | \r | |
f3f2e05d | 215 | #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')\r |
7936fb6a | 216 | \r |
217 | typedef struct {\r | |
218 | UINTN Signature;\r | |
219 | LIST_ENTRY Link;\r | |
220 | \r | |
221 | UINT8 Type; // Storage type\r | |
222 | \r | |
223 | UINT16 VarStoreId;\r | |
224 | EFI_GUID Guid;\r | |
225 | \r | |
226 | CHAR16 *Name; // For EFI_IFR_VARSTORE\r | |
227 | UINT16 Size;\r | |
228 | UINT8 *Buffer;\r | |
229 | UINT8 *EditBuffer; // Edit copy for Buffer Storage\r | |
230 | \r | |
231 | LIST_ENTRY NameValueListHead; // List of NAME_VALUE_NODE\r | |
232 | \r | |
233 | UINT32 Attributes; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute\r | |
234 | \r | |
235 | CHAR16 *ConfigHdr; // <ConfigHdr>\r | |
236 | CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r | |
237 | UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r | |
238 | UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r | |
239 | } FORMSET_STORAGE;\r | |
240 | \r | |
241 | #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)\r | |
242 | \r | |
2573712e LG |
243 | typedef union {\r |
244 | EFI_STRING_ID VarName;\r | |
245 | UINT16 VarOffset;\r | |
246 | } VAR_STORE_INFO;\r | |
247 | \r | |
f3f2e05d | 248 | #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')\r |
7936fb6a | 249 | \r |
250 | typedef struct {\r | |
251 | UINTN Signature;\r | |
252 | LIST_ENTRY Link;\r | |
253 | \r | |
254 | UINT8 Operand;\r | |
255 | \r | |
256 | UINT8 Format; // For EFI_IFR_TO_STRING, EFI_IFR_FIND\r | |
257 | UINT8 Flags; // For EFI_IFR_SPAN\r | |
258 | UINT8 RuleId; // For EFI_IFR_RULE_REF\r | |
259 | \r | |
260 | 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 | |
261 | \r | |
2654f642 | 262 | EFI_QUESTION_ID QuestionId; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1\r |
7936fb6a | 263 | EFI_QUESTION_ID QuestionId2;\r |
264 | \r | |
2654f642 | 265 | UINT16 ListLength; // For EFI_IFR_EQ_ID_VAL_LIST\r |
7936fb6a | 266 | UINT16 *ValueList;\r |
267 | \r | |
268 | EFI_STRING_ID DevicePath; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3\r | |
269 | EFI_GUID Guid;\r | |
2573712e LG |
270 | \r |
271 | FORMSET_STORAGE *VarStorage; // For EFI_IFR_SET, EFI_IFR_GET\r | |
272 | VAR_STORE_INFO VarStoreInfo;// For EFI_IFR_SET, EFI_IFR_GET\r | |
273 | UINT8 ValueType; // For EFI_IFR_SET, EFI_IFR_GET\r | |
274 | UINT8 ValueWidth; // For EFI_IFR_SET, EFI_IFR_GET\r | |
275 | CHAR16 *ValueName; // For EFI_IFR_SET, EFI_IFR_GET\r | |
276 | LIST_ENTRY MapExpressionList; // nested expressions inside of Map opcode.\r | |
7936fb6a | 277 | } EXPRESSION_OPCODE;\r |
278 | \r | |
279 | #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)\r | |
280 | \r | |
f3f2e05d | 281 | #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')\r |
7936fb6a | 282 | \r |
283 | typedef struct {\r | |
284 | UINTN Signature;\r | |
285 | LIST_ENTRY Link;\r | |
286 | \r | |
287 | UINT8 Type; // Type for this expression\r | |
288 | \r | |
289 | UINT8 RuleId; // For EFI_IFR_RULE only\r | |
290 | EFI_STRING_ID Error; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only\r | |
291 | \r | |
292 | EFI_HII_VALUE Result; // Expression evaluation result\r | |
293 | \r | |
294 | LIST_ENTRY OpCodeListHead; // OpCodes consist of this expression (EXPRESSION_OPCODE)\r | |
295 | } FORM_EXPRESSION;\r | |
296 | \r | |
297 | #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r | |
298 | \r | |
f3f2e05d | 299 | #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')\r |
7936fb6a | 300 | \r |
301 | typedef struct {\r | |
302 | UINTN Signature;\r | |
303 | LIST_ENTRY Link;\r | |
304 | \r | |
305 | UINT16 DefaultId;\r | |
306 | EFI_HII_VALUE Value; // Default value\r | |
307 | \r | |
308 | FORM_EXPRESSION *ValueExpression; // Not-NULL indicates default value is provided by EFI_IFR_VALUE\r | |
309 | } QUESTION_DEFAULT;\r | |
310 | \r | |
311 | #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)\r | |
312 | \r | |
f3f2e05d | 313 | #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')\r |
7936fb6a | 314 | \r |
315 | typedef struct {\r | |
316 | UINTN Signature;\r | |
317 | LIST_ENTRY Link;\r | |
318 | \r | |
319 | EFI_STRING_ID Text;\r | |
320 | UINT8 Flags;\r | |
321 | EFI_HII_VALUE Value;\r | |
322 | EFI_IMAGE_ID ImageId;\r | |
323 | \r | |
324 | FORM_EXPRESSION *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r | |
325 | } QUESTION_OPTION;\r | |
326 | \r | |
327 | #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r | |
328 | \r | |
f3f2e05d | 329 | #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')\r |
1ccdbf2a | 330 | \r |
7936fb6a | 331 | typedef struct {\r |
332 | UINTN Signature;\r | |
333 | LIST_ENTRY Link;\r | |
334 | \r | |
335 | UINT8 Operand; // The operand (first byte) of this Statement or Question\r | |
336 | \r | |
337 | //\r | |
338 | // Statement Header\r | |
339 | //\r | |
340 | EFI_STRING_ID Prompt;\r | |
341 | EFI_STRING_ID Help;\r | |
342 | EFI_STRING_ID TextTwo; // For EFI_IFR_TEXT\r | |
343 | \r | |
344 | //\r | |
345 | // Question Header\r | |
346 | //\r | |
347 | EFI_QUESTION_ID QuestionId; // The value of zero is reserved\r | |
348 | EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage\r | |
349 | FORMSET_STORAGE *Storage;\r | |
1ccdbf2a | 350 | VAR_STORE_INFO VarStoreInfo;\r |
7936fb6a | 351 | UINT16 StorageWidth;\r |
352 | UINT8 QuestionFlags;\r | |
353 | CHAR16 *VariableName; // Name/Value or EFI Variable name\r | |
354 | CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."\r | |
355 | \r | |
356 | EFI_HII_VALUE HiiValue; // Edit copy for checkbox, numberic, oneof\r | |
357 | UINT8 *BufferValue; // Edit copy for string, password, orderedlist\r | |
d02847d3 | 358 | UINT8 ValueType; // Data type for orderedlist value array\r |
7936fb6a | 359 | \r |
360 | //\r | |
361 | // OpCode specific members\r | |
362 | //\r | |
363 | UINT8 Flags; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,\r | |
364 | // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER\r | |
365 | UINT8 MaxContainers; // for EFI_IFR_ORDERED_LIST\r | |
366 | \r | |
367 | UINT16 BannerLineNumber; // for EFI_IFR_BANNER, 1-based line number\r | |
368 | EFI_STRING_ID QuestionConfig; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed\r | |
369 | \r | |
370 | UINT64 Minimum; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value\r | |
371 | UINT64 Maximum; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length\r | |
372 | UINT64 Step;\r | |
373 | \r | |
374 | EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON\r | |
211cc6e5 | 375 | EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID\r |
7936fb6a | 376 | \r |
377 | //\r | |
378 | // Get from IFR parsing\r | |
379 | //\r | |
380 | FORM_EXPRESSION *ValueExpression; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly\r | |
381 | LIST_ENTRY DefaultListHead; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values\r | |
382 | LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r | |
383 | \r | |
384 | EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE\r | |
385 | UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh\r | |
386 | BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE\r | |
387 | \r | |
388 | LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r | |
389 | LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)\r | |
390 | FORM_EXPRESSION *GrayOutExpression; // nesting inside of GrayOutIf\r | |
391 | FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf\r | |
0a1147ed | 392 | FORM_EXPRESSION *DisableExpression; // nesting inside of DisableIf\r |
7936fb6a | 393 | \r |
2573712e LG |
394 | FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.\r |
395 | FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.\r | |
7936fb6a | 396 | } FORM_BROWSER_STATEMENT;\r |
397 | \r | |
398 | #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r | |
399 | \r | |
b18e7050 ED |
400 | #define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')\r |
401 | typedef struct {\r | |
402 | UINTN Signature;\r | |
403 | LIST_ENTRY Link;\r | |
404 | \r | |
405 | CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r | |
406 | UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest> \r | |
407 | UINTN SpareStrLen;\r | |
408 | \r | |
409 | FORMSET_STORAGE *Storage;\r | |
410 | } FORM_BROWSER_CONFIG_REQUEST;\r | |
411 | #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)\r | |
412 | \r | |
f3f2e05d | 413 | #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r |
2573712e | 414 | #define STANDARD_MAP_FORM_TYPE 0x01\r |
7936fb6a | 415 | \r |
416 | typedef struct {\r | |
417 | UINTN Signature;\r | |
418 | LIST_ENTRY Link;\r | |
419 | \r | |
2573712e LG |
420 | UINT16 FormId; // FormId of normal form or formmap form.\r |
421 | EFI_STRING_ID FormTitle; // FormTile of normal form, or FormMapMethod title of formmap form.\r | |
422 | UINT16 FormType; // Specific form type for the different form.\r | |
7936fb6a | 423 | \r |
424 | EFI_IMAGE_ID ImageId;\r | |
425 | \r | |
b00964a9 ED |
426 | BOOLEAN ModalForm; // Whether this is a modal form.\r |
427 | \r | |
b18e7050 ED |
428 | BOOLEAN NvUpdateRequired; // Whether this form has NV update request.\r |
429 | \r | |
7936fb6a | 430 | LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r |
431 | LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r | |
b18e7050 | 432 | LIST_ENTRY ConfigRequestHead; // List of configreques for all storage.\r |
0c66bc76 | 433 | FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf\r |
7936fb6a | 434 | } FORM_BROWSER_FORM;\r |
435 | \r | |
436 | #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r | |
437 | \r | |
f3f2e05d | 438 | #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')\r |
7936fb6a | 439 | \r |
440 | typedef struct {\r | |
441 | UINTN Signature;\r | |
442 | LIST_ENTRY Link;\r | |
443 | \r | |
444 | UINT16 DefaultId;\r | |
445 | EFI_STRING_ID DefaultName;\r | |
446 | } FORMSET_DEFAULTSTORE;\r | |
447 | \r | |
448 | #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)\r | |
449 | \r | |
450 | typedef struct {\r | |
451 | EFI_HII_HANDLE HiiHandle;\r | |
452 | EFI_HANDLE DriverHandle;\r | |
453 | EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r | |
454 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
455 | \r | |
456 | UINTN IfrBinaryLength;\r | |
457 | UINT8 *IfrBinaryData;\r | |
458 | \r | |
459 | EFI_GUID Guid;\r | |
460 | EFI_STRING_ID FormSetTitle;\r | |
461 | EFI_STRING_ID Help;\r | |
0a1147ed LG |
462 | UINT8 NumberOfClassGuid;\r |
463 | EFI_GUID ClassGuid[3]; // Up to three ClassGuid\r | |
464 | UINT16 Class; // Tiano extended Class code\r | |
465 | UINT16 SubClass; // Tiano extended Subclass code\r | |
7936fb6a | 466 | EFI_IMAGE_ID ImageId;\r |
467 | \r | |
468 | FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions\r | |
469 | EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode\r | |
470 | \r | |
471 | LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)\r | |
472 | LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)\r | |
473 | LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)\r | |
0c66bc76 | 474 | LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r |
7936fb6a | 475 | } FORM_BROWSER_FORMSET;\r |
476 | \r | |
ce6d12cc | 477 | #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')\r |
478 | \r | |
479 | typedef struct {\r | |
480 | UINTN Signature;\r | |
481 | LIST_ENTRY Link;\r | |
482 | \r | |
483 | //\r | |
484 | // Globals defined in Setup.c\r | |
485 | //\r | |
486 | BANNER_DATA *BannerData;\r | |
487 | UINTN ClassOfVfr;\r | |
488 | UINTN FunctionKeySetting;\r | |
489 | BOOLEAN ResetRequired;\r | |
ce6d12cc | 490 | UINT16 Direction;\r |
491 | EFI_SCREEN_DESCRIPTOR ScreenDimensions;\r | |
492 | CHAR16 *FunctionNineString;\r | |
493 | CHAR16 *FunctionTenString;\r | |
494 | CHAR16 *EnterString;\r | |
495 | CHAR16 *EnterCommitString;\r | |
496 | CHAR16 *EnterEscapeString;\r | |
497 | CHAR16 *EscapeString;\r | |
498 | CHAR16 *SaveFailed;\r | |
499 | CHAR16 *MoveHighlight;\r | |
500 | CHAR16 *MakeSelection;\r | |
501 | CHAR16 *DecNumericInput;\r | |
502 | CHAR16 *HexNumericInput;\r | |
503 | CHAR16 *ToggleCheckBox;\r | |
504 | CHAR16 *PromptForData;\r | |
505 | CHAR16 *PromptForPassword;\r | |
506 | CHAR16 *PromptForNewPassword;\r | |
507 | CHAR16 *ConfirmPassword;\r | |
508 | CHAR16 *ConfirmError;\r | |
509 | CHAR16 *PassowordInvalid;\r | |
510 | CHAR16 *PressEnter;\r | |
511 | CHAR16 *EmptyString;\r | |
512 | CHAR16 *AreYouSure;\r | |
513 | CHAR16 *YesResponse;\r | |
514 | CHAR16 *NoResponse;\r | |
515 | CHAR16 *MiniString;\r | |
516 | CHAR16 *PlusString;\r | |
517 | CHAR16 *MinusString;\r | |
518 | CHAR16 *AdjustNumber;\r | |
519 | CHAR16 *SaveChanges;\r | |
520 | CHAR16 *OptionMismatch;\r | |
2bb526f3 | 521 | CHAR16 *FormSuppress;\r |
ce6d12cc | 522 | CHAR16 PromptBlockWidth;\r |
523 | CHAR16 OptionBlockWidth;\r | |
524 | CHAR16 HelpBlockWidth;\r | |
525 | FORM_BROWSER_FORMSET *OldFormSet;\r | |
526 | \r | |
527 | //\r | |
528 | // Globals defined in Ui.c\r | |
529 | //\r | |
530 | LIST_ENTRY MenuOption;\r | |
531 | VOID *MenuRefreshHead;\r | |
532 | } BROWSER_CONTEXT;\r | |
533 | \r | |
534 | #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)\r | |
7936fb6a | 535 | \r |
536 | extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r | |
537 | extern EFI_HII_STRING_PROTOCOL *mHiiString;\r | |
538 | extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r | |
539 | \r | |
0a1147ed LG |
540 | extern BANNER_DATA *gBannerData;\r |
541 | extern EFI_HII_HANDLE gFrontPageHandle;\r | |
7936fb6a | 542 | extern UINTN gClassOfVfr;\r |
543 | extern UINTN gFunctionKeySetting;\r | |
544 | extern BOOLEAN gResetRequired;\r | |
7936fb6a | 545 | extern EFI_HII_HANDLE gHiiHandle;\r |
7936fb6a | 546 | extern UINT16 gDirection;\r |
547 | extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r | |
7936fb6a | 548 | \r |
d66e6c16 | 549 | extern FORM_BROWSER_FORMSET *gOldFormSet;\r |
550 | \r | |
7936fb6a | 551 | //\r |
552 | // Browser Global Strings\r | |
553 | //\r | |
7936fb6a | 554 | extern CHAR16 *gFunctionNineString;\r |
555 | extern CHAR16 *gFunctionTenString;\r | |
556 | extern CHAR16 *gEnterString;\r | |
557 | extern CHAR16 *gEnterCommitString;\r | |
8d00a0f1 | 558 | extern CHAR16 *gEnterEscapeString;\r |
7936fb6a | 559 | extern CHAR16 *gEscapeString;\r |
560 | extern CHAR16 *gSaveFailed;\r | |
561 | extern CHAR16 *gMoveHighlight;\r | |
562 | extern CHAR16 *gMakeSelection;\r | |
563 | extern CHAR16 *gDecNumericInput;\r | |
564 | extern CHAR16 *gHexNumericInput;\r | |
565 | extern CHAR16 *gToggleCheckBox;\r | |
566 | extern CHAR16 *gPromptForData;\r | |
567 | extern CHAR16 *gPromptForPassword;\r | |
568 | extern CHAR16 *gPromptForNewPassword;\r | |
569 | extern CHAR16 *gConfirmPassword;\r | |
570 | extern CHAR16 *gConfirmError;\r | |
571 | extern CHAR16 *gPassowordInvalid;\r | |
572 | extern CHAR16 *gPressEnter;\r | |
573 | extern CHAR16 *gEmptyString;\r | |
574 | extern CHAR16 *gAreYouSure;\r | |
575 | extern CHAR16 *gYesResponse;\r | |
576 | extern CHAR16 *gNoResponse;\r | |
577 | extern CHAR16 *gMiniString;\r | |
578 | extern CHAR16 *gPlusString;\r | |
579 | extern CHAR16 *gMinusString;\r | |
580 | extern CHAR16 *gAdjustNumber;\r | |
ebe43565 | 581 | extern CHAR16 *gSaveChanges;\r |
8d00a0f1 | 582 | extern CHAR16 *gOptionMismatch;\r |
0c66bc76 | 583 | extern CHAR16 *gFormSuppress;\r |
7936fb6a | 584 | \r |
585 | extern CHAR16 gPromptBlockWidth;\r | |
586 | extern CHAR16 gOptionBlockWidth;\r | |
587 | extern CHAR16 gHelpBlockWidth;\r | |
588 | \r | |
589 | extern EFI_GUID gZeroGuid;\r | |
590 | extern EFI_GUID gTianoHiiIfrGuid;\r | |
591 | \r | |
eccfeab1 | 592 | #include "Ui.h"\r |
7936fb6a | 593 | //\r |
594 | // Global Procedure Defines\r | |
595 | //\r | |
596 | \r | |
597 | /**\r | |
598 | Initialize the HII String Token to the correct values.\r | |
599 | \r | |
600 | **/\r | |
601 | VOID\r | |
602 | InitializeBrowserStrings (\r | |
603 | VOID\r | |
ed66e1bc | 604 | );\r |
7936fb6a | 605 | \r |
606 | /**\r | |
607 | Prints a unicode string to the default console,\r | |
608 | using L"%s" format.\r | |
609 | \r | |
610 | @param String String pointer.\r | |
611 | \r | |
612 | @return Length of string printed to the console\r | |
613 | \r | |
614 | **/\r | |
615 | UINTN\r | |
616 | PrintString (\r | |
617 | IN CHAR16 *String\r | |
ed66e1bc | 618 | );\r |
7936fb6a | 619 | \r |
620 | /**\r | |
621 | Prints a chracter to the default console,\r | |
622 | using L"%c" format.\r | |
623 | \r | |
624 | @param Character Character to print.\r | |
625 | \r | |
626 | @return Length of string printed to the console.\r | |
627 | \r | |
628 | **/\r | |
629 | UINTN\r | |
630 | PrintChar (\r | |
631 | CHAR16 Character\r | |
ed66e1bc | 632 | );\r |
7936fb6a | 633 | \r |
634 | /**\r | |
635 | Prints a formatted unicode string to the default console, at\r | |
636 | the supplied cursor position.\r | |
637 | \r | |
638 | @param Column The cursor position to print the string at.\r | |
639 | @param Row The cursor position to print the string at\r | |
640 | @param Fmt Format string\r | |
641 | @param ... Variable argument list for formating string.\r | |
642 | \r | |
643 | @return Length of string printed to the console\r | |
644 | \r | |
645 | **/\r | |
646 | UINTN\r | |
8091267c | 647 | EFIAPI\r |
7936fb6a | 648 | PrintAt (\r |
649 | IN UINTN Column,\r | |
650 | IN UINTN Row,\r | |
651 | IN CHAR16 *Fmt,\r | |
652 | ...\r | |
ed66e1bc | 653 | );\r |
7936fb6a | 654 | \r |
655 | /**\r | |
656 | Prints a unicode string to the default console, at\r | |
657 | the supplied cursor position, using L"%s" format.\r | |
658 | \r | |
659 | @param Column The cursor position to print the string at.\r | |
660 | @param Row The cursor position to print the string at\r | |
661 | @param String String pointer.\r | |
662 | \r | |
663 | @return Length of string printed to the console\r | |
664 | \r | |
665 | **/\r | |
666 | UINTN\r | |
667 | PrintStringAt (\r | |
668 | IN UINTN Column,\r | |
669 | IN UINTN Row,\r | |
670 | IN CHAR16 *String\r | |
ed66e1bc | 671 | );\r |
7936fb6a | 672 | \r |
673 | /**\r | |
674 | Prints a chracter to the default console, at\r | |
675 | the supplied cursor position, using L"%c" format.\r | |
676 | \r | |
677 | @param Column The cursor position to print the string at.\r | |
678 | @param Row The cursor position to print the string at.\r | |
679 | @param Character Character to print.\r | |
680 | \r | |
681 | @return Length of string printed to the console.\r | |
682 | \r | |
683 | **/\r | |
684 | UINTN\r | |
685 | PrintCharAt (\r | |
686 | IN UINTN Column,\r | |
687 | IN UINTN Row,\r | |
688 | CHAR16 Character\r | |
ed66e1bc | 689 | );\r |
7936fb6a | 690 | \r |
691 | /**\r | |
692 | Parse opcodes in the formset IFR binary.\r | |
693 | \r | |
694 | @param FormSet Pointer of the FormSet data structure.\r | |
695 | \r | |
696 | @retval EFI_SUCCESS Opcode parse success.\r | |
697 | @retval Other Opcode parse fail.\r | |
698 | \r | |
699 | **/\r | |
700 | EFI_STATUS\r | |
701 | ParseOpCodes (\r | |
702 | IN FORM_BROWSER_FORMSET *FormSet\r | |
ed66e1bc | 703 | );\r |
7936fb6a | 704 | \r |
705 | /**\r | |
706 | Free resources allocated for a FormSet.\r | |
707 | \r | |
708 | @param FormSet Pointer of the FormSet\r | |
709 | \r | |
710 | **/\r | |
711 | VOID\r | |
712 | DestroyFormSet (\r | |
713 | IN OUT FORM_BROWSER_FORMSET *FormSet\r | |
ed66e1bc | 714 | );\r |
7936fb6a | 715 | \r |
716 | /**\r | |
717 | This function displays the page frame.\r | |
718 | \r | |
b00964a9 ED |
719 | @param Selection Selection contains the information about \r |
720 | the Selection, form and formset to be displayed.\r | |
721 | Selection action may be updated in retrieve callback.\r | |
7936fb6a | 722 | **/\r |
723 | VOID\r | |
724 | DisplayPageFrame (\r | |
b00964a9 | 725 | IN UI_MENU_SELECTION *Selection\r |
ed66e1bc | 726 | );\r |
7936fb6a | 727 | \r |
728 | /**\r | |
729 | Create a new string in HII Package List.\r | |
730 | \r | |
731 | @param String The String to be added\r | |
732 | @param HiiHandle The package list in the HII database to insert the\r | |
733 | specified string.\r | |
734 | \r | |
735 | @return The output string.\r | |
736 | \r | |
737 | **/\r | |
738 | EFI_STRING_ID\r | |
739 | NewString (\r | |
740 | IN CHAR16 *String,\r | |
741 | IN EFI_HII_HANDLE HiiHandle\r | |
ed66e1bc | 742 | );\r |
7936fb6a | 743 | \r |
744 | /**\r | |
745 | Delete a string from HII Package List.\r | |
746 | \r | |
747 | @param StringId Id of the string in HII database.\r | |
748 | @param HiiHandle The HII package list handle.\r | |
749 | \r | |
750 | @retval EFI_SUCCESS The string was deleted successfully.\r | |
751 | \r | |
752 | **/\r | |
753 | EFI_STATUS\r | |
754 | DeleteString (\r | |
755 | IN EFI_STRING_ID StringId,\r | |
756 | IN EFI_HII_HANDLE HiiHandle\r | |
ed66e1bc | 757 | );\r |
7936fb6a | 758 | \r |
759 | /**\r | |
760 | Get the string based on the StringId and HII Package List Handle.\r | |
761 | \r | |
762 | @param Token The String's ID.\r | |
763 | @param HiiHandle The package list in the HII database to search for\r | |
764 | the specified string.\r | |
765 | \r | |
766 | @return The output string.\r | |
767 | \r | |
768 | **/\r | |
769 | CHAR16 *\r | |
770 | GetToken (\r | |
771 | IN EFI_STRING_ID Token,\r | |
772 | IN EFI_HII_HANDLE HiiHandle\r | |
ed66e1bc | 773 | );\r |
7936fb6a | 774 | \r |
775 | /**\r | |
776 | Draw a pop up windows based on the dimension, number of lines and\r | |
777 | strings specified.\r | |
778 | \r | |
779 | @param RequestedWidth The width of the pop-up.\r | |
780 | @param NumberOfLines The number of lines.\r | |
f4bcc90f | 781 | @param Marker The variable argument list for the list of string to be printed.\r |
7936fb6a | 782 | \r |
783 | **/\r | |
784 | VOID\r | |
785 | CreateSharedPopUp (\r | |
786 | IN UINTN RequestedWidth,\r | |
787 | IN UINTN NumberOfLines,\r | |
f4bcc90f | 788 | IN VA_LIST Marker\r |
ed66e1bc | 789 | );\r |
7936fb6a | 790 | \r |
791 | /**\r | |
792 | Routine used to abstract a generic dialog interface and return the selected key or string\r | |
793 | \r | |
794 | @param NumberOfLines The number of lines for the dialog box\r | |
795 | @param HotKey Defines whether a single character is parsed\r | |
796 | (TRUE) and returned in KeyValue or a string is\r | |
797 | returned in StringBuffer. Two special characters\r | |
798 | are considered when entering a string, a SCAN_ESC\r | |
799 | and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates\r | |
800 | string input and returns\r | |
801 | @param MaximumStringSize The maximum size in bytes of a typed in string\r | |
802 | (each character is a CHAR16) and the minimum\r | |
803 | string returned is two bytes\r | |
804 | @param StringBuffer The passed in pointer to the buffer which will\r | |
805 | hold the typed in string if HotKey is FALSE\r | |
806 | @param KeyValue The EFI_KEY value returned if HotKey is TRUE..\r | |
7936fb6a | 807 | @param ... A series of (quantity == NumberOfLines) text\r |
808 | strings which will be used to construct the dialog\r | |
809 | box\r | |
810 | \r | |
811 | @retval EFI_SUCCESS Displayed dialog and received user interaction\r | |
812 | @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.\r | |
813 | (StringBuffer == NULL) && (HotKey == FALSE))\r | |
814 | @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine\r | |
815 | \r | |
816 | **/\r | |
817 | EFI_STATUS\r | |
8091267c | 818 | EFIAPI\r |
7936fb6a | 819 | CreateDialog (\r |
820 | IN UINTN NumberOfLines,\r | |
821 | IN BOOLEAN HotKey,\r | |
822 | IN UINTN MaximumStringSize,\r | |
823 | OUT CHAR16 *StringBuffer,\r | |
824 | OUT EFI_INPUT_KEY *KeyValue,\r | |
7936fb6a | 825 | ...\r |
ed66e1bc | 826 | );\r |
7936fb6a | 827 | \r |
2573712e LG |
828 | /**\r |
829 | Get Value for given Name from a NameValue Storage.\r | |
830 | \r | |
831 | @param Storage The NameValue Storage.\r | |
832 | @param Name The Name.\r | |
833 | @param Value The retured Value.\r | |
834 | \r | |
835 | @retval EFI_SUCCESS Value found for given Name.\r | |
836 | @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r | |
837 | \r | |
838 | **/\r | |
839 | EFI_STATUS\r | |
840 | GetValueByName (\r | |
841 | IN FORMSET_STORAGE *Storage,\r | |
842 | IN CHAR16 *Name,\r | |
843 | IN OUT CHAR16 **Value\r | |
844 | );\r | |
845 | \r | |
846 | /**\r | |
847 | Set Value of given Name in a NameValue Storage.\r | |
848 | \r | |
849 | @param Storage The NameValue Storage.\r | |
850 | @param Name The Name.\r | |
851 | @param Value The Value to set.\r | |
b18e7050 | 852 | @param Edit Whether update editValue or Value.\r |
2573712e LG |
853 | \r |
854 | @retval EFI_SUCCESS Value found for given Name.\r | |
855 | @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r | |
856 | \r | |
857 | **/\r | |
858 | EFI_STATUS\r | |
859 | SetValueByName (\r | |
860 | IN FORMSET_STORAGE *Storage,\r | |
861 | IN CHAR16 *Name,\r | |
b18e7050 ED |
862 | IN CHAR16 *Value,\r |
863 | IN BOOLEAN Edit\r | |
2573712e LG |
864 | );\r |
865 | \r | |
7936fb6a | 866 | /**\r |
867 | Get Question's current Value.\r | |
868 | \r | |
869 | @param FormSet FormSet data structure.\r | |
870 | @param Form Form data structure.\r | |
871 | @param Question Question to be initialized.\r | |
872 | @param Cached TRUE: get from Edit copy FALSE: get from original\r | |
873 | Storage\r | |
874 | \r | |
875 | @retval EFI_SUCCESS The function completed successfully.\r | |
876 | \r | |
877 | **/\r | |
878 | EFI_STATUS\r | |
879 | GetQuestionValue (\r | |
880 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
881 | IN FORM_BROWSER_FORM *Form,\r | |
882 | IN OUT FORM_BROWSER_STATEMENT *Question,\r | |
883 | IN BOOLEAN Cached\r | |
ed66e1bc | 884 | );\r |
7936fb6a | 885 | \r |
886 | /**\r | |
887 | Save Question Value to edit copy(cached) or Storage(uncached).\r | |
888 | \r | |
889 | @param FormSet FormSet data structure.\r | |
890 | @param Form Form data structure.\r | |
891 | @param Question Pointer to the Question.\r | |
892 | @param Cached TRUE: set to Edit copy FALSE: set to original\r | |
893 | Storage\r | |
894 | \r | |
895 | @retval EFI_SUCCESS The function completed successfully.\r | |
896 | \r | |
897 | **/\r | |
898 | EFI_STATUS\r | |
899 | SetQuestionValue (\r | |
900 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
901 | IN FORM_BROWSER_FORM *Form,\r | |
902 | IN OUT FORM_BROWSER_STATEMENT *Question,\r | |
903 | IN BOOLEAN Cached\r | |
ed66e1bc | 904 | );\r |
7936fb6a | 905 | \r |
906 | /**\r | |
907 | Perform inconsistent check for a Form.\r | |
908 | \r | |
909 | @param FormSet FormSet data structure.\r | |
910 | @param Form Form data structure.\r | |
911 | @param Question The Question to be validated.\r | |
912 | @param Type Validation type: InConsistent or NoSubmit\r | |
913 | \r | |
914 | @retval EFI_SUCCESS Form validation pass.\r | |
915 | @retval other Form validation failed.\r | |
916 | \r | |
917 | **/\r | |
918 | EFI_STATUS\r | |
919 | ValidateQuestion (\r | |
920 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
921 | IN FORM_BROWSER_FORM *Form,\r | |
922 | IN FORM_BROWSER_STATEMENT *Question,\r | |
923 | IN UINTN Type\r | |
ed66e1bc | 924 | );\r |
7936fb6a | 925 | \r |
926 | /**\r | |
b18e7050 | 927 | Discard data for form level or formset level.\r |
7936fb6a | 928 | \r |
929 | @param FormSet FormSet data structure.\r | |
930 | @param Form Form data structure.\r | |
b18e7050 ED |
931 | @param SingleForm whether submit single form or formset.\r |
932 | \r | |
933 | @retval EFI_SUCCESS The function completed successfully.\r | |
934 | \r | |
935 | **/\r | |
936 | EFI_STATUS\r | |
937 | DiscardForm (\r | |
938 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
939 | IN FORM_BROWSER_FORM *Form,\r | |
940 | IN BOOLEAN SingleForm\r | |
941 | );\r | |
942 | \r | |
943 | /**\r | |
944 | Submit data for form level or formset level.\r | |
945 | \r | |
946 | @param FormSet FormSet data structure.\r | |
947 | @param Form Form data structure.\r | |
948 | @param SingleForm whether submit single form or formset.\r | |
7936fb6a | 949 | \r |
950 | @retval EFI_SUCCESS The function completed successfully.\r | |
951 | \r | |
952 | **/\r | |
953 | EFI_STATUS\r | |
954 | SubmitForm (\r | |
955 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
b18e7050 ED |
956 | IN FORM_BROWSER_FORM *Form,\r |
957 | IN BOOLEAN SingleForm\r | |
ed66e1bc | 958 | );\r |
7936fb6a | 959 | \r |
960 | /**\r | |
961 | Reset Question to its default value.\r | |
962 | \r | |
963 | @param FormSet The form set.\r | |
964 | @param Form The form.\r | |
965 | @param Question The question.\r | |
966 | @param DefaultId The Class of the default.\r | |
967 | \r | |
968 | @retval EFI_SUCCESS Question is reset to default value.\r | |
969 | \r | |
970 | **/\r | |
971 | EFI_STATUS\r | |
972 | GetQuestionDefault (\r | |
973 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
974 | IN FORM_BROWSER_FORM *Form,\r | |
975 | IN FORM_BROWSER_STATEMENT *Question,\r | |
976 | IN UINT16 DefaultId\r | |
ed66e1bc | 977 | );\r |
7936fb6a | 978 | \r |
979 | /**\r | |
980 | Get current setting of Questions.\r | |
981 | \r | |
982 | @param FormSet FormSet data structure.\r | |
983 | \r | |
984 | @retval EFI_SUCCESS The function completed successfully.\r | |
985 | \r | |
986 | **/\r | |
987 | EFI_STATUS\r | |
988 | InitializeCurrentSetting (\r | |
989 | IN OUT FORM_BROWSER_FORMSET *FormSet\r | |
ed66e1bc | 990 | );\r |
7936fb6a | 991 | \r |
992 | /**\r | |
993 | Initialize the internal data structure of a FormSet.\r | |
994 | \r | |
995 | @param Handle PackageList Handle\r | |
996 | @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r | |
997 | GUID), take the first FormSet found in package\r | |
998 | list.\r | |
999 | @param FormSet FormSet data structure.\r | |
1000 | \r | |
1001 | @retval EFI_SUCCESS The function completed successfully.\r | |
1002 | @retval EFI_NOT_FOUND The specified FormSet could not be found.\r | |
1003 | \r | |
1004 | **/\r | |
1005 | EFI_STATUS\r | |
1006 | InitializeFormSet (\r | |
1007 | IN EFI_HII_HANDLE Handle,\r | |
1008 | IN OUT EFI_GUID *FormSetGuid,\r | |
1009 | OUT FORM_BROWSER_FORMSET *FormSet\r | |
ed66e1bc | 1010 | );\r |
7936fb6a | 1011 | \r |
1012 | /**\r | |
4f33c838 | 1013 | Reset Questions in a Formset to their default value.\r |
7936fb6a | 1014 | \r |
1015 | @param FormSet FormSet data structure.\r | |
7936fb6a | 1016 | @param DefaultId The Class of the default.\r |
1017 | \r | |
1018 | @retval EFI_SUCCESS The function completed successfully.\r | |
1019 | \r | |
1020 | **/\r | |
1021 | EFI_STATUS\r | |
4f33c838 | 1022 | ExtractFormSetDefault (\r |
7936fb6a | 1023 | IN FORM_BROWSER_FORMSET *FormSet,\r |
7936fb6a | 1024 | IN UINT16 DefaultId\r |
ed66e1bc | 1025 | );\r |
7936fb6a | 1026 | \r |
1027 | /**\r | |
1028 | Initialize Question's Edit copy from Storage.\r | |
1029 | \r | |
eccfeab1 LG |
1030 | @param Selection Selection contains the information about \r |
1031 | the Selection, form and formset to be displayed.\r | |
1032 | Selection action may be updated in retrieve callback.\r | |
7936fb6a | 1033 | @param FormSet FormSet data structure.\r |
1034 | @param Form Form data structure.\r | |
1035 | \r | |
1036 | @retval EFI_SUCCESS The function completed successfully.\r | |
1037 | \r | |
1038 | **/\r | |
1039 | EFI_STATUS\r | |
1040 | LoadFormConfig (\r | |
eccfeab1 LG |
1041 | IN OUT UI_MENU_SELECTION *Selection,\r |
1042 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
1043 | IN FORM_BROWSER_FORM *Form\r | |
ed66e1bc | 1044 | );\r |
7936fb6a | 1045 | \r |
d66e6c16 | 1046 | /**\r |
1047 | Initialize Question's Edit copy from Storage for the whole Formset.\r | |
1048 | \r | |
eccfeab1 LG |
1049 | @param Selection Selection contains the information about \r |
1050 | the Selection, form and formset to be displayed.\r | |
1051 | Selection action may be updated in retrieve callback.\r | |
d66e6c16 | 1052 | @param FormSet FormSet data structure.\r |
1053 | \r | |
1054 | @retval EFI_SUCCESS The function completed successfully.\r | |
1055 | \r | |
1056 | **/\r | |
1057 | EFI_STATUS\r | |
1058 | LoadFormSetConfig (\r | |
eccfeab1 LG |
1059 | IN OUT UI_MENU_SELECTION *Selection,\r |
1060 | IN FORM_BROWSER_FORMSET *FormSet\r | |
d66e6c16 | 1061 | );\r |
1062 | \r | |
7936fb6a | 1063 | /**\r |
1064 | Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.\r | |
1065 | \r | |
b18e7050 | 1066 | @param Buffer The Storage to be conveted.\r |
7936fb6a | 1067 | @param ConfigResp The returned <ConfigResp>.\r |
b18e7050 | 1068 | @param SingleForm Whether update data for single form or formset level.\r |
7936fb6a | 1069 | \r |
1070 | @retval EFI_SUCCESS Convert success.\r | |
1071 | @retval EFI_INVALID_PARAMETER Incorrect storage type.\r | |
1072 | \r | |
1073 | **/\r | |
1074 | EFI_STATUS\r | |
1075 | StorageToConfigResp (\r | |
b18e7050 ED |
1076 | IN VOID *Buffer,\r |
1077 | IN CHAR16 **ConfigResp,\r | |
1078 | IN BOOLEAN SingleForm\r | |
ed66e1bc | 1079 | );\r |
7936fb6a | 1080 | \r |
1081 | /**\r | |
1082 | Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.\r | |
1083 | \r | |
1084 | @param Storage The Storage to receive the settings.\r | |
1085 | @param ConfigResp The <ConfigResp> to be converted.\r | |
1086 | \r | |
1087 | @retval EFI_SUCCESS Convert success.\r | |
1088 | @retval EFI_INVALID_PARAMETER Incorrect storage type.\r | |
1089 | \r | |
1090 | **/\r | |
1091 | EFI_STATUS\r | |
1092 | ConfigRespToStorage (\r | |
1093 | IN FORMSET_STORAGE *Storage,\r | |
1094 | IN CHAR16 *ConfigResp\r | |
ed66e1bc | 1095 | );\r |
7936fb6a | 1096 | \r |
1097 | /**\r | |
1098 | Fill storage's edit copy with settings requested from Configuration Driver.\r | |
1099 | \r | |
1100 | @param FormSet FormSet data structure.\r | |
1101 | @param Storage Buffer Storage.\r | |
1102 | \r | |
1103 | @retval EFI_SUCCESS The function completed successfully.\r | |
1104 | \r | |
1105 | **/\r | |
1106 | EFI_STATUS\r | |
1107 | LoadStorage (\r | |
1108 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
1109 | IN FORMSET_STORAGE *Storage\r | |
ed66e1bc | 1110 | );\r |
7936fb6a | 1111 | \r |
1112 | /**\r | |
1113 | Fetch the Ifr binary data of a FormSet.\r | |
1114 | \r | |
1115 | @param Handle PackageList Handle\r | |
1116 | @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r | |
1117 | GUID), take the first FormSet found in package\r | |
1118 | list.\r | |
1119 | @param BinaryLength The length of the FormSet IFR binary.\r | |
1120 | @param BinaryData The buffer designed to receive the FormSet.\r | |
1121 | \r | |
1122 | @retval EFI_SUCCESS Buffer filled with the requested FormSet.\r | |
1123 | BufferLength was updated.\r | |
1124 | @retval EFI_INVALID_PARAMETER The handle is unknown.\r | |
1125 | @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot\r | |
1126 | be found with the requested FormId.\r | |
1127 | \r | |
1128 | **/\r | |
1129 | EFI_STATUS\r | |
1130 | GetIfrBinaryData (\r | |
1131 | IN EFI_HII_HANDLE Handle,\r | |
1132 | IN OUT EFI_GUID *FormSetGuid,\r | |
1133 | OUT UINTN *BinaryLength,\r | |
1134 | OUT UINT8 **BinaryData\r | |
ed66e1bc | 1135 | );\r |
7936fb6a | 1136 | \r |
ce6d12cc | 1137 | /**\r |
1138 | Save globals used by previous call to SendForm(). SendForm() may be called from \r | |
1139 | HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r | |
1140 | So, save globals of previous call to SendForm() and restore them upon exit.\r | |
1141 | \r | |
1142 | **/\r | |
1143 | VOID\r | |
1144 | SaveBrowserContext (\r | |
1145 | VOID\r | |
1146 | );\r | |
1147 | \r | |
1148 | /**\r | |
1149 | Restore globals used by previous call to SendForm().\r | |
1150 | \r | |
1151 | **/\r | |
1152 | VOID\r | |
1153 | RestoreBrowserContext (\r | |
1154 | VOID\r | |
1155 | );\r | |
1156 | \r | |
7936fb6a | 1157 | /**\r |
1158 | This is the routine which an external caller uses to direct the browser\r | |
1159 | where to obtain it's information.\r | |
1160 | \r | |
1161 | \r | |
1162 | @param This The Form Browser protocol instanse.\r | |
1163 | @param Handles A pointer to an array of Handles. If HandleCount > 1 we\r | |
1164 | display a list of the formsets for the handles specified.\r | |
1165 | @param HandleCount The number of Handles specified in Handle.\r | |
1166 | @param FormSetGuid This field points to the EFI_GUID which must match the Guid\r | |
1167 | field in the EFI_IFR_FORM_SET op-code for the specified\r | |
1168 | forms-based package. If FormSetGuid is NULL, then this\r | |
1169 | function will display the first found forms package.\r | |
1170 | @param FormId This field specifies which EFI_IFR_FORM to render as the first\r | |
1171 | displayable page. If this field has a value of 0x0000, then\r | |
1172 | the forms browser will render the specified forms in their encoded order.\r | |
1173 | ScreenDimenions - This allows the browser to be called so that it occupies a\r | |
1174 | portion of the physical screen instead of dynamically determining the screen dimensions.\r | |
1175 | ActionRequest - Points to the action recommended by the form.\r | |
d66e6c16 | 1176 | @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in\r |
7936fb6a | 1177 | characters.\r |
1178 | @param ActionRequest Points to the action recommended by the form.\r | |
1179 | \r | |
1180 | @retval EFI_SUCCESS The function completed successfully.\r | |
1181 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r | |
1182 | @retval EFI_NOT_FOUND No valid forms could be found to display.\r | |
1183 | \r | |
1184 | **/\r | |
1185 | EFI_STATUS\r | |
1186 | EFIAPI\r | |
1187 | SendForm (\r | |
1188 | IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r | |
1189 | IN EFI_HII_HANDLE *Handles,\r | |
1190 | IN UINTN HandleCount,\r | |
1191 | IN EFI_GUID *FormSetGuid, OPTIONAL\r | |
1192 | IN UINT16 FormId, OPTIONAL\r | |
1193 | IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL\r | |
1194 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL\r | |
ed66e1bc | 1195 | );\r |
7936fb6a | 1196 | \r |
1197 | /**\r | |
1198 | This function is called by a callback handler to retrieve uncommitted state\r | |
1199 | data from the browser.\r | |
1200 | \r | |
1201 | @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r | |
1202 | instance.\r | |
1203 | @param ResultsDataSize A pointer to the size of the buffer associated\r | |
1204 | with ResultsData.\r | |
1205 | @param ResultsData A string returned from an IFR browser or\r | |
1206 | equivalent. The results string will have no\r | |
1207 | routing information in them.\r | |
1208 | @param RetrieveData A BOOLEAN field which allows an agent to retrieve\r | |
1209 | (if RetrieveData = TRUE) data from the uncommitted\r | |
1210 | browser state information or set (if RetrieveData\r | |
1211 | = FALSE) data in the uncommitted browser state\r | |
1212 | information.\r | |
1213 | @param VariableGuid An optional field to indicate the target variable\r | |
1214 | GUID name to use.\r | |
1215 | @param VariableName An optional field to indicate the target\r | |
1216 | human-readable variable name.\r | |
1217 | \r | |
1218 | @retval EFI_SUCCESS The results have been distributed or are awaiting\r | |
1219 | distribution.\r | |
1220 | @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to\r | |
1221 | contain the results data.\r | |
1222 | \r | |
1223 | **/\r | |
1224 | EFI_STATUS\r | |
1225 | EFIAPI\r | |
1226 | BrowserCallback (\r | |
1227 | IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r | |
1228 | IN OUT UINTN *ResultsDataSize,\r | |
1229 | IN OUT EFI_STRING ResultsData,\r | |
1230 | IN BOOLEAN RetrieveData,\r | |
1231 | IN CONST EFI_GUID *VariableGuid, OPTIONAL\r | |
1232 | IN CONST CHAR16 *VariableName OPTIONAL\r | |
ed66e1bc | 1233 | );\r |
7936fb6a | 1234 | \r |
b18e7050 ED |
1235 | /**\r |
1236 | Find menu which will show next time.\r | |
1237 | \r | |
1238 | @param Selection On input, Selection tell setup browser the information\r | |
1239 | about the Selection, form and formset to be displayed.\r | |
1240 | On output, Selection return the screen item that is selected\r | |
1241 | by user.\r | |
1242 | @param Repaint Whether need to repaint the menu.\r | |
1243 | @param NewLine Whether need to show at new line.\r | |
1244 | \r | |
1245 | @retval TRUE Need return.\r | |
1246 | @retval FALSE No need to return.\r | |
1247 | **/\r | |
1248 | BOOLEAN\r | |
1249 | FindNextMenu (\r | |
1250 | IN OUT UI_MENU_SELECTION *Selection,\r | |
1251 | IN BOOLEAN *Repaint, \r | |
1252 | IN BOOLEAN *NewLine \r | |
1253 | );\r | |
1254 | \r | |
1255 | /**\r | |
1256 | check whether the formset need to update the NV.\r | |
1257 | \r | |
1258 | @param FormSet FormSet data structure.\r | |
1259 | @param SetValue Whether set new value or clear old value.\r | |
1260 | \r | |
1261 | **/\r | |
1262 | VOID\r | |
1263 | UpdateNvInfoInForm (\r | |
1264 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
1265 | IN BOOLEAN SetValue\r | |
1266 | );\r | |
1267 | \r | |
1268 | /**\r | |
1269 | check whether the formset need to update the NV.\r | |
1270 | \r | |
1271 | @param FormSet FormSet data structure.\r | |
1272 | \r | |
1273 | @retval TRUE Need to update the NV.\r | |
1274 | @retval FALSE No need to update the NV.\r | |
1275 | **/\r | |
1276 | BOOLEAN \r | |
1277 | IsNvUpdateRequired (\r | |
1278 | IN FORM_BROWSER_FORMSET *FormSet\r | |
1279 | );\r | |
1280 | \r | |
1281 | /**\r | |
1282 | Call the call back function for the question and process the return action.\r | |
1283 | \r | |
1284 | @param Selection On input, Selection tell setup browser the information\r | |
1285 | about the Selection, form and formset to be displayed.\r | |
1286 | On output, Selection return the screen item that is selected\r | |
1287 | by user.\r | |
1288 | @param Statement The Question which need to call.\r | |
1289 | @param Action The action request.\r | |
1290 | @param SkipSaveOrDiscard Whether skip save or discard action.\r | |
1291 | \r | |
1292 | @retval EFI_SUCCESS The call back function excutes successfully.\r | |
1293 | @return Other value if the call back function failed to excute. \r | |
1294 | **/\r | |
1295 | EFI_STATUS \r | |
1296 | ProcessCallBackFunction (\r | |
1297 | IN OUT UI_MENU_SELECTION *Selection,\r | |
1298 | IN FORM_BROWSER_STATEMENT *Question,\r | |
1299 | IN EFI_BROWSER_ACTION Action,\r | |
1300 | IN BOOLEAN SkipSaveOrDiscard\r | |
1301 | );\r | |
7936fb6a | 1302 | #endif\r |