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