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