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