3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This file defines the Human Interface Infrastructure protocol which will
19 be used by resources which want to publish IFR/Font/String data and have it
20 collected by the Configuration engine.
27 #include "EfiInternalFormRepresentation.h"
28 #include EFI_PROTOCOL_DEFINITION (UgaDraw)
29 #include EFI_PROTOCOL_DEFINITION (GraphicsOutput)
32 // EFI_HII_PROTOCOL_GUID has been changed from the one defined in Framework HII 0.92 as the
33 // Framework HII protocol produced by HII Thunk Layer support the UEF IFR and UEFI String Package
36 #define EFI_HII_PROTOCOL_GUID \
38 0x5542cce1, 0xdf5c, 0x4d1b, { 0xab, 0xca, 0x36, 0x4f, 0x77, 0xd3, 0x99, 0xfb } \
42 #define EFI_HII_PROTOCOL_GUID \
44 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
49 // Forward reference for pure ANSI compatability
51 typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL
;
56 #define NARROW_CHAR 0xFFF0
57 #define WIDE_CHAR 0xFFF1
58 #define NON_BREAKING_CHAR 0xFFF2
60 #define GLYPH_HEIGHT 19
62 #define EFI_HII_FONT 1
63 #define EFI_HII_STRING 2
65 #define EFI_HII_KEYBOARD 4
66 #define EFI_HII_HANDLES 5
67 #define EFI_HII_VARIABLE 6
68 #define EFI_HII_DEVICE_PATH 7
71 volatile INT32 __iii; \
79 // References to string tokens must use this macro to enable scanning for
82 #define STRING_TOKEN(t) t
85 // The following types are currently defined:
87 typedef UINT16 EFI_FORM_ID
;
88 typedef UINT16 EFI_FORM_LABEL
;
89 typedef UINT16 EFI_HII_HANDLE
;
96 } EFI_HII_PACK_HEADER
;
99 // A form list consists of a large variety of structure
100 // possibilities so to represent the binary blob of data
101 // associated with a package of forms, we will assume a
102 // pointer to a self-describing data buffer.
105 EFI_HII_PACK_HEADER Header
;
109 EFI_HII_PACK_HEADER Header
; // Must be filled in
110 EFI_HANDLE ImageHandle
; // Must be filled in
111 EFI_HANDLE DeviceHandle
; // Optional
112 EFI_HANDLE ControllerHandle
; // Optional
113 EFI_HANDLE CallbackHandle
; // Optional
114 EFI_HANDLE COBExportHandle
; // Optional
115 } EFI_HII_HANDLE_PACK
;
118 // ********************************************************
119 // EFI_VARIABLE_CONTENTS
120 // ********************************************************
123 EFI_HII_PACK_HEADER Header
;
124 EFI_GUID VariableGuid
;
125 UINT32 VariableNameLength
;
128 // CHAR16 VariableName[]; //Null-terminated
130 } EFI_HII_VARIABLE_PACK
;
133 // ********************************************************
134 // EFI_DEVICE_PATH_PACK
135 // ********************************************************
138 EFI_HII_PACK_HEADER Header
;
140 // EFI_DEVICE_PATH DevicePath[];
142 } EFI_HII_DEVICE_PATH_PACK
;
145 // ********************************************************
146 // EFI_HII_DATA_TABLE
147 // ********************************************************
150 EFI_HII_HANDLE HiiHandle
;
151 EFI_GUID PackageGuid
;
152 UINT32 DataTableSize
;
153 UINT32 IfrDataOffset
;
154 UINT32 StringDataOffset
;
155 UINT32 VariableDataOffset
;
156 UINT32 DevicePathOffset
;
157 UINT32 NumberOfVariableData
;
158 UINT32 NumberOfLanguages
;
160 // EFI_HII_DEVICE_PATH_PACK DevicePath[];
161 // EFI_HII_VARIABLE_PACK VariableData[];
162 // EFI_HII_IFR_PACK IfrData;
163 // EFI_HII_STRING_PACK StringData[];
165 } EFI_HII_DATA_TABLE
;
168 // ********************************************************
169 // EFI_HII_EXPORT_TABLE
170 // ********************************************************
173 UINT16 NumberOfHiiDataTables
;
176 // EFI_HII_DATA_TABLE HiiDataTable[];
178 } EFI_HII_EXPORT_TABLE
;
181 BOOLEAN FormSetUpdate
; // If TRUE, next variable is significant
182 EFI_PHYSICAL_ADDRESS FormCallbackHandle
; // If not 0, will update Formset with this info
183 BOOLEAN FormUpdate
; // If TRUE, next variable is significant
184 UINT16 FormValue
; // specify which form is to be updated if FormUpdate value is TRUE.
185 STRING_REF FormTitle
; // If not 0, will update Form with this info
186 UINT16 DataCount
; // The number of Data entries in this structure
187 UINT8
*Data
; // An array of 1+ op-codes, specified by DataCount
188 } EFI_HII_UPDATE_DATA
;
193 #define LANG_RIGHT_TO_LEFT 0x00000001
196 // A string package is used to localize strings to a particular
197 // language. The package is associated with a particular driver
198 // or set of drivers. Tools are used to associate tokens with
199 // string references in forms and in programs. These tokens are
200 // language agnostic. When paired with a language pack (directly
201 // or indirectly), the string token resolves into an actual
202 // UNICODE string. The NumStringPointers determines how many
203 // StringPointers (offset values) there are as well as the total
204 // number of Strings that are defined.
207 EFI_HII_PACK_HEADER Header
;
208 RELOFST LanguageNameString
;
209 RELOFST PrintableLanguageName
;
210 UINT32 NumStringPointers
;
213 // RELOFST StringPointers[];
214 // EFI_STRING Strings[];
216 } EFI_HII_STRING_PACK
;
219 // We use this one to get the real size of the header
222 EFI_HII_PACK_HEADER Header
;
223 RELOFST LanguageNameString
;
224 RELOFST PrintableLanguageName
;
225 UINT32 NumStringPointers
;
227 } EFI_HII_STRING_PACK_HEADER
;
232 #define GLYPH_NON_SPACING 1
233 #define GLYPH_NON_BREAKING 2
236 CHAR16 UnicodeWeight
;
238 UINT8 GlyphCol1
[GLYPH_HEIGHT
];
242 CHAR16 UnicodeWeight
;
244 UINT8 GlyphCol1
[GLYPH_HEIGHT
];
245 UINT8 GlyphCol2
[GLYPH_HEIGHT
];
250 // A font list consists of a font header followed by a series
251 // of glyph structures. Note that fonts are not language specific.
254 EFI_HII_PACK_HEADER Header
;
255 UINT16 NumberOfNarrowGlyphs
;
256 UINT16 NumberOfWideGlyphs
;
260 // The IfrData in the EFI_HII_IFR_PACK structure definition
261 // is variable length, and not really part of the header. To
262 // simplify from code the size of the header, define an
263 // identical structure that does not include the IfrData field.
264 // Then use sizeof() this new structure to determine the
265 // actual size of the header.
268 EFI_HII_PACK_HEADER Header
;
269 } EFI_HII_IFR_PACK_HEADER
;
272 // pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;
385 CHAR16 ShiftedUnicode
;
387 CHAR16 ShiftedAltGrUnicode
;
389 } EFI_KEY_DESCRIPTOR
;
392 // This structure allows a sparse set of keys to be redefined
393 // or a complete redefinition of the keyboard layout. Most
394 // keyboards have a lot of commonality in their layouts, therefore
395 // only defining those keys that need to change from the default
396 // minimizes the passed in information.
398 // Additionally, when an update occurs, the active keyboard layout
399 // will be switched to the newly updated keyboard layout. This
400 // allows for situations that when a keyboard layout driver is
401 // loaded as part of system initialization, the system will default
402 // the keyboard behavior to the new layout.
404 // Each call to update the keyboard mapping should contain the
405 // complete set of key descriptors to be updated, since every
406 // call to the HII which contains an EFI_HII_KEYBOARD_PACK will
407 // wipe the previous set of overrides. A call to
410 EFI_HII_PACK_HEADER Header
;
411 EFI_KEY_DESCRIPTOR
*Descriptor
;
412 UINT8 DescriptorCount
;
413 } EFI_HII_KEYBOARD_PACK
;
416 // The EFI_HII_PACKAGES can contain different types of packages just
417 // after the structure as inline data.
420 UINTN NumberOfPackages
;
423 // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
424 // EFI_HII_IFR_PACK *IfrPack; // Only one pack.
425 // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
426 // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
427 // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
431 typedef struct _EFI_HII_VARIABLE_PACK_LIST
{
432 struct _EFI_HII_VARIABLE_PACK_LIST
*NextVariablePack
;
433 EFI_HII_VARIABLE_PACK
*VariablePack
;
434 } EFI_HII_VARIABLE_PACK_LIST
;
440 (EFIAPI
*EFI_HII_NEW_PACK
) (
441 IN EFI_HII_PROTOCOL
* This
,
442 IN EFI_HII_PACKAGES
* Packages
,
443 OUT EFI_HII_HANDLE
* Handle
448 (EFIAPI
*EFI_HII_REMOVE_PACK
) (
449 IN EFI_HII_PROTOCOL
*This
,
450 IN EFI_HII_HANDLE Handle
455 (EFIAPI
*EFI_HII_FIND_HANDLES
) (
456 IN EFI_HII_PROTOCOL
*This
,
457 IN OUT UINT16
*HandleBufferLength
,
458 OUT EFI_HII_HANDLE
*Handle
463 (EFIAPI
*EFI_HII_EXPORT
) (
464 IN EFI_HII_PROTOCOL
*This
,
465 IN EFI_HII_HANDLE Handle
,
466 IN OUT UINTN
*BufferSize
,
472 (EFIAPI
*EFI_HII_RESET_STRINGS
) (
473 IN EFI_HII_PROTOCOL
*This
,
474 IN EFI_HII_HANDLE Handle
479 (EFIAPI
*EFI_HII_TEST_STRING
) (
480 IN EFI_HII_PROTOCOL
*This
,
481 IN CHAR16
*StringToTest
,
482 IN OUT UINT32
*FirstMissing
,
483 OUT UINT32
*GlyphBufferSize
488 (EFIAPI
*EFI_HII_GET_GLYPH
) (
489 IN EFI_HII_PROTOCOL
*This
,
491 IN OUT UINT16
*Index
,
492 OUT UINT8
**GlyphBuffer
,
493 OUT UINT16
*BitWidth
,
494 IN OUT UINT32
*InternalStatus
499 (EFIAPI
*EFI_HII_GLYPH_TO_BLT
) (
500 IN EFI_HII_PROTOCOL
*This
,
501 IN UINT8
*GlyphBuffer
,
502 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground
,
503 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background
,
507 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BltBuffer
512 (EFIAPI
*EFI_HII_NEW_STRING
) (
513 IN EFI_HII_PROTOCOL
*This
,
515 IN EFI_HII_HANDLE Handle
,
516 IN OUT STRING_REF
*Reference
,
522 (EFIAPI
*EFI_HII_GET_PRI_LANGUAGES
) (
523 IN EFI_HII_PROTOCOL
*This
,
524 IN EFI_HII_HANDLE Handle
,
525 OUT EFI_STRING
*LanguageString
530 (EFIAPI
*EFI_HII_GET_SEC_LANGUAGES
) (
531 IN EFI_HII_PROTOCOL
*This
,
532 IN EFI_HII_HANDLE Handle
,
533 IN CHAR16
*PrimaryLanguage
,
534 OUT EFI_STRING
*LanguageString
539 (EFIAPI
*EFI_HII_GET_STRING
) (
540 IN EFI_HII_PROTOCOL
*This
,
541 IN EFI_HII_HANDLE Handle
,
544 IN CHAR16
*LanguageString
,
545 IN OUT UINTN
*BufferLength
,
546 OUT EFI_STRING StringBuffer
551 (EFIAPI
*EFI_HII_GET_LINE
) (
552 IN EFI_HII_PROTOCOL
*This
,
553 IN EFI_HII_HANDLE Handle
,
555 IN OUT UINT16
*Index
,
557 IN CHAR16
*LanguageString
,
558 IN OUT UINT16
*BufferLength
,
559 OUT EFI_STRING StringBuffer
564 (EFIAPI
*EFI_HII_GET_FORMS
) (
565 IN EFI_HII_PROTOCOL
*This
,
566 IN EFI_HII_HANDLE Handle
,
567 IN EFI_FORM_ID FormId
,
568 IN OUT UINTN
*BufferLength
,
574 (EFIAPI
*EFI_HII_GET_DEFAULT_IMAGE
) (
575 IN EFI_HII_PROTOCOL
*This
,
576 IN EFI_HII_HANDLE Handle
,
577 IN UINTN DefaultMask
,
578 OUT EFI_HII_VARIABLE_PACK_LIST
**VariablePackList
583 (EFIAPI
*EFI_HII_UPDATE_FORM
) (
584 IN EFI_HII_PROTOCOL
*This
,
585 IN EFI_HII_HANDLE Handle
,
586 IN EFI_FORM_LABEL Label
,
588 IN EFI_HII_UPDATE_DATA
*Data
593 (EFIAPI
*EFI_HII_GET_KEYBOARD_LAYOUT
) (
594 IN EFI_HII_PROTOCOL
* This
,
595 OUT UINT16
*DescriptorCount
,
596 OUT EFI_KEY_DESCRIPTOR
* Descriptor
599 struct _EFI_HII_PROTOCOL
{
600 EFI_HII_NEW_PACK NewPack
;
601 EFI_HII_REMOVE_PACK RemovePack
;
602 EFI_HII_FIND_HANDLES FindHandles
;
603 EFI_HII_EXPORT ExportDatabase
;
605 EFI_HII_TEST_STRING TestString
;
606 EFI_HII_GET_GLYPH GetGlyph
;
607 EFI_HII_GLYPH_TO_BLT GlyphToBlt
;
609 EFI_HII_NEW_STRING NewString
;
610 EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages
;
611 EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages
;
612 EFI_HII_GET_STRING GetString
;
613 EFI_HII_RESET_STRINGS ResetStrings
;
614 EFI_HII_GET_LINE GetLine
;
615 EFI_HII_GET_FORMS GetForms
;
616 EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage
;
617 EFI_HII_UPDATE_FORM UpdateForm
;
619 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout
;
622 extern EFI_GUID gEfiHiiProtocolGuid
;