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