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