]>
Commit | Line | Data |
---|---|---|
95276127 | 1 | /** @file\r |
2 | This file defines the Human Interface Infrastructure protocol which will\r | |
3 | be used by resources which want to publish IFR/Font/String data and have it\r | |
4 | collected by the Configuration engine.\r | |
5 | \r | |
6 | Copyright (c) 2007, 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: FrameworkHii.h\r | |
16 | \r | |
17 | @par Revision Reference:\r | |
18 | This protocol is defined in HII spec 0.92.\r | |
19 | \r | |
20 | **/\r | |
21 | \r | |
22 | #ifndef _FRAMEWORK_HII_H_\r | |
23 | #define _FRAMEWORK_HII_H_\r | |
24 | \r | |
25 | #include <PiDxe.h>\r | |
26 | \r | |
27 | //\r | |
28 | // To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,\r | |
29 | // is defined in MdePkg/Protocol/GraphicsOutput.h\r | |
30 | //\r | |
31 | #include <Protocol/GraphicsOutput.h>\r | |
32 | \r | |
33 | #define EFI_HII_PROTOCOL_GUID \\r | |
34 | { \\r | |
35 | 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \\r | |
36 | }\r | |
37 | \r | |
38 | // BugBug:\r | |
39 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r | |
40 | // If UGA goes away we need to put this some place. I'm not sure where?\r | |
41 | //\r | |
42 | //typedef struct {\r | |
43 | // UINT8 Blue;\r | |
44 | // UINT8 Green;\r | |
45 | // UINT8 Red;\r | |
46 | // UINT8 Reserved;\r | |
47 | //} EFI_UGA_PIXEL;\r | |
48 | \r | |
49 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r | |
50 | //\r | |
51 | \r | |
52 | typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;\r | |
53 | \r | |
54 | //\r | |
55 | // Global definition\r | |
56 | //\r | |
57 | #define NARROW_CHAR 0xFFF0\r | |
58 | #define WIDE_CHAR 0xFFF1\r | |
59 | #define NON_BREAKING_CHAR 0xFFF2\r | |
60 | #define GLYPH_WIDTH 8\r | |
61 | #define GLYPH_HEIGHT 19\r | |
62 | \r | |
63 | #define EFI_HII_FONT 1\r | |
64 | #define EFI_HII_STRING 2\r | |
65 | #define EFI_HII_IFR 3\r | |
66 | #define EFI_HII_KEYBOARD 4\r | |
67 | #define EFI_HII_HANDLES 5\r | |
68 | #define EFI_HII_VARIABLE 6\r | |
69 | #define EFI_HII_DEVICE_PATH 7\r | |
70 | \r | |
71 | \r | |
72 | // References to string tokens must use this macro to enable scanning for\r | |
73 | // token usages.\r | |
74 | //\r | |
75 | #define STRING_TOKEN(t) t\r | |
76 | \r | |
77 | //\r | |
78 | // The following types are currently defined:\r | |
79 | //\r | |
80 | typedef UINT16 EFI_FORM_ID;\r | |
81 | typedef UINT16 EFI_FORM_LABEL;\r | |
82 | \r | |
83 | #pragma pack(1)\r | |
84 | \r | |
85 | typedef struct {\r | |
86 | UINT32 Length;\r | |
87 | UINT16 Type;\r | |
88 | } EFI_HII_PACK_HEADER;\r | |
89 | \r | |
90 | //\r | |
91 | // A form list consists of a large variety of structure\r | |
92 | // possibilities so to represent the binary blob of data\r | |
93 | // associated with a package of forms, we will assume a\r | |
94 | // pointer to a self-describing data buffer.\r | |
95 | //\r | |
96 | typedef struct {\r | |
97 | EFI_HII_PACK_HEADER Header;\r | |
98 | } EFI_HII_IFR_PACK;\r | |
99 | \r | |
100 | typedef struct {\r | |
101 | EFI_HII_PACK_HEADER Header; // Must be filled in\r | |
102 | EFI_HANDLE ImageHandle; // Must be filled in\r | |
103 | EFI_HANDLE DeviceHandle; // Optional\r | |
104 | EFI_HANDLE ControllerHandle; // Optional\r | |
105 | EFI_HANDLE CallbackHandle; // Optional\r | |
106 | EFI_HANDLE COBExportHandle; // Optional\r | |
107 | } EFI_HII_HANDLE_PACK;\r | |
108 | \r | |
109 | //\r | |
110 | // ********************************************************\r | |
111 | // EFI_VARIABLE_CONTENTS\r | |
112 | // ********************************************************\r | |
113 | //\r | |
114 | typedef struct {\r | |
115 | EFI_HII_PACK_HEADER Header;\r | |
116 | EFI_GUID VariableGuid;\r | |
117 | UINT32 VariableNameLength;\r | |
118 | UINT16 VariableId;\r | |
119 | //\r | |
120 | // CHAR16 VariableName[]; //Null-terminated\r | |
121 | //\r | |
122 | } EFI_HII_VARIABLE_PACK;\r | |
123 | \r | |
124 | //\r | |
125 | // ********************************************************\r | |
126 | // EFI_DEVICE_PATH_PACK\r | |
127 | // ********************************************************\r | |
128 | //\r | |
129 | typedef struct {\r | |
130 | EFI_HII_PACK_HEADER Header;\r | |
131 | //\r | |
132 | // EFI_DEVICE_PATH DevicePath[];\r | |
133 | //\r | |
134 | } EFI_HII_DEVICE_PATH_PACK;\r | |
135 | \r | |
136 | //\r | |
137 | // ********************************************************\r | |
138 | // EFI_HII_DATA_TABLE\r | |
139 | // ********************************************************\r | |
140 | //\r | |
141 | typedef struct {\r | |
142 | EFI_HII_HANDLE HiiHandle;\r | |
143 | EFI_GUID PackageGuid;\r | |
144 | UINT32 DataTableSize;\r | |
145 | UINT32 IfrDataOffset;\r | |
146 | UINT32 StringDataOffset;\r | |
147 | UINT32 VariableDataOffset;\r | |
148 | UINT32 DevicePathOffset;\r | |
149 | UINT32 NumberOfVariableData;\r | |
150 | UINT32 NumberOfLanguages;\r | |
151 | //\r | |
152 | // EFI_HII_DEVICE_PATH_PACK DevicePath[];\r | |
153 | // EFI_HII_VARIABLE_PACK VariableData[];\r | |
154 | // EFI_HII_IFR_PACK IfrData;\r | |
155 | // EFI_HII_STRING_PACK StringData[];\r | |
156 | //\r | |
157 | } EFI_HII_DATA_TABLE;\r | |
158 | \r | |
159 | //\r | |
160 | // ********************************************************\r | |
161 | // EFI_HII_EXPORT_TABLE\r | |
162 | // ********************************************************\r | |
163 | //\r | |
164 | typedef struct {\r | |
165 | UINT32 NumberOfHiiDataTables;\r | |
166 | EFI_GUID Revision;\r | |
167 | //\r | |
168 | // EFI_HII_DATA_TABLE HiiDataTable[];\r | |
169 | //\r | |
170 | } EFI_HII_EXPORT_TABLE;\r | |
171 | \r | |
172 | typedef struct {\r | |
173 | BOOLEAN FormSetUpdate; // If TRUE, next variable is significant\r | |
174 | EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info\r | |
175 | BOOLEAN FormUpdate; // If TRUE, next variable is significant\r | |
176 | UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.\r | |
177 | STRING_REF FormTitle; // If not 0, will update Form with this info\r | |
178 | UINT16 DataCount; // The number of Data entries in this structure\r | |
179 | UINT8 *Data; // An array of 1+ op-codes, specified by DataCount\r | |
180 | } EFI_HII_UPDATE_DATA;\r | |
181 | \r | |
182 | //\r | |
183 | // String attributes\r | |
184 | //\r | |
185 | #define LANG_RIGHT_TO_LEFT 0x00000001\r | |
186 | \r | |
187 | //\r | |
188 | // A string package is used to localize strings to a particular\r | |
189 | // language. The package is associated with a particular driver\r | |
190 | // or set of drivers. Tools are used to associate tokens with\r | |
191 | // string references in forms and in programs. These tokens are\r | |
192 | // language agnostic. When paired with a language pack (directly\r | |
193 | // or indirectly), the string token resolves into an actual\r | |
194 | // UNICODE string. The NumStringPointers determines how many\r | |
195 | // StringPointers (offset values) there are as well as the total\r | |
196 | // number of Strings that are defined.\r | |
197 | //\r | |
198 | typedef struct {\r | |
199 | EFI_HII_PACK_HEADER Header;\r | |
200 | RELOFST LanguageNameString;\r | |
201 | RELOFST PrintableLanguageName;\r | |
202 | UINT32 NumStringPointers;\r | |
203 | UINT32 Attributes;\r | |
204 | //\r | |
205 | // RELOFST StringPointers[];\r | |
206 | // EFI_STRING Strings[];\r | |
207 | //\r | |
208 | } EFI_HII_STRING_PACK;\r | |
209 | \r | |
210 | //\r | |
211 | // Glyph Attributes\r | |
212 | //\r | |
213 | #define EFI_GLYPH_NON_SPACING 1\r | |
214 | #define EFI_GLYPH_WIDE 2\r | |
215 | \r | |
216 | typedef struct {\r | |
217 | CHAR16 UnicodeWeight;\r | |
218 | UINT8 Attributes;\r | |
219 | UINT8 GlyphCol1[GLYPH_HEIGHT];\r | |
220 | } EFI_NARROW_GLYPH;\r | |
221 | \r | |
222 | typedef struct {\r | |
223 | CHAR16 UnicodeWeight;\r | |
224 | UINT8 Attributes;\r | |
225 | UINT8 GlyphCol1[GLYPH_HEIGHT];\r | |
226 | UINT8 GlyphCol2[GLYPH_HEIGHT];\r | |
227 | UINT8 Pad[3];\r | |
228 | } EFI_WIDE_GLYPH;\r | |
229 | \r | |
230 | //\r | |
231 | // A font list consists of a font header followed by a series\r | |
232 | // of glyph structures. Note that fonts are not language specific.\r | |
233 | //\r | |
234 | typedef struct {\r | |
235 | EFI_HII_PACK_HEADER Header;\r | |
236 | UINT16 NumberOfNarrowGlyphs;\r | |
237 | UINT16 NumberOfWideGlyphs;\r | |
238 | } EFI_HII_FONT_PACK;\r | |
239 | \r | |
240 | //\r | |
241 | // The IfrData in the EFI_HII_IFR_PACK structure definition\r | |
242 | // is variable length, and not really part of the header. To\r | |
243 | // simplify from code the size of the header, define an\r | |
244 | // identical structure that does not include the IfrData field.\r | |
245 | // Then use sizeof() this new structure to determine the\r | |
246 | // actual size of the header.\r | |
247 | //\r | |
248 | typedef struct {\r | |
249 | EFI_HII_PACK_HEADER Header;\r | |
250 | } EFI_HII_IFR_PACK_HEADER;\r | |
251 | \r | |
252 | //\r | |
253 | // pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;\r | |
254 | //\r | |
255 | typedef enum {\r | |
256 | EfiKeyLCtrl,\r | |
257 | EfiKeyA0,\r | |
258 | EfiKeyLAlt,\r | |
259 | EfiKeySpaceBar,\r | |
260 | EfiKeyA2,\r | |
261 | EfiKeyA3,\r | |
262 | EfiKeyA4,\r | |
263 | EfiKeyRCtrl,\r | |
264 | EfiKeyLeftArrow,\r | |
265 | EfiKeyDownArrow,\r | |
266 | EfiKeyRightArrow,\r | |
267 | EfiKeyZero,\r | |
268 | EfiKeyPeriod,\r | |
269 | EfiKeyEnter,\r | |
270 | EfiKeyLShift,\r | |
271 | EfiKeyB0,\r | |
272 | EfiKeyB1,\r | |
273 | EfiKeyB2,\r | |
274 | EfiKeyB3,\r | |
275 | EfiKeyB4,\r | |
276 | EfiKeyB5,\r | |
277 | EfiKeyB6,\r | |
278 | EfiKeyB7,\r | |
279 | EfiKeyB8,\r | |
280 | EfiKeyB9,\r | |
281 | EfiKeyB10,\r | |
282 | EfiKeyRshift,\r | |
283 | EfiKeyUpArrow,\r | |
284 | EfiKeyOne,\r | |
285 | EfiKeyTwo,\r | |
286 | EfiKeyThree,\r | |
287 | EfiKeyCapsLock,\r | |
288 | EfiKeyC1,\r | |
289 | EfiKeyC2,\r | |
290 | EfiKeyC3,\r | |
291 | EfiKeyC4,\r | |
292 | EfiKeyC5,\r | |
293 | EfiKeyC6,\r | |
294 | EfiKeyC7,\r | |
295 | EfiKeyC8,\r | |
296 | EfiKeyC9,\r | |
297 | EfiKeyC10,\r | |
298 | EfiKeyC11,\r | |
299 | EfiKeyC12,\r | |
300 | EfiKeyFour,\r | |
301 | EfiKeyFive,\r | |
302 | EfiKeySix,\r | |
303 | EfiKeyPlus,\r | |
304 | EfiKeyTab,\r | |
305 | EfiKeyD1,\r | |
306 | EfiKeyD2,\r | |
307 | EfiKeyD3,\r | |
308 | EfiKeyD4,\r | |
309 | EfiKeyD5,\r | |
310 | EfiKeyD6,\r | |
311 | EfiKeyD7,\r | |
312 | EfiKeyD8,\r | |
313 | EfiKeyD9,\r | |
314 | EfiKeyD10,\r | |
315 | EfiKeyD11,\r | |
316 | EfiKeyD12,\r | |
317 | EfiKeyD13,\r | |
318 | EfiKeyDel,\r | |
319 | EfiKeyEnd,\r | |
320 | EfiKeyPgDn,\r | |
321 | EfiKeySeven,\r | |
322 | EfiKeyEight,\r | |
323 | EfiKeyNine,\r | |
324 | EfiKeyE0,\r | |
325 | EfiKeyE1,\r | |
326 | EfiKeyE2,\r | |
327 | EfiKeyE3,\r | |
328 | EfiKeyE4,\r | |
329 | EfiKeyE5,\r | |
330 | EfiKeyE6,\r | |
331 | EfiKeyE7,\r | |
332 | EfiKeyE8,\r | |
333 | EfiKeyE9,\r | |
334 | EfiKeyE10,\r | |
335 | EfiKeyE11,\r | |
336 | EfiKeyE12,\r | |
337 | EfiKeyBackSpace,\r | |
338 | EfiKeyIns,\r | |
339 | EfiKeyHome,\r | |
340 | EfiKeyPgUp,\r | |
341 | EfiKeyNLck,\r | |
342 | EfiKeySlash,\r | |
343 | EfiKeyAsterisk,\r | |
344 | EfiKeyMinus,\r | |
345 | EfiKeyEsc,\r | |
346 | EfiKeyF1,\r | |
347 | EfiKeyF2,\r | |
348 | EfiKeyF3,\r | |
349 | EfiKeyF4,\r | |
350 | EfiKeyF5,\r | |
351 | EfiKeyF6,\r | |
352 | EfiKeyF7,\r | |
353 | EfiKeyF8,\r | |
354 | EfiKeyF9,\r | |
355 | EfiKeyF10,\r | |
356 | EfiKeyF11,\r | |
357 | EfiKeyF12,\r | |
358 | EfiKeyPrint,\r | |
359 | EfiKeySLck,\r | |
360 | EfiKeyPause\r | |
361 | } EFI_KEY;\r | |
362 | \r | |
363 | typedef struct {\r | |
364 | EFI_KEY Key;\r | |
365 | CHAR16 Unicode;\r | |
366 | CHAR16 ShiftedUnicode;\r | |
367 | CHAR16 AltGrUnicode;\r | |
368 | CHAR16 ShiftedAltGrUnicode;\r | |
369 | UINT16 Modifier;\r | |
370 | } EFI_KEY_DESCRIPTOR;\r | |
371 | \r | |
372 | //\r | |
373 | // This structure allows a sparse set of keys to be redefined\r | |
374 | // or a complete redefinition of the keyboard layout. Most\r | |
375 | // keyboards have a lot of commonality in their layouts, therefore\r | |
376 | // only defining those keys that need to change from the default\r | |
377 | // minimizes the passed in information.\r | |
378 | //\r | |
379 | // Additionally, when an update occurs, the active keyboard layout\r | |
380 | // will be switched to the newly updated keyboard layout. This\r | |
381 | // allows for situations that when a keyboard layout driver is\r | |
382 | // loaded as part of system initialization, the system will default\r | |
383 | // the keyboard behavior to the new layout.\r | |
384 | //\r | |
385 | // Each call to update the keyboard mapping should contain the\r | |
386 | // complete set of key descriptors to be updated, since every\r | |
387 | // call to the HII which contains an EFI_HII_KEYBOARD_PACK will\r | |
388 | // wipe the previous set of overrides. A call to\r | |
389 | //\r | |
390 | typedef struct {\r | |
391 | EFI_HII_PACK_HEADER Header;\r | |
392 | EFI_KEY_DESCRIPTOR *Descriptor;\r | |
393 | UINT8 DescriptorCount;\r | |
394 | } EFI_HII_KEYBOARD_PACK;\r | |
395 | \r | |
396 | //\r | |
397 | // The EFI_HII_PACKAGES can contain different types of packages just\r | |
398 | // after the structure as inline data.\r | |
399 | //\r | |
400 | typedef struct {\r | |
401 | UINTN NumberOfPackages;\r | |
402 | EFI_GUID *GuidId;\r | |
403 | //\r | |
404 | // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.\r | |
405 | // EFI_HII_IFR_PACK *IfrPack; // Only one pack.\r | |
406 | // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok\r | |
407 | // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok\r | |
408 | // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok\r | |
409 | //\r | |
410 | } EFI_HII_PACKAGES;\r | |
411 | \r | |
412 | typedef struct _EFI_HII_VARIABLE_PACK_LIST {\r | |
413 | struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;\r | |
414 | EFI_HII_VARIABLE_PACK *VariablePack;\r | |
415 | } EFI_HII_VARIABLE_PACK_LIST;\r | |
416 | \r | |
417 | #pragma pack()\r | |
418 | \r | |
419 | /**\r | |
420 | Registers the various packs that are passed in via the Packages parameter.\r | |
421 | \r | |
422 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
423 | @param Packages A pointer to an EFI_HII_PACKAGES package instance.\r | |
424 | @param Handle A pointer to the EFI_HII_HANDLE instance.\r | |
425 | \r | |
426 | @retval EFI_SUCCESS Data was extracted from Packages, the database\r | |
427 | was updated with the data, and Handle returned successfully.\r | |
428 | @retval EFI_INVALID_PARAMETER The content of Packages was invalid.\r | |
429 | \r | |
430 | **/\r | |
431 | typedef\r | |
432 | EFI_STATUS\r | |
433 | (EFIAPI *EFI_HII_NEW_PACK) (\r | |
434 | IN EFI_HII_PROTOCOL *This,\r | |
435 | IN EFI_HII_PACKAGES *Packages,\r | |
436 | OUT EFI_HII_HANDLE *Handle\r | |
437 | );\r | |
438 | \r | |
439 | /**\r | |
440 | Removes a package from the HII database.\r | |
441 | \r | |
442 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
443 | @param Handle The handle that was registered to the data that is requested\r | |
444 | for removal.\r | |
445 | \r | |
446 | @retval EFI_SUCCESS The data associated with the Handle was removed\r | |
447 | from the HII database.\r | |
448 | @retval EFI_INVALID_PARAMETER The Handle was not valid.\r | |
449 | \r | |
450 | **/\r | |
451 | typedef\r | |
452 | EFI_STATUS\r | |
453 | (EFIAPI *EFI_HII_REMOVE_PACK) (\r | |
454 | IN EFI_HII_PROTOCOL *This,\r | |
455 | IN EFI_HII_HANDLE Handle\r | |
456 | );\r | |
457 | \r | |
458 | /**\r | |
459 | Determines the handles that are currently active in the database.\r | |
460 | \r | |
461 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
462 | @param HandleBufferLength On input, a pointer to the length of the handle\r | |
463 | buffer. On output, the length of the handle buffer that is required\r | |
464 | for the handles found.\r | |
465 | @param Handle An array of EFI_HII_HANDLE instances returned.\r | |
466 | \r | |
467 | @retval EFI_SUCCESS Handle was updated successfully.\r | |
468 | @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates\r | |
469 | that Handle is too small to support the number of handles.\r | |
470 | \r | |
471 | **/\r | |
472 | typedef\r | |
473 | EFI_STATUS\r | |
474 | (EFIAPI *EFI_HII_FIND_HANDLES) (\r | |
475 | IN EFI_HII_PROTOCOL *This,\r | |
476 | IN OUT UINT16 *HandleBufferLength,\r | |
477 | OUT EFI_HII_HANDLE *Handle\r | |
478 | );\r | |
479 | \r | |
480 | /**\r | |
481 | Exports the contents of the database into a buffer.\r | |
482 | \r | |
483 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
484 | @param Handle An EFI_HII_HANDLE that corresponds to the desired\r | |
485 | handle to export. If the value is 0, the entire database will be exported.\r | |
486 | In either case, the data will be exported in a format described by the\r | |
487 | structure definition of EFI_HII_EXPORT_TABLE.\r | |
488 | @param BufferSize\r | |
489 | On input, a pointer to the length of the buffer. On output, the length\r | |
490 | of the buffer that is required for the export data.\r | |
491 | @param Buffer A pointer to a buffer that will contain the results of the export function.\r | |
492 | \r | |
493 | @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.\r | |
494 | @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.\r | |
495 | \r | |
496 | **/\r | |
497 | typedef\r | |
498 | EFI_STATUS\r | |
499 | (EFIAPI *EFI_HII_EXPORT) (\r | |
500 | IN EFI_HII_PROTOCOL *This,\r | |
501 | IN EFI_HII_HANDLE Handle,\r | |
502 | IN OUT UINTN *BufferSize,\r | |
503 | OUT VOID *Buffer\r | |
504 | );\r | |
505 | \r | |
506 | /**\r | |
507 | Remove any new strings that were added after the initial string export\r | |
508 | for this handle.\r | |
509 | \r | |
510 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
511 | @param Handle The handle on which the string resides.\r | |
512 | \r | |
513 | @retval EFI_SUCCESS Remove strings from the handle successfully.\r | |
514 | @retval EFI_INVALID_PARAMETER The Handle was unknown.\r | |
515 | \r | |
516 | **/\r | |
517 | typedef\r | |
518 | EFI_STATUS\r | |
519 | (EFIAPI *EFI_HII_RESET_STRINGS) (\r | |
520 | IN EFI_HII_PROTOCOL *This,\r | |
521 | IN EFI_HII_HANDLE Handle\r | |
522 | );\r | |
523 | \r | |
524 | /**\r | |
525 | Tests if all of the characters in a string have corresponding font characters.\r | |
526 | \r | |
527 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
528 | @param StringToTest A pointer to a Unicode string.\r | |
529 | @param FirstMissing A pointer to an index into the string. On input,\r | |
530 | the index of the first character in the StringToTest to examine. On exit,\r | |
531 | the index of the first character encountered for which a glyph is unavailable.\r | |
532 | If all glyphs in the string are available, the index is the index of the\r | |
533 | terminator of the string.\r | |
534 | @param GlyphBufferSize A pointer to a value. On output, if the function\r | |
535 | returns EFI_SUCCESS, it contains the amount of memory that is required to\r | |
536 | store the string's glyph equivalent.\r | |
537 | \r | |
538 | @retval EFI_SUCCESS All glyphs are available. Note that an empty string\r | |
539 | always returns this value.\r | |
540 | @retval EFI_NOT_FOUND A glyph was not found for a character.\r | |
541 | \r | |
542 | **/\r | |
543 | typedef\r | |
544 | EFI_STATUS\r | |
545 | (EFIAPI *EFI_HII_TEST_STRING) (\r | |
546 | IN EFI_HII_PROTOCOL *This,\r | |
547 | IN CHAR16 *StringToTest,\r | |
548 | IN OUT UINT32 *FirstMissing,\r | |
549 | OUT UINT32 *GlyphBufferSize\r | |
550 | );\r | |
551 | \r | |
552 | /**\r | |
553 | Translates a Unicode character into the corresponding font glyph.\r | |
554 | \r | |
555 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
556 | @param Source A pointer to a Unicode string.\r | |
557 | @param Index On input, the offset into the string from which to fetch\r | |
558 | the character.On successful completion, the index is updated to the first\r | |
559 | character past the character(s) making up the just extracted glyph.\r | |
560 | @param GlyphBuffer Pointer to an array where the glyphs corresponding\r | |
561 | to the characters in the source may be stored. GlyphBuffer is assumed\r | |
562 | to be wide enough to accept a wide glyph character.\r | |
563 | @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by\r | |
564 | this value is filled with the length of the glyph in pixels. It is unchanged\r | |
565 | if the call was unsuccessful.\r | |
566 | @param InternalStatus The cell pointed to by this parameter must be\r | |
567 | initialized to zero prior to invoking the call the first time for any string.\r | |
568 | \r | |
569 | @retval EFI_SUCCESS It worked.\r | |
570 | @retval EFI_NOT_FOUND A glyph for a character was not found.\r | |
571 | \r | |
572 | **/\r | |
573 | typedef\r | |
574 | EFI_STATUS\r | |
575 | (EFIAPI *EFI_HII_GET_GLYPH) (\r | |
576 | IN EFI_HII_PROTOCOL *This,\r | |
577 | IN CHAR16 *Source,\r | |
578 | IN OUT UINT16 *Index,\r | |
579 | OUT UINT8 **GlyphBuffer,\r | |
580 | OUT UINT16 *BitWidth,\r | |
581 | IN OUT UINT32 *InternalStatus\r | |
582 | );\r | |
583 | \r | |
584 | /**\r | |
585 | Translates a glyph into the format required for input to the Universal\r | |
586 | Graphics Adapter (UGA) Block Transfer (BLT) routines.\r | |
587 | \r | |
588 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
589 | @param GlyphBuffer A pointer to the buffer that contains glyph data.\r | |
590 | @param Foreground The foreground setting requested to be used for the\r | |
591 | generated BltBuffer data.\r | |
592 | @param Background The background setting requested to be used for the\r | |
593 | generated BltBuffer data.\r | |
594 | @param Count The entry in the BltBuffer upon which to act.\r | |
595 | @param Width The width in bits of the glyph being converted.\r | |
596 | @param Height The height in bits of the glyph being converted\r | |
597 | @param BltBuffer A pointer to the buffer that contains the data that is\r | |
598 | ready to be used by the UGA BLT routines.\r | |
599 | \r | |
600 | @retval EFI_SUCCESS It worked.\r | |
601 | @retval EFI_NOT_FOUND A glyph for a character was not found.\r | |
602 | \r | |
603 | **/\r | |
604 | typedef\r | |
605 | EFI_STATUS\r | |
606 | (EFIAPI *EFI_HII_GLYPH_TO_BLT) (\r | |
607 | IN EFI_HII_PROTOCOL *This,\r | |
608 | IN UINT8 *GlyphBuffer,\r | |
609 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,\r | |
610 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,\r | |
611 | IN UINTN Count,\r | |
612 | IN UINTN Width,\r | |
613 | IN UINTN Height,\r | |
614 | IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer\r | |
615 | );\r | |
616 | \r | |
617 | /**\r | |
618 | Allows a new string to be added to an already existing string package.\r | |
619 | \r | |
620 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
621 | @param Pointer to a NULL-terminated string containing a single ISO 639-2\r | |
622 | language identifier, indicating the language in which the string is translated.\r | |
623 | @param Handle The handle of the language pack to which the string is to be added.\r | |
624 | @param Reference The identifier of the string to be added. If the reference\r | |
625 | value is zero, then the string will be assigned a new identifier on that\r | |
626 | handle for the language specified. Otherwise, the string will be updated\r | |
627 | with the NewString Value.\r | |
628 | @param NewString The string to be added.\r | |
629 | \r | |
630 | @retval EFI_SUCCESS The string was effectively registered.\r | |
631 | @retval EFI_INVALID_PARAMETER The Handle was unknown.\r | |
632 | \r | |
633 | **/\r | |
634 | typedef\r | |
635 | EFI_STATUS\r | |
636 | (EFIAPI *EFI_HII_NEW_STRING) (\r | |
637 | IN EFI_HII_PROTOCOL *This,\r | |
638 | IN CHAR16 *Language,\r | |
639 | IN EFI_HII_HANDLE Handle,\r | |
640 | IN OUT STRING_REF *Reference,\r | |
641 | IN CHAR16 *NewString\r | |
642 | );\r | |
643 | \r | |
644 | /**\r | |
645 | Allows a program to determine the primary languages that are supported\r | |
646 | on a given handle.\r | |
647 | \r | |
648 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
649 | @param Handle The handle on which the strings reside.\r | |
650 | @param LanguageString A string allocated by GetPrimaryLanguages() that\r | |
651 | contains a list of all primary languages registered on the handle.\r | |
652 | \r | |
653 | @retval EFI_SUCCESS LanguageString was correctly returned.\r | |
654 | @retval EFI_INVALID_PARAMETER The Handle was unknown.\r | |
655 | \r | |
656 | **/\r | |
657 | typedef\r | |
658 | EFI_STATUS\r | |
659 | (EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (\r | |
660 | IN EFI_HII_PROTOCOL *This,\r | |
661 | IN EFI_HII_HANDLE Handle,\r | |
662 | OUT EFI_STRING *LanguageString\r | |
663 | );\r | |
664 | \r | |
665 | /**\r | |
666 | Allows a program to determine which secondary languages are supported\r | |
667 | on a given handle for a given primary language.\r | |
668 | \r | |
669 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
670 | @param Handle The handle on which the strings reside.\r | |
671 | @param PrimaryLanguage Pointer to a NULL-terminated string containing a single\r | |
672 | ISO 639-2 language identifier, indicating the primary language.\r | |
673 | @param LanguageString A string allocated by GetSecondaryLanguages()\r | |
674 | containing a list of all secondary languages registered on the handle.\r | |
675 | \r | |
676 | @retval EFI_SUCCESS LanguageString was correctly returned.\r | |
677 | @retval EFI_INVALID_PARAMETER The Handle was unknown.\r | |
678 | \r | |
679 | **/\r | |
680 | typedef\r | |
681 | EFI_STATUS\r | |
682 | (EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (\r | |
683 | IN EFI_HII_PROTOCOL *This,\r | |
684 | IN EFI_HII_HANDLE Handle,\r | |
685 | IN CHAR16 *PrimaryLanguage,\r | |
686 | OUT EFI_STRING *LanguageString\r | |
687 | );\r | |
688 | \r | |
689 | /**\r | |
690 | Extracts a string from a package already registered with the EFI HII database.\r | |
691 | \r | |
692 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
693 | @param Handle The handle on which the string resides.\r | |
694 | @param Token The string token assigned to the string.\r | |
695 | @param Raw If TRUE, the string is returned unedited in the internal\r | |
696 | storage format described above. If false, the string returned is edited\r | |
697 | by replacing <cr> with <space> and by removing special characters such\r | |
698 | as the <wide> prefix.\r | |
699 | @param LanguageString Pointer to a NULL-terminated string containing a\r | |
700 | single ISO 639-2 language identifier, indicating the language to print.\r | |
701 | If the LanguageString is empty (starts with a NULL), the default system\r | |
702 | language will be used to determine the language.\r | |
703 | @param BufferLength Length of the StringBuffer.\r | |
704 | @param StringBuffer The buffer designed to receive the characters in the string.\r | |
705 | \r | |
706 | @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.\r | |
707 | @retval EFI_INVALID_PARAMETER The handle or string token is unknown.\r | |
708 | @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to\r | |
709 | allow the entire string to be stored.\r | |
710 | \r | |
711 | **/\r | |
712 | typedef\r | |
713 | EFI_STATUS\r | |
714 | (EFIAPI *EFI_HII_GET_STRING) (\r | |
715 | IN EFI_HII_PROTOCOL *This,\r | |
716 | IN EFI_HII_HANDLE Handle,\r | |
717 | IN STRING_REF Token,\r | |
718 | IN BOOLEAN Raw,\r | |
719 | IN CHAR16 *LanguageString,\r | |
720 | IN OUT UINTN *BufferLength,\r | |
721 | OUT EFI_STRING StringBuffer\r | |
722 | );\r | |
723 | \r | |
724 | /**\r | |
725 | Allows a program to extract a part of a string of not more than a given width.\r | |
726 | \r | |
727 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
728 | @param Handle The handle on which the string resides.\r | |
729 | @param Token The string token assigned to the string.\r | |
730 | @param Index On input, the offset into the string where the line is to start.\r | |
731 | On output, the index is updated to point to beyond the last character returned\r | |
732 | in the call.\r | |
733 | @param LineWidth The maximum width of the line in units of narrow glyphs.\r | |
734 | @param LanguageString Pointer to a NULL-terminated string containing a\r | |
735 | single ISO 639-2 language identifier, indicating the language to print.\r | |
736 | @param BufferLength Pointer to the length of the StringBuffer.\r | |
737 | @param StringBuffer The buffer designed to receive the characters in the string.\r | |
738 | \r | |
739 | @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.\r | |
740 | @retval EFI_NOT_FOUND The font glyph for at least one of the characters in\r | |
741 | the string is not in the font database.\r | |
742 | @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough\r | |
743 | to allow the entire string to be stored.\r | |
744 | \r | |
745 | **/\r | |
746 | typedef\r | |
747 | EFI_STATUS\r | |
748 | (EFIAPI *EFI_HII_GET_LINE) (\r | |
749 | IN EFI_HII_PROTOCOL *This,\r | |
750 | IN EFI_HII_HANDLE Handle,\r | |
751 | IN STRING_REF Token,\r | |
752 | IN OUT UINT16 *Index,\r | |
753 | IN UINT16 LineWidth,\r | |
754 | IN CHAR16 *LanguageString,\r | |
755 | IN OUT UINT16 *BufferLength,\r | |
756 | OUT EFI_STRING StringBuffer\r | |
757 | );\r | |
758 | \r | |
759 | /**\r | |
760 | Allows a program to extract a form or form package that has previously\r | |
761 | been registered with the HII database.\r | |
762 | \r | |
763 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
764 | @param Handle Handle on which the form resides.\r | |
765 | @param FormId The ID of the form to return. If the ID is zero,\r | |
766 | the entire form package is returned.\r | |
767 | @param BufferLength On input, the length of the Buffer. On output,\r | |
768 | the length of the returned buffer,\r | |
769 | @param Buffer The buffer designed to receive the form(s).\r | |
770 | \r | |
771 | @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength\r | |
772 | was updated.\r | |
773 | @retval EFI_INVALID_PARAMETER The handle is unknown.\r | |
774 | @retval EFI_NOT_FOUND A form on the requested handle cannot be found with\r | |
775 | the requested FormId.\r | |
776 | @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough\r | |
777 | to allow the form to be stored.\r | |
778 | \r | |
779 | **/\r | |
780 | typedef\r | |
781 | EFI_STATUS\r | |
782 | (EFIAPI *EFI_HII_GET_FORMS) (\r | |
783 | IN EFI_HII_PROTOCOL *This,\r | |
784 | IN EFI_HII_HANDLE Handle,\r | |
785 | IN EFI_FORM_ID FormId,\r | |
786 | IN OUT UINTN *BufferLength,\r | |
787 | OUT UINT8 *Buffer\r | |
788 | );\r | |
789 | \r | |
790 | /**\r | |
791 | Extracts the defaults that are associated with a given handle in the HII database.\r | |
792 | \r | |
793 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
794 | @param Handle The HII handle from which will have default data retrieved.\r | |
795 | @param DefaultMask The mask used to specify some type of default override when extracting\r | |
796 | the default image data.\r | |
797 | @param VariablePackList A indirect pointer to the first entry of a link list with\r | |
798 | type EFI_HII_VARIABLE_PACK_LIST.\r | |
799 | \r | |
800 | @retval EFI_SUCCESS The VariablePackList was populated with the appropriate\r | |
801 | default setting data.\r | |
802 | @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).\r | |
803 | @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle\r | |
804 | contain invalid data.\r | |
805 | \r | |
806 | **/\r | |
807 | typedef\r | |
808 | EFI_STATUS\r | |
809 | (EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (\r | |
810 | IN EFI_HII_PROTOCOL *This,\r | |
811 | IN EFI_HII_HANDLE Handle,\r | |
812 | IN UINTN DefaultMask,\r | |
813 | OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r | |
814 | );\r | |
815 | \r | |
816 | /**\r | |
817 | Allows the caller to update a form or form package that has previously been\r | |
818 | registered with the EFI HII database.\r | |
819 | \r | |
820 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
821 | @param Handle Handle of the package where the form to be updated resides.\r | |
822 | @param Label The label inside the form package where the update is to take place.\r | |
823 | @param AddData If TRUE, adding data at a given Label; otherwise,\r | |
824 | if FALSE, removing data at a given Label.\r | |
825 | @param Data The buffer containing the new tags to insert after the Label\r | |
826 | \r | |
827 | @retval EFI_SUCCESS The form was updated with the new tags.\r | |
828 | @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not\r | |
829 | contain an integral number of tags.\r | |
830 | @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.\r | |
831 | \r | |
832 | **/\r | |
833 | typedef\r | |
834 | EFI_STATUS\r | |
835 | (EFIAPI *EFI_HII_UPDATE_FORM) (\r | |
836 | IN EFI_HII_PROTOCOL *This,\r | |
837 | IN EFI_HII_HANDLE Handle,\r | |
838 | IN EFI_FORM_LABEL Label,\r | |
839 | IN BOOLEAN AddData,\r | |
840 | IN EFI_HII_UPDATE_DATA *Data\r | |
841 | );\r | |
842 | \r | |
843 | /**\r | |
844 | Retrieves the current keyboard layout.\r | |
845 | \r | |
846 | @param This A pointer to the EFI_HII_PROTOCOL instance.\r | |
847 | @param DescriptorCount A pointer to the number of Descriptor entries being\r | |
848 | described in the keyboard layout being retrieved.\r | |
849 | @param Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR\r | |
850 | entries. Each entry will reflect the definition of a specific physical key.\r | |
851 | \r | |
852 | @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r | |
853 | \r | |
854 | **/\r | |
855 | typedef\r | |
856 | EFI_STATUS\r | |
857 | (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r | |
858 | IN EFI_HII_PROTOCOL *This,\r | |
859 | OUT UINT16 *DescriptorCount,\r | |
860 | OUT EFI_KEY_DESCRIPTOR *Descriptor\r | |
861 | );\r | |
862 | \r | |
863 | /**\r | |
864 | @par Protocol Description:\r | |
865 | The HII Protocol manages the HII database, which is a repository for data\r | |
866 | having to do with fonts, strings, forms, keyboards, and other future human\r | |
867 | interface items.\r | |
868 | \r | |
869 | @param NewPack\r | |
870 | Extracts the various packs from a package list.\r | |
871 | \r | |
872 | @param RemovePack\r | |
873 | Removes a package from the HII database.\r | |
874 | \r | |
875 | @param FindHandles\r | |
876 | Determines the handles that are currently active in the database.\r | |
877 | \r | |
878 | @param ExportDatabase\r | |
879 | Export the entire contents of the database to a buffer.\r | |
880 | \r | |
881 | @param TestString\r | |
882 | Tests if all of the characters in a string have corresponding font characters.\r | |
883 | \r | |
884 | @param GetGlyph\r | |
885 | Translates a Unicode character into the corresponding font glyph.\r | |
886 | \r | |
887 | @param GlyphToBlt\r | |
888 | Converts a glyph value into a format that is ready for a UGA BLT command.\r | |
889 | \r | |
890 | @param NewString\r | |
891 | Allows a new string to be added to an already existing string package.\r | |
892 | \r | |
893 | @param GetPrimaryLanguages\r | |
894 | Allows a program to determine the primary languages that are supported\r | |
895 | on a given handle.\r | |
896 | \r | |
897 | @param GetSecondaryLanguages\r | |
898 | Allows a program to determine which secondary languages are supported\r | |
899 | on a given handle for a given primary language.\r | |
900 | \r | |
901 | @param GetString\r | |
902 | Extracts a string from a package that is already registered with the\r | |
903 | EFI HII database.\r | |
904 | \r | |
905 | @param ResetString\r | |
906 | Remove any new strings that were added after the initial string export\r | |
907 | for this handle.\r | |
908 | \r | |
909 | @param GetLine\r | |
910 | Allows a program to extract a part of a string of not more than a given width.\r | |
911 | \r | |
912 | @param GetForms\r | |
913 | Allows a program to extract a form or form package that has been previously registered.\r | |
914 | \r | |
915 | @param GetDefaultImage\r | |
916 | Allows a program to extract the nonvolatile image that represents the default storage image.\r | |
917 | \r | |
918 | @param UpdateForm\r | |
919 | Allows a program to update a previously registered form.\r | |
920 | \r | |
921 | @param GetKeyboardLayout\r | |
922 | Allows a program to extract the current keyboard layout.\r | |
923 | \r | |
924 | **/\r | |
925 | struct _EFI_HII_PROTOCOL {\r | |
926 | EFI_HII_NEW_PACK NewPack;\r | |
927 | EFI_HII_REMOVE_PACK RemovePack;\r | |
928 | EFI_HII_FIND_HANDLES FindHandles;\r | |
929 | EFI_HII_EXPORT ExportDatabase;\r | |
930 | \r | |
931 | EFI_HII_TEST_STRING TestString;\r | |
932 | EFI_HII_GET_GLYPH GetGlyph;\r | |
933 | EFI_HII_GLYPH_TO_BLT GlyphToBlt;\r | |
934 | \r | |
935 | EFI_HII_NEW_STRING NewString;\r | |
936 | EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;\r | |
937 | EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;\r | |
938 | EFI_HII_GET_STRING GetString;\r | |
939 | EFI_HII_RESET_STRINGS ResetStrings;\r | |
940 | EFI_HII_GET_LINE GetLine;\r | |
941 | EFI_HII_GET_FORMS GetForms;\r | |
942 | EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;\r | |
943 | EFI_HII_UPDATE_FORM UpdateForm;\r | |
944 | \r | |
945 | EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r | |
946 | };\r | |
947 | \r | |
948 | extern EFI_GUID gEfiHiiProtocolGuid;\r | |
949 | \r | |
950 | #endif\r |