]> git.proxmox.com Git - mirror_edk2.git/blame - OldMdePkg/Include/Common/InternalFormRepresentation.h
Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing...
[mirror_edk2.git] / OldMdePkg / Include / Common / InternalFormRepresentation.h
CommitLineData
878ddf1f 1/** @file\r
2 This file defines the encoding for the VFR (Visual Form Representation) language.\r
3 IFR is primarily consumed by the EFI presentation engine, and produced by EFI\r
4 internal application and drivers as well as all add-in card option-ROM drivers\r
5\r
6 Copyright (c) 2006, Intel Corporation \r
7 All rights reserved. This program and the accompanying materials \r
8 are licensed and made available under the terms and conditions of the BSD License \r
9 which accompanies this distribution. The full text of the license may be found at \r
10 http://opensource.org/licenses/bsd-license.php \r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15 Module Name: InternalFormRepresentation.h\r
16\r
17 @par Revision Reference:\r
18 These definitions are from Human Interface Infrastructure Spec Version 0.92.\r
19\r
20**/\r
21\r
22#ifndef __EFI_INTERNAL_FORM_REPRESENTATION_H__\r
23#define __EFI_INTERNAL_FORM_REPRESENTATION_H__\r
24\r
25//\r
26// The following types are currently defined:\r
27//\r
28typedef UINT32 RELOFST;\r
29typedef CHAR16 *EFI_STRING;\r
30\r
31//\r
32// IFR Op codes\r
33//\r
34#define EFI_IFR_FORM_OP 0x01\r
35#define EFI_IFR_SUBTITLE_OP 0x02\r
36#define EFI_IFR_TEXT_OP 0x03\r
37#define EFI_IFR_GRAPHIC_OP 0x04\r
38#define EFI_IFR_ONE_OF_OP 0x05\r
39#define EFI_IFR_CHECKBOX_OP 0x06\r
40#define EFI_IFR_NUMERIC_OP 0x07\r
41#define EFI_IFR_PASSWORD_OP 0x08\r
42#define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field\r
43#define EFI_IFR_SUPPRESS_IF_OP 0x0A\r
44#define EFI_IFR_END_FORM_OP 0x0B\r
45#define EFI_IFR_HIDDEN_OP 0x0C\r
46#define EFI_IFR_END_FORM_SET_OP 0x0D\r
47#define EFI_IFR_FORM_SET_OP 0x0E\r
48#define EFI_IFR_REF_OP 0x0F\r
49#define EFI_IFR_END_ONE_OF_OP 0x10\r
50#define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP\r
51#define EFI_IFR_INCONSISTENT_IF_OP 0x11\r
52#define EFI_IFR_EQ_ID_VAL_OP 0x12\r
53#define EFI_IFR_EQ_ID_ID_OP 0x13\r
54#define EFI_IFR_EQ_ID_LIST_OP 0x14\r
55#define EFI_IFR_AND_OP 0x15\r
56#define EFI_IFR_OR_OP 0x16\r
57#define EFI_IFR_NOT_OP 0x17\r
58#define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif\r
59#define EFI_IFR_GRAYOUT_IF_OP 0x19\r
60#define EFI_IFR_DATE_OP 0x1A\r
61#define EFI_IFR_TIME_OP 0x1B\r
62#define EFI_IFR_STRING_OP 0x1C\r
63#define EFI_IFR_LABEL_OP 0x1D\r
64#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E\r
65#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F\r
66#define EFI_IFR_BANNER_OP 0x20\r
67#define EFI_IFR_INVENTORY_OP 0x21\r
68#define EFI_IFR_EQ_VAR_VAL_OP 0x22\r
69#define EFI_IFR_ORDERED_LIST_OP 0x23\r
70#define EFI_IFR_VARSTORE_OP 0x24\r
71#define EFI_IFR_VARSTORE_SELECT_OP 0x25\r
72#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26\r
73#define EFI_IFR_TRUE_OP 0x27\r
74#define EFI_IFR_FALSE_OP 0x28\r
75#define EFI_IFR_GT_OP 0x29\r
76#define EFI_IFR_GE_OP 0x2A\r
77#define EFI_IFR_OEM_DEFINED_OP 0x2B\r
78#define EFI_IFR_LAST_OPCODE EFI_IFR_OEM_DEFINED_OP\r
79#define EFI_IFR_OEM_OP 0xFE\r
80#define EFI_IFR_NV_ACCESS_COMMAND 0xFF\r
81\r
82//\r
83// Define values for the flags fields in some VFR opcodes. These are\r
84// bitmasks.\r
85//\r
86#define EFI_IFR_FLAG_DEFAULT 0x01\r
87#define EFI_IFR_FLAG_MANUFACTURING 0x02\r
88#define EFI_IFR_FLAG_INTERACTIVE 0x04\r
89#define EFI_IFR_FLAG_NV_ACCESS 0x08\r
90#define EFI_IFR_FLAG_RESET_REQUIRED 0x10\r
91#define EFI_IFR_FLAG_LATE_CHECK 0x20\r
92\r
93#define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager\r
94#define EFI_DISK_DEVICE_CLASS 0x01\r
95#define EFI_VIDEO_DEVICE_CLASS 0x02\r
96#define EFI_NETWORK_DEVICE_CLASS 0x04\r
97#define EFI_INPUT_DEVICE_CLASS 0x08\r
98#define EFI_ON_BOARD_DEVICE_CLASS 0x10\r
99#define EFI_OTHER_DEVICE_CLASS 0x20\r
100\r
101#define EFI_SETUP_APPLICATION_SUBCLASS 0x00\r
102#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01\r
103#define EFI_FRONT_PAGE_SUBCLASS 0x02\r
104#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit\r
105\r
106//\r
107// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set\r
108// and the browser since we need to distinguish between compiled NV map data and created data.\r
109// We do not allow new entries to be created in the NV map dynamically however we still need\r
110// to display this information correctly. To dynamically create op-codes and assume that their\r
111// data will be saved, ensure that the NV starting location they refer to is pre-defined in the\r
112// NV map.\r
113//\r
114#define EFI_IFR_FLAG_CREATED 128\r
115\r
116#pragma pack(1)\r
117//\r
118// IFR Structure definitions\r
119//\r
120typedef struct {\r
121 UINT8 OpCode;\r
122 UINT8 Length;\r
123} EFI_IFR_OP_HEADER;\r
124\r
125typedef struct {\r
126 EFI_IFR_OP_HEADER Header;\r
127 EFI_GUID Guid;\r
128 STRING_REF FormSetTitle;\r
129 STRING_REF Help;\r
130 EFI_PHYSICAL_ADDRESS CallbackHandle;\r
131 UINT16 Class;\r
132 UINT16 SubClass;\r
133 UINT16 NvDataSize; // set once, size of the NV data as defined in the script\r
134} EFI_IFR_FORM_SET;\r
135\r
136typedef struct {\r
137 EFI_IFR_OP_HEADER Header;\r
138 UINT16 FormId;\r
139 STRING_REF FormTitle;\r
140} EFI_IFR_FORM;\r
141\r
142typedef struct {\r
143 EFI_IFR_OP_HEADER Header;\r
144 UINT16 LabelId;\r
145} EFI_IFR_LABEL;\r
146\r
147typedef struct {\r
148 EFI_IFR_OP_HEADER Header;\r
149 STRING_REF SubTitle;\r
150} EFI_IFR_SUBTITLE;\r
151\r
152typedef struct {\r
153 EFI_IFR_OP_HEADER Header;\r
154 STRING_REF Help;\r
155 STRING_REF Text;\r
156 STRING_REF TextTwo;\r
157 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
158 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
159} EFI_IFR_TEXT;\r
160\r
161//\r
162// goto\r
163//\r
164typedef struct {\r
165 EFI_IFR_OP_HEADER Header;\r
166 UINT16 FormId;\r
167 STRING_REF Prompt;\r
168 STRING_REF Help; // The string Token for the context-help\r
169 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
170 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
171} EFI_IFR_REF;\r
172\r
173typedef struct {\r
174 EFI_IFR_OP_HEADER Header;\r
175} EFI_IFR_END_FORM;\r
176\r
177typedef struct {\r
178 EFI_IFR_OP_HEADER Header;\r
179} EFI_IFR_END_FORM_SET;\r
180\r
181//\r
182// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever\r
183// changes we need to revisit the InitializeTagStructures code\r
184//\r
185typedef struct {\r
186 EFI_IFR_OP_HEADER Header;\r
187 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
188 UINT8 Width; // The Size of the Data being saved\r
189 STRING_REF Prompt; // The String Token for the Prompt\r
190 STRING_REF Help; // The string Token for the context-help\r
191} EFI_IFR_ONE_OF;\r
192\r
193typedef struct {\r
194 EFI_IFR_OP_HEADER Header;\r
195 UINT16 QuestionId; // The offset in NV for storage of the data\r
196 UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)\r
197 STRING_REF Prompt; // The string token for the prompt\r
198 STRING_REF Help; // The string token for the context-help\r
199} EFI_IFR_ORDERED_LIST;\r
200\r
201typedef struct {\r
202 EFI_IFR_OP_HEADER Header;\r
203 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
204 UINT8 Width; // The Size of the Data being saved\r
205 STRING_REF Prompt; // The String Token for the Prompt\r
206 STRING_REF Help; // The string Token for the context-help\r
207 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely\r
208 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
209} EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;\r
210\r
211typedef struct {\r
212 EFI_IFR_OP_HEADER Header;\r
213 STRING_REF Option; // The string token describing the option\r
214 UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen\r
215 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above\r
216 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
217} EFI_IFR_ONE_OF_OPTION;\r
218\r
219typedef struct {\r
220 EFI_IFR_OP_HEADER Header;\r
221 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
222 UINT8 Width; // The Size of the Data being saved\r
223 STRING_REF Prompt; // The String Token for the Prompt\r
224 STRING_REF Help; // The string Token for the context-help\r
225 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
226 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
227 UINT16 Minimum;\r
228 UINT16 Maximum;\r
229 UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for\r
230 UINT16 Default;\r
231} EFI_IFR_NUMERIC;\r
232\r
233//\r
234// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from\r
235// a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space\r
236// will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system\r
237// resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate\r
238// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.\r
239//\r
240typedef struct {\r
241 EFI_IFR_NUMERIC Hour;\r
242 EFI_IFR_NUMERIC Minute;\r
243 EFI_IFR_NUMERIC Second;\r
244} EFI_IFR_TIME;\r
245\r
246typedef struct {\r
247 EFI_IFR_NUMERIC Year;\r
248 EFI_IFR_NUMERIC Month;\r
249 EFI_IFR_NUMERIC Day;\r
250} EFI_IFR_DATE;\r
251\r
252typedef struct {\r
253 EFI_IFR_OP_HEADER Header;\r
254 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
255 UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday\r
256 STRING_REF Prompt; // The String Token for the Prompt\r
257 STRING_REF Help; // The string Token for the context-help\r
258 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
259 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
260 UINT8 MinSize; // Minimum allowable sized password\r
261 UINT8 MaxSize; // Maximum allowable sized password\r
262 UINT16 Encoding;\r
263} EFI_IFR_PASSWORD;\r
264\r
265typedef struct {\r
266 EFI_IFR_OP_HEADER Header;\r
267 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
268 UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday\r
269 STRING_REF Prompt; // The String Token for the Prompt\r
270 STRING_REF Help; // The string Token for the context-help\r
271 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
272 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
273 UINT8 MinSize; // Minimum allowable sized password\r
274 UINT8 MaxSize; // Maximum allowable sized password\r
275} EFI_IFR_STRING;\r
276\r
277typedef struct {\r
278 EFI_IFR_OP_HEADER Header;\r
279} EFI_IFR_END_ONE_OF;\r
280\r
281typedef struct {\r
282 EFI_IFR_OP_HEADER Header;\r
283 UINT16 Value;\r
284 UINT16 Key;\r
285} EFI_IFR_HIDDEN;\r
286\r
287typedef struct {\r
288 EFI_IFR_OP_HEADER Header;\r
289 UINT8 Flags;\r
290} EFI_IFR_SUPPRESS;\r
291\r
292typedef struct {\r
293 EFI_IFR_OP_HEADER Header;\r
294 UINT8 Flags;\r
295} EFI_IFR_GRAY_OUT;\r
296\r
297typedef struct {\r
298 EFI_IFR_OP_HEADER Header;\r
299 STRING_REF Popup;\r
300 UINT8 Flags;\r
301} EFI_IFR_INCONSISTENT;\r
302\r
303typedef struct {\r
304 EFI_IFR_OP_HEADER Header;\r
305 UINT16 QuestionId; // offset into variable storage\r
306 UINT8 Width; // size of variable storage\r
307 UINT16 Value; // value to compare against\r
308} EFI_IFR_EQ_ID_VAL;\r
309\r
310typedef struct {\r
311 EFI_IFR_OP_HEADER Header;\r
312 UINT16 QuestionId; // offset into variable storage\r
313 UINT8 Width; // size of variable storage\r
314 UINT16 ListLength;\r
315 UINT16 ValueList[1];\r
316} EFI_IFR_EQ_ID_LIST;\r
317\r
318typedef struct {\r
319 EFI_IFR_OP_HEADER Header;\r
320 UINT16 QuestionId1; // offset into variable storage for first value to compare\r
321 UINT8 Width; // size of variable storage (must be same for both)\r
322 UINT16 QuestionId2; // offset into variable storage for second value to compare\r
323} EFI_IFR_EQ_ID_ID;\r
324\r
325typedef struct {\r
326 EFI_IFR_OP_HEADER Header;\r
327 UINT16 VariableId; // offset into variable storage\r
328 UINT16 Value; // value to compare against\r
329} EFI_IFR_EQ_VAR_VAL;\r
330\r
331typedef struct {\r
332 EFI_IFR_OP_HEADER Header;\r
333} EFI_IFR_AND;\r
334\r
335typedef struct {\r
336 EFI_IFR_OP_HEADER Header;\r
337} EFI_IFR_OR;\r
338\r
339typedef struct {\r
340 EFI_IFR_OP_HEADER Header;\r
341} EFI_IFR_NOT;\r
342\r
343typedef struct {\r
344 EFI_IFR_OP_HEADER Header;\r
345} EFI_IFR_END_EXPR, EFI_IFR_END_IF;\r
346\r
347typedef struct {\r
348 EFI_IFR_OP_HEADER Header;\r
349 UINT16 FormId;\r
350 STRING_REF Prompt;\r
351 STRING_REF Help;\r
352 UINT8 Flags;\r
353 UINT16 Key;\r
354} EFI_IFR_SAVE_DEFAULTS;\r
355\r
356typedef struct {\r
357 EFI_IFR_OP_HEADER Header;\r
358 STRING_REF Help;\r
359 STRING_REF Text;\r
360 STRING_REF TextTwo; // optional text\r
361} EFI_IFR_INVENTORY;\r
362\r
363typedef struct {\r
364 EFI_IFR_OP_HEADER Header;\r
365 EFI_GUID Guid; // GUID for the variable\r
366 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
367 UINT16 Size; // size of the variable storage\r
368} EFI_IFR_VARSTORE;\r
369\r
370typedef struct {\r
371 EFI_IFR_OP_HEADER Header;\r
372 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
373} EFI_IFR_VARSTORE_SELECT;\r
374\r
375//\r
376// Used for the ideqid VFR statement where two variable stores may be referenced in the\r
377// same VFR statement.\r
378// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following\r
379// IFR opcodes use the VarId as defined here.\r
380//\r
381typedef struct {\r
382 EFI_IFR_OP_HEADER Header;\r
383 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
384 UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form\r
385} EFI_IFR_VARSTORE_SELECT_PAIR;\r
386\r
387typedef struct {\r
388 EFI_IFR_OP_HEADER Header;\r
389} EFI_IFR_TRUE;\r
390\r
391typedef struct {\r
392 EFI_IFR_OP_HEADER Header;\r
393} EFI_IFR_FALSE;\r
394\r
395typedef struct {\r
396 EFI_IFR_OP_HEADER Header;\r
397} EFI_IFR_GT;\r
398\r
399typedef struct {\r
400 EFI_IFR_OP_HEADER Header;\r
401} EFI_IFR_GE;\r
402\r
403//\r
404// Save defaults and restore defaults have same structure\r
405//\r
406#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS\r
407\r
408typedef struct {\r
409 EFI_IFR_OP_HEADER Header;\r
410 STRING_REF Title; // The string token for the banner title\r
411 UINT16 LineNumber; // 1-based line number\r
412 UINT8 Alignment; // left, center, or right-aligned\r
413} EFI_IFR_BANNER;\r
414\r
415#define EFI_IFR_BANNER_ALIGN_LEFT 0\r
416#define EFI_IFR_BANNER_ALIGN_CENTER 1\r
417#define EFI_IFR_BANNER_ALIGN_RIGHT 2\r
418#define EFI_IFR_BANNER_TIMEOUT 0xFF\r
419\r
420#pragma pack()\r
421\r
422#endif\r