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