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