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