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