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