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