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