]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/FrameworkHii.h
Code clean up to match with Framework HII 0.92 spec. Add comments for mismatches...
[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. This protocol is defined in the.
5 Intel Platform Innovation Framework for EFI Human Interface Infrastructure
6 Specification Version 0.92.
7
8 Copyright (c) 2007 - 2009, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 **/
18
19 #ifndef _FRAMEWORK_HII_H_
20 #define _FRAMEWORK_HII_H_
21
22 #include <PiDxe.h>
23
24 //
25 // To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,
26 // is defined in MdePkg/Protocol/GraphicsOutput.h
27 //
28 #include <Protocol/GraphicsOutput.h>
29
30 ///
31 /// In both EDK and EDK II, incompatbile change is done to Framework HII protocol.
32 /// This change should cause a change of GUID in both of code and HII spec. But we
33 /// update the GUID in code in EDK and EDK II. The 0.92 spec is not updated. This
34 /// is a known issue.
35 ///
36 ///
37 /// Note that EFI_HII_PROTOCOL_GUID is different from that defined in the Framework HII
38 /// 0.92 spec because the spec changed part of HII interfaces but did not update the protocol
39 /// GUID.
40 ///
41 #define EFI_HII_PROTOCOL_GUID \
42 { \
43 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
44 }
45
46 #define EFI_HII_COMPATIBILITY_PROTOCOL_GUID \
47 { \
48 0x5542cce1, 0xdf5c, 0x4d1b, { 0xab, 0xca, 0x36, 0x4f, 0x77, 0xd3, 0x99, 0xfb } \
49 }
50
51 typedef UINT16 STRING_REF;
52 typedef UINT32 RELOFST;
53
54 typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
55
56 ///
57 /// Note: Name difference between code and the Framework HII 0.92 spec.
58 /// Add FRAMEWORK_ prefix to avoid name confict with EFI_HII_HANDLE defined in the
59 /// UEFI 2.1d spec.
60 ///
61 typedef UINT16 FRAMEWORK_EFI_HII_HANDLE;
62
63 ///
64 /// HII package type values
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; ///< The size of the package in bytes.
93 UINT16 Type; ///< The type of the package.
94 } EFI_HII_PACK_HEADER;
95
96 ///
97 /// IFR package structure.
98 /// Immediately following the EFI_HII_IFR_PACK structure will be a series of IFR opcodes.
99 ///
100 typedef struct {
101 EFI_HII_PACK_HEADER Header; ///< Header of the IFR package.
102 } EFI_HII_IFR_PACK;
103
104 ///
105 /// HII Handle package structure.
106 ///
107 typedef struct {
108 ///
109 /// Header of the package.
110 ///
111 EFI_HII_PACK_HEADER Header; // Must be filled in
112 ///
113 /// The image handle of the driver to which the package is referring.
114 ///
115 EFI_HANDLE ImageHandle; // Must be filled in
116 ///
117 /// The handle of the device that is being described by this package.
118 ///
119 EFI_HANDLE DeviceHandle; // Optional
120 ///
121 /// The handle of the parent of the device that is being described by this package.
122 ///
123 EFI_HANDLE ControllerHandle; // Optional
124 ///
125 /// The handle that was registered to receive EFI_FORM_CALLBACK_PROTOCOL calls from other drivers.
126 ///
127 EFI_HANDLE CallbackHandle; // Optional
128 ///
129 /// Note this field is not defined in the Framework HII 0.92 spec.
130 /// Unused. Reserved for source code compatibility.
131 ///
132 EFI_HANDLE COBExportHandle; // Optional
133 } EFI_HII_HANDLE_PACK;
134
135 ///
136 /// Variable package structure.
137 ///
138 typedef struct {
139 ///
140 /// Header of the package.
141 ///
142 EFI_HII_PACK_HEADER Header;
143 ///
144 /// GUID of the EFI variable
145 ///
146 EFI_GUID VariableGuid;
147 ///
148 /// Length in bytes of the EFI variable
149 ///
150 UINT32 VariableNameLength;
151 ///
152 /// The unique value for this variable
153 ///
154 UINT16 VariableId;
155 //
156 // CHAR16 VariableName[]; //Null-terminated
157 //
158 } EFI_HII_VARIABLE_PACK;
159
160 ///
161 /// Device path package structure.
162 ///
163 typedef struct {
164 ///
165 /// Header of the package.
166 ///
167 EFI_HII_PACK_HEADER Header;
168 //
169 // EFI_DEVICE_PATH DevicePath[];
170 //
171 } EFI_HII_DEVICE_PATH_PACK;
172
173 typedef struct {
174 ///
175 /// Unique value that correlates to the original HII handle.
176 ///
177 FRAMEWORK_EFI_HII_HANDLE HiiHandle;
178 ///
179 /// If an IFR pack exists in a data table that does not contain strings,
180 /// then the strings for that IFR pack are located in another data table
181 /// that contains a string pack and has a matching HiiDataTable.PackageGuid.
182 ///
183 EFI_GUID PackageGuid;
184 ///
185 /// Size of the EFI_HII_DATA_TABLE in bytes.
186 ///
187 UINT32 DataTableSize;
188 ///
189 /// Byte offset from the start of this structure to the IFR data.
190 /// If the offset value is 0, then no IFR data is enclosed.
191 ///
192 UINT32 IfrDataOffset;
193 ///
194 /// Byte offset from the start of this structure to the string data.
195 /// If the offset value is 0, then no string data is enclosed.
196 ///
197 UINT32 StringDataOffset;
198 ///
199 /// Byte offset from the start of this structure to the variable data.
200 /// If the offset value is 0, then no variable data is enclosed.
201 ///
202 UINT32 VariableDataOffset;
203 ///
204 /// Byte offset from the start of this structure to the device path data.
205 /// If the offset value is 0, then no DevicePath data is enclosed.
206 ///
207 UINT32 DevicePathOffset;
208 ///
209 /// Number of VariableData[] elements in the array.
210 ///
211 UINT32 NumberOfVariableData;
212 ///
213 /// The number of language string packages.
214 ///
215 UINT32 NumberOfLanguages;
216 //
217 // EFI_HII_DEVICE_PATH_PACK DevicePath[];
218 // EFI_HII_VARIABLE_PACK VariableData[];
219 // EFI_HII_IFR_PACK IfrData;
220 // EFI_HII_STRING_PACK StringData[];
221 //
222 } EFI_HII_DATA_TABLE;
223
224 ///
225 /// Structure defining format for exporting data from the HII Database.
226 ///
227 typedef struct {
228 ///
229 /// Number of EFI_HII_DATA_TABLE entries.
230 ///
231 UINT32 NumberOfHiiDataTables;
232 ///
233 /// Defines the revision of the EFI_HII_DATA_TABLE structure.
234 ///
235 EFI_GUID Revision;
236 //
237 // EFI_HII_DATA_TABLE HiiDataTable[];
238 //
239 } EFI_HII_EXPORT_TABLE;
240
241 ///
242 /// Structure used to pass data to update a form or form package
243 /// that has previously been registered with the EFI HII database.
244 ///
245 typedef struct {
246 ///
247 /// If TRUE, indicates that the FormCallbackHandle value will
248 /// be used to update the contents of the CallBackHandle entry in the form set.
249 ///
250 BOOLEAN FormSetUpdate;
251 ///
252 /// This parameter is valid only when FormSetUpdate is TRUE.
253 /// The value in this parameter will be used to update the contents
254 /// of the CallbackHandle entry in the form set.
255 ///
256 EFI_PHYSICAL_ADDRESS FormCallbackHandle;
257 ///
258 /// If TRUE, indicates that the FormTitle contents will be
259 /// used to update the FormValue's title.
260 ///
261 BOOLEAN FormUpdate;
262 ///
263 /// Specifies which form is to be updated if the FormUpdate value is TRUE.
264 ///
265 UINT16 FormValue;
266 ///
267 /// This parameter is valid only when the FormUpdate parameter is TRUE.
268 /// The value in this parameter will be used to update the contents of the form title.
269 ///
270 STRING_REF FormTitle;
271 ///
272 /// The number of Data entries in this structure.
273 UINT16 DataCount;
274 ///
275 /// An array of 1+ opcodes, specified by DataCount.
276 ///
277 UINT8 *Data;
278 } EFI_HII_UPDATE_DATA;
279
280 //
281 // String attributes
282 //
283 #define LANG_RIGHT_TO_LEFT 0x00000001
284
285 ///
286 /// A string package is used to localize strings to a particular
287 /// language. The package is associated with a particular driver
288 /// or set of drivers. Tools are used to associate tokens with
289 /// string references in forms and in programs. These tokens are
290 /// language agnostic. When paired with a language pack (directly
291 /// or indirectly), the string token resolves into an actual
292 /// UNICODE string. The NumStringPointers determines how many
293 /// StringPointers (offset values) there are as well as the total
294 /// number of Strings that are defined.
295 ///
296 typedef struct {
297 ///
298 /// Header of the package.
299 ///
300 EFI_HII_PACK_HEADER Header;
301 ///
302 /// The string containing one or more ISO 639-2 three-character designator(s)
303 /// of the language or languages whose translations are contained in this language pack.
304 /// The first designator indicates the primary language while the others are secondary languages.
305 ///
306 RELOFST LanguageNameString;
307 ///
308 /// Contains the offset into this structure of a printable name of the language
309 /// for use when prompting the user. The language printed is to be the primary language.
310 ///
311 RELOFST PrintableLanguageName;
312 ///
313 /// The number of Strings and StringPointers contained within the string package.
314 ///
315 UINT32 NumStringPointers;
316 ///
317 /// Indicates the direction the language is to be printed.
318 ///
319 UINT32 Attributes;
320 //
321 // RELOFST StringPointers[];
322 // EFI_STRING Strings[];
323 //
324 } EFI_HII_STRING_PACK;
325
326
327 ///
328 /// A font list consists of a font header followed by a series
329 /// of glyph structures. Note that fonts are not language specific.
330 ///
331 typedef struct {
332 ///
333 /// Header of the package.
334 ///
335 EFI_HII_PACK_HEADER Header;
336 ///
337 /// The number of NarrowGlyphs that are included in the font package.
338 ///
339 UINT16 NumberOfNarrowGlyphs;
340 ///
341 /// The number of WideGlyphs that are included in the font package.
342 ///
343 UINT16 NumberOfWideGlyphs;
344 //EFI_NARROW_GLYPH NarrowGlyphs[];
345 //EFI_WIDE_GLYPH WideGlyphs[];
346 } EFI_HII_FONT_PACK;
347
348 ///
349 /// The definition of a specific physical key
350 ///
351 /// Note: Name difference between code and the Framework HII 0.92 spec.
352 /// Add FRAMEWORK_ prefix to avoid name confict with EFI_KEY_DESCRIPTOR defined in the
353 /// UEFI 2.1d spec.
354 ///
355 typedef struct {
356 ///
357 /// Used to describe a physical key on a keyboard.
358 ///
359 EFI_KEY Key;
360 ///
361 /// Unicode value for the Key.
362 CHAR16 Unicode;
363 ///
364 /// Unicode value for the key with the shift key being held down.
365 ///
366 CHAR16 ShiftedUnicode;
367 ///
368 /// Unicode value for the key with the Alt-GR being held down.
369 ///
370 CHAR16 AltGrUnicode;
371 ///
372 /// Unicode value for the key with the Alt-GR and shift keys being held down.
373 ///
374 CHAR16 ShiftedAltGrUnicode;
375 ///
376 /// Modifier keys are defined to allow for special functionality that
377 /// is not necessarily accomplished by a printable character.
378 ///
379 UINT16 Modifier;
380 } FRAMEWORK_EFI_KEY_DESCRIPTOR;
381
382 ///
383 /// This structure allows a sparse set of keys to be redefined
384 /// or a complete redefinition of the keyboard layout. Most
385 /// keyboards have a lot of commonality in their layouts, therefore
386 /// only defining those keys that need to change from the default
387 /// minimizes the passed in information.
388 ///
389 /// Additionally, when an update occurs, the active keyboard layout
390 /// will be switched to the newly updated keyboard layout. This
391 /// allows for situations that when a keyboard layout driver is
392 /// loaded as part of system initialization, the system will default
393 /// the keyboard behavior to the new layout.
394 ///
395 typedef struct {
396 ///
397 /// Header of the package.
398 EFI_HII_PACK_HEADER Header;
399 ///
400 /// A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR entries.
401 /// Each entry will reflect the definition of a specific physical key.
402 ///
403 FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor;
404 ///
405 /// The number of Descriptor entries being described.
406 ///
407 UINT8 DescriptorCount;
408 } EFI_HII_KEYBOARD_PACK;
409
410 ///
411 /// The packages structure that will be used to pass contents into the HII database.
412 ///
413 /// The EFI_HII_PACKAGES can contain various number of packages of different types just
414 /// after the structure as inline data.
415 ///
416 typedef struct {
417 ///
418 /// The number of packages being defined in this structure.
419 ///
420 UINTN NumberOfPackages;
421 ///
422 /// The GUID to be used to identify this set of packages that are being exported
423 /// to the HII database.
424 ///
425 EFI_GUID *GuidId;
426 //
427 // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
428 // EFI_HII_IFR_PACK *IfrPack; // Only one pack.
429 // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
430 // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
431 // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
432 //
433 } EFI_HII_PACKAGES;
434
435 ///
436 /// Packed link list that contains all the discernable defaults of variables
437 /// for the opcodes that are defined in this Handle's domain of data.
438 ///
439 typedef struct _EFI_HII_VARIABLE_PACK_LIST {
440 ///
441 /// A pointer points to the next data structure of type
442 /// EFI_HII_VARIABLE_PACK_LIST in the packed link list.
443 ///
444 struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
445 ///
446 /// A pointer points to the content of the variable entry defined by GUID/name/data.
447 ///
448 EFI_HII_VARIABLE_PACK *VariablePack;
449 //EFI_HII_VARIABLE_PACK Content
450 } EFI_HII_VARIABLE_PACK_LIST;
451
452
453 #pragma pack()
454
455 /**
456 Registers the various packs that are passed in via the Packages parameter.
457
458 @param This A pointer to the EFI_HII_PROTOCOL instance.
459 @param Packages A pointer to an EFI_HII_PACKAGES package instance.
460 @param Handle A pointer to the FRAMEWORK_EFI_HII_HANDLE instance.
461
462 @retval EFI_SUCCESS Data was extracted from Packages, the database
463 was updated with the data, and Handle returned successfully.
464 @retval EFI_INVALID_PARAMETER The content of Packages was invalid.
465
466 **/
467 typedef
468 EFI_STATUS
469 (EFIAPI *EFI_HII_NEW_PACK)(
470 IN EFI_HII_PROTOCOL *This,
471 IN EFI_HII_PACKAGES *Packages,
472 OUT FRAMEWORK_EFI_HII_HANDLE *Handle
473 );
474
475 /**
476 Removes a package from the HII database.
477
478 @param This A pointer to the EFI_HII_PROTOCOL instance.
479 @param Handle The handle that was registered to the data that is requested
480 for removal.
481
482 @retval EFI_SUCCESS The data associated with the Handle was removed
483 from the HII database.
484 @retval EFI_INVALID_PARAMETER The Handle was not valid.
485
486 **/
487 typedef
488 EFI_STATUS
489 (EFIAPI *EFI_HII_REMOVE_PACK)(
490 IN EFI_HII_PROTOCOL *This,
491 IN FRAMEWORK_EFI_HII_HANDLE Handle
492 );
493
494 /**
495 Determines the handles that are currently active in the database.
496
497 @param This A pointer to the EFI_HII_PROTOCOL instance.
498 @param HandleBufferLength On input, a pointer to the length of the handle
499 buffer. On output, the length of the handle buffer that is required
500 for the handles found.
501 @param Handle An array of FRAMEWORK_EFI_HII_HANDLE instances returned.
502
503 @retval EFI_SUCCESS Handle was updated successfully.
504 @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates
505 that Handle is too small to support the number of handles.
506
507 **/
508 typedef
509 EFI_STATUS
510 (EFIAPI *EFI_HII_FIND_HANDLES)(
511 IN EFI_HII_PROTOCOL *This,
512 IN OUT UINT16 *HandleBufferLength,
513 OUT FRAMEWORK_EFI_HII_HANDLE *Handle
514 );
515
516 /**
517 Exports the contents of the database into a buffer.
518
519 @param This A pointer to the EFI_HII_PROTOCOL instance.
520 @param Handle An FRAMEWORK_EFI_HII_HANDLE that corresponds to the desired
521 handle to export. If the value is 0, the entire database will be exported.
522 In either case, the data will be exported in a format described by the
523 structure definition of EFI_HII_EXPORT_TABLE.
524 @param BufferSize
525 On input, a pointer to the length of the buffer. On output, the length
526 of the buffer that is required for the export data.
527 @param Buffer A pointer to a buffer that will contain the results of the export function.
528
529 @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.
530 @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.
531
532 **/
533 typedef
534 EFI_STATUS
535 (EFIAPI *EFI_HII_EXPORT)(
536 IN EFI_HII_PROTOCOL *This,
537 IN FRAMEWORK_EFI_HII_HANDLE Handle,
538 IN OUT UINTN *BufferSize,
539 OUT VOID *Buffer
540 );
541
542 /**
543 Remove any new strings that were added after the initial string export
544 for this handle.
545
546 @param This A pointer to the EFI_HII_PROTOCOL instance.
547 @param Handle The handle on which the string resides.
548
549 @retval EFI_SUCCESS Remove strings from the handle successfully.
550 @retval EFI_INVALID_PARAMETER The Handle was unknown.
551
552 **/
553 typedef
554 EFI_STATUS
555 (EFIAPI *EFI_HII_RESET_STRINGS)(
556 IN EFI_HII_PROTOCOL *This,
557 IN FRAMEWORK_EFI_HII_HANDLE Handle
558 );
559
560 /**
561 Tests if all of the characters in a string have corresponding font characters.
562
563 @param This A pointer to the EFI_HII_PROTOCOL instance.
564 @param StringToTest A pointer to a Unicode string.
565 @param FirstMissing A pointer to an index into the string. On input,
566 the index of the first character in the StringToTest to examine. On exit,
567 the index of the first character encountered for which a glyph is unavailable.
568 If all glyphs in the string are available, the index is the index of the
569 terminator of the string.
570 @param GlyphBufferSize A pointer to a value. On output, if the function
571 returns EFI_SUCCESS, it contains the amount of memory that is required to
572 store the string's glyph equivalent.
573
574 @retval EFI_SUCCESS All glyphs are available. Note that an empty string
575 always returns this value.
576 @retval EFI_NOT_FOUND A glyph was not found for a character.
577
578 **/
579 typedef
580 EFI_STATUS
581 (EFIAPI *EFI_HII_TEST_STRING) (
582 IN EFI_HII_PROTOCOL *This,
583 IN CHAR16 *StringToTest,
584 IN OUT UINT32 *FirstMissing,
585 OUT UINT32 *GlyphBufferSize
586 );
587
588 /**
589 Translates a Unicode character into the corresponding font glyph.
590
591 Note that this function prototype name is different from that in the Framework HII 0.92 spec
592 to avoid name confict with EFI_HII_GET_GLYPH defined in the UEFI 2.1d spec.
593
594 @param This A pointer to the EFI_HII_PROTOCOL instance.
595 @param Source A pointer to a Unicode string.
596 @param Index On input, the offset into the string from which to fetch
597 the character.On successful completion, the index is updated to the first
598 character past the character(s) making up the just extracted glyph.
599 @param GlyphBuffer Pointer to an array where the glyphs corresponding
600 to the characters in the source may be stored. GlyphBuffer is assumed
601 to be wide enough to accept a wide glyph character.
602 @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by
603 this value is filled with the length of the glyph in pixels. It is unchanged
604 if the call was unsuccessful.
605 @param InternalStatus The cell pointed to by this parameter must be
606 initialized to zero prior to invoking the call the first time for any string.
607
608 @retval EFI_SUCCESS It worked.
609 @retval EFI_NOT_FOUND A glyph for a character was not found.
610
611 **/
612 typedef
613 EFI_STATUS
614 (EFIAPI *FRAMEWORK_EFI_HII_GET_GLYPH)(
615 IN EFI_HII_PROTOCOL *This,
616 IN CHAR16 *Source,
617 IN OUT UINT16 *Index,
618 OUT UINT8 **GlyphBuffer,
619 OUT UINT16 *BitWidth,
620 IN OUT UINT32 *InternalStatus
621 );
622
623 /**
624 Translates a glyph into the format required for input to the Universal
625 Graphics Adapter (UGA) Block Transfer (BLT) routines.
626
627 @param This A pointer to the EFI_HII_PROTOCOL instance.
628 @param GlyphBuffer A pointer to the buffer that contains glyph data.
629 @param Foreground The foreground setting requested to be used for the
630 generated BltBuffer data.
631 @param Background The background setting requested to be used for the
632 generated BltBuffer data.
633 @param Count The entry in the BltBuffer upon which to act.
634 @param Width The width in bits of the glyph being converted.
635 @param Height The height in bits of the glyph being converted
636 @param BltBuffer A pointer to the buffer that contains the data that is
637 ready to be used by the UGA BLT routines.
638
639 @retval EFI_SUCCESS It worked.
640 @retval EFI_NOT_FOUND A glyph for a character was not found.
641 @note: Inconsistent with specification here:
642 In Framework Spec,HII spec 0.92. The type of 3rd, 4th and 8th parameter is EFI_UGA_PIXEL.
643 Here the definition use the EFI_GRAPHICS_OUTPUT_BLT_PIXEL which defined in UEFI2.1 spec
644 **/
645 typedef
646 EFI_STATUS
647 (EFIAPI *EFI_HII_GLYPH_TO_BLT)(
648 IN EFI_HII_PROTOCOL *This,
649 IN UINT8 *GlyphBuffer,
650 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
651 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
652 IN UINTN Count,
653 IN UINTN Width,
654 IN UINTN Height,
655 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
656 );
657
658 /**
659 Allows a new string to be added to an already existing string package.
660
661 Note that this function prototype name is different from that in the Framework HII 0.92 spec
662 to avoid name confict with EFI_HII_NEW_STRING defined in the UEFI 2.1d spec.
663
664 @param This A pointer to the EFI_HII_PROTOCOL instance.
665 @param Pointer to a NULL-terminated string containing a single ISO 639-2
666 language identifier, indicating the language in which the string is translated.
667 @param Handle The handle of the language pack to which the string is to be added.
668 @param Reference The identifier of the string to be added. If the reference
669 value is zero, then the string will be assigned a new identifier on that
670 handle for the language specified. Otherwise, the string will be updated
671 with the NewString Value.
672 @param NewString The string to be added.
673
674 @retval EFI_SUCCESS The string was effectively registered.
675 @retval EFI_INVALID_PARAMETER The Handle was unknown.
676
677 **/
678 typedef
679 EFI_STATUS
680 (EFIAPI *FRAMEWORK_EFI_HII_NEW_STRING)(
681 IN EFI_HII_PROTOCOL *This,
682 IN CHAR16 *Language,
683 IN FRAMEWORK_EFI_HII_HANDLE Handle,
684 IN OUT STRING_REF *Reference,
685 IN CHAR16 *NewString
686 );
687
688 /**
689 Allows a program to determine the primary languages that are supported
690 on a given handle.
691
692 @param This A pointer to the EFI_HII_PROTOCOL instance.
693 @param Handle The handle on which the strings reside.
694 @param LanguageString A string allocated by GetPrimaryLanguages() that
695 contains a list of all primary languages registered on the handle.
696
697 @retval EFI_SUCCESS LanguageString was correctly returned.
698 @retval EFI_INVALID_PARAMETER The Handle was unknown.
699
700 **/
701 typedef
702 EFI_STATUS
703 (EFIAPI *EFI_HII_GET_PRI_LANGUAGES)(
704 IN EFI_HII_PROTOCOL *This,
705 IN FRAMEWORK_EFI_HII_HANDLE Handle,
706 OUT EFI_STRING *LanguageString
707 );
708
709 /**
710 Allows a program to determine which secondary languages are supported
711 on a given handle for a given primary language.
712
713 @param This A pointer to the EFI_HII_PROTOCOL instance.
714 @param Handle The handle on which the strings reside.
715 @param PrimaryLanguage Pointer to a NULL-terminated string containing a single
716 ISO 639-2 language identifier, indicating the primary language.
717 @param LanguageString A string allocated by GetSecondaryLanguages()
718 containing a list of all secondary languages registered on the handle.
719
720 @retval EFI_SUCCESS LanguageString was correctly returned.
721 @retval EFI_INVALID_PARAMETER The Handle was unknown.
722
723 **/
724 typedef
725 EFI_STATUS
726 (EFIAPI *EFI_HII_GET_SEC_LANGUAGES)(
727 IN EFI_HII_PROTOCOL *This,
728 IN FRAMEWORK_EFI_HII_HANDLE Handle,
729 IN CHAR16 *PrimaryLanguage,
730 OUT EFI_STRING *LanguageString
731 );
732
733 /**
734 Extracts a string from a package already registered with the EFI HII database.
735
736 Note that this function prototype name is different from that in the Framework HII 0.92 spec
737 to avoid name confict with EFI_HII_GET_STRING defined in the UEFI 2.1d spec.
738
739 @param This A pointer to the EFI_HII_PROTOCOL instance.
740 @param Handle The handle on which the string resides.
741 @param Token The string token assigned to the string.
742 @param Raw If TRUE, the string is returned unedited in the internal
743 storage format. If false, the string returned is edited
744 by replacing <cr> with <space> and by removing special characters such
745 as the <wide> prefix.
746 @param LanguageString Pointer to a NULL-terminated string containing a
747 single ISO 639-2 language identifier, indicating the language to print.
748 If the LanguageString is empty (starts with a NULL), the default system
749 language will be used to determine the language.
750 @param BufferLength Length of the StringBuffer.
751 @param StringBuffer The buffer designed to receive the characters in the string.
752
753 @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.
754 @retval EFI_INVALID_PARAMETER The handle or string token is unknown.
755 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to
756 allow the entire string to be stored.
757
758 **/
759 typedef
760 EFI_STATUS
761 (EFIAPI *FRAMEWORK_EFI_HII_GET_STRING)(
762 IN EFI_HII_PROTOCOL *This,
763 IN FRAMEWORK_EFI_HII_HANDLE Handle,
764 IN STRING_REF Token,
765 IN BOOLEAN Raw,
766 IN CHAR16 *LanguageString,
767 IN OUT UINTN *BufferLength,
768 OUT EFI_STRING StringBuffer
769 );
770
771 /**
772 Allows a program to extract a part of a string of not more than a given width.
773
774 @param This A pointer to the EFI_HII_PROTOCOL instance.
775 @param Handle The handle on which the string resides.
776 @param Token The string token assigned to the string.
777 @param Index On input, the offset into the string where the line is to start.
778 On output, the index is updated to point to beyond the last character returned
779 in the call.
780 @param LineWidth The maximum width of the line in units of narrow glyphs.
781 @param LanguageString Pointer to a NULL-terminated string containing a
782 single ISO 639-2 language identifier, indicating the language to print.
783 @param BufferLength Pointer to the length of the StringBuffer.
784 @param StringBuffer The buffer designed to receive the characters in the string.
785
786 @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.
787 @retval EFI_NOT_FOUND The font glyph for at least one of the characters in
788 the string is not in the font database.
789 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
790 to allow the entire string to be stored.
791
792 **/
793 typedef
794 EFI_STATUS
795 (EFIAPI *EFI_HII_GET_LINE)(
796 IN EFI_HII_PROTOCOL *This,
797 IN FRAMEWORK_EFI_HII_HANDLE Handle,
798 IN STRING_REF Token,
799 IN OUT UINT16 *Index,
800 IN UINT16 LineWidth,
801 IN CHAR16 *LanguageString,
802 IN OUT UINT16 *BufferLength,
803 OUT EFI_STRING StringBuffer
804 );
805
806 /**
807 Allows a program to extract a form or form package that has previously
808 been registered with the HII database.
809
810 @param This A pointer to the EFI_HII_PROTOCOL instance.
811 @param Handle Handle on which the form resides.
812 @param FormId The ID of the form to return. If the ID is zero,
813 the entire form package is returned.
814 @param BufferLength On input, the length of the Buffer. On output,
815 the length of the returned buffer,
816 @param Buffer The buffer designed to receive the form(s).
817
818 @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength
819 was updated.
820 @retval EFI_INVALID_PARAMETER The handle is unknown.
821 @retval EFI_NOT_FOUND A form on the requested handle cannot be found with
822 the requested FormId.
823 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
824 to allow the form to be stored.
825
826 **/
827 typedef
828 EFI_STATUS
829 (EFIAPI *EFI_HII_GET_FORMS)(
830 IN EFI_HII_PROTOCOL *This,
831 IN FRAMEWORK_EFI_HII_HANDLE Handle,
832 IN EFI_FORM_ID FormId,
833 IN OUT UINTN *BufferLength,
834 OUT UINT8 *Buffer
835 );
836
837 /**
838 Extracts the defaults that are associated with a given handle in the HII database.
839
840 @param This A pointer to the EFI_HII_PROTOCOL instance.
841 @param Handle The HII handle from which will have default data retrieved.
842 @param DefaultMask The mask used to specify some type of default override when extracting
843 the default image data.
844 @param VariablePackList A indirect pointer to the first entry of a link list with
845 type EFI_HII_VARIABLE_PACK_LIST.
846
847 @retval EFI_SUCCESS The VariablePackList was populated with the appropriate
848 default setting data.
849 @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).
850 @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle
851 contain invalid data.
852
853 **/
854 typedef
855 EFI_STATUS
856 (EFIAPI *EFI_HII_GET_DEFAULT_IMAGE)(
857 IN EFI_HII_PROTOCOL *This,
858 IN FRAMEWORK_EFI_HII_HANDLE Handle,
859 IN UINTN DefaultMask,
860 OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
861 );
862
863 /**
864 Allows the caller to update a form or form package that has previously been
865 registered with the EFI HII database.
866
867 @param This A pointer to the EFI_HII_PROTOCOL instance.
868 @param Handle Handle of the package where the form to be updated resides.
869 @param Label The label inside the form package where the update is to take place.
870 @param AddData If TRUE, adding data at a given Label; otherwise,
871 if FALSE, removing data at a given Label.
872 @param Data The buffer containing the new tags to insert after the Label
873
874 @retval EFI_SUCCESS The form was updated with the new tags.
875 @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not
876 contain an integral number of tags.
877 @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.
878
879 **/
880 typedef
881 EFI_STATUS
882 (EFIAPI *EFI_HII_UPDATE_FORM)(
883 IN EFI_HII_PROTOCOL *This,
884 IN FRAMEWORK_EFI_HII_HANDLE Handle,
885 IN EFI_FORM_LABEL Label,
886 IN BOOLEAN AddData,
887 IN EFI_HII_UPDATE_DATA *Data
888 );
889
890 /**
891 Retrieves the current keyboard layout.
892
893 Note that this function prototype name is different from that in the Framework HII 0.92 spec
894 to avoid name confict with EFI_HII_GET_KEYBOARD_LAYOUT defined in the UEFI 2.1d spec.
895
896 @param This A pointer to the EFI_HII_PROTOCOL instance.
897 @param DescriptorCount A pointer to the number of Descriptor entries being
898 described in the keyboard layout being retrieved.
899 @param Descriptor A pointer to a buffer containing an array of FRAMEWORK_EFI_KEY_DESCRIPTOR
900 entries. Each entry will reflect the definition of a specific physical key.
901
902 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
903
904 **/
905 typedef
906 EFI_STATUS
907 (EFIAPI *FRAMEWORK_EFI_HII_GET_KEYBOARD_LAYOUT)(
908 IN EFI_HII_PROTOCOL *This,
909 OUT UINT16 *DescriptorCount,
910 OUT FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor
911 );
912
913 ///
914 /// The HII Protocol manages the HII database, which is a repository for data
915 /// having to do with fonts, strings, forms, keyboards, and other future human
916 /// interface items.
917 ///
918 struct _EFI_HII_PROTOCOL {
919 ///
920 /// Extracts the various packs from a package list.
921 ///
922 EFI_HII_NEW_PACK NewPack;
923
924 ///
925 /// Removes a package from the HII database.
926 ///
927 EFI_HII_REMOVE_PACK RemovePack;
928
929 ///
930 /// Determines the handles that are currently active in the database.
931 ///
932 EFI_HII_FIND_HANDLES FindHandles;
933
934 ///
935 /// Export the entire contents of the database to a buffer.
936 ///
937 EFI_HII_EXPORT ExportDatabase;
938
939 ///
940 /// Tests if all of the characters in a string have corresponding font characters.
941 ///
942 EFI_HII_TEST_STRING TestString;
943
944 ///
945 /// Translates a Unicode character into the corresponding font glyph.
946 ///
947 FRAMEWORK_EFI_HII_GET_GLYPH GetGlyph;
948
949 ///
950 /// Converts a glyph value into a format that is ready for a UGA BLT command.
951 ///
952 EFI_HII_GLYPH_TO_BLT GlyphToBlt;
953
954 ///
955 /// Allows a new string to be added to an already existing string package.
956 ///
957 FRAMEWORK_EFI_HII_NEW_STRING NewString;
958
959 ///
960 /// Allows a program to determine the primary languages that are supported
961 /// on a given handle.
962 ///
963 EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
964
965 ///
966 /// Allows a program to determine which secondary languages are supported
967 /// on a given handle for a given primary language.
968 ///
969 EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;
970
971 ///
972 /// Extracts a string from a package that is already registered with the
973 /// EFI HII database.
974 ///
975 FRAMEWORK_EFI_HII_GET_STRING GetString;
976
977 ///
978 /// Remove any new strings that were added after the initial string export
979 /// for this handle.
980 ///
981 /// Note this function is not defined in the Framework HII 0.92 spec.
982 ///
983 EFI_HII_RESET_STRINGS ResetStrings;
984
985 ///
986 /// Allows a program to extract a part of a string of not more than a given width.
987 ///
988 EFI_HII_GET_LINE GetLine;
989
990 ///
991 /// Allows a program to extract a form or form package that has been previously registered.
992 ///
993 EFI_HII_GET_FORMS GetForms;
994
995 ///
996 /// Allows a program to extract the nonvolatile image that represents the default storage image.
997 ///
998 EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;
999
1000 ///
1001 /// Allows a program to update a previously registered form.
1002 ///
1003 EFI_HII_UPDATE_FORM UpdateForm;
1004
1005 ///
1006 /// Allows a program to extract the current keyboard layout.
1007 ///
1008 FRAMEWORK_EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
1009 };
1010
1011 extern EFI_GUID gEfiHiiProtocolGuid;
1012 extern EFI_GUID gEfiHiiCompatibilityProtocolGuid;
1013
1014 #endif
1015