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