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