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