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