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