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