]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/HiiFramework.h
Update to BSD license header.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / HiiFramework.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
4d3f3cae 15 Module Name: HiiFramework.h\r
79964ac8 16\r
17 @par Revision Reference:\r
18 This protocol is defined in HII spec 0.92.\r
19\r
20**/\r
21\r
7c6d55db 22#ifndef _FRAMEWORK_HII_H_\r
23#define _FRAMEWORK_HII_H_\r
24\r
b80fbe85 25#include <PiDxe.h>\r
26\r
7c6d55db 27//\r
28// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,\r
29// is defined in MdePkg/Protocol/GraphicsOutput.h\r
30//\r
31#include <Protocol/GraphicsOutput.h>\r
79964ac8 32\r
33#define EFI_HII_PROTOCOL_GUID \\r
34 { \\r
35 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \\r
36 }\r
37\r
38// BugBug:\r
39//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
40// If UGA goes away we need to put this some place. I'm not sure where?\r
41//\r
42//typedef struct {\r
43// UINT8 Blue;\r
44// UINT8 Green;\r
45// UINT8 Red;\r
46// UINT8 Reserved;\r
47//} EFI_UGA_PIXEL;\r
48\r
49//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
50//\r
51\r
52typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;\r
53\r
54//\r
55// Global definition\r
56//\r
57#define NARROW_CHAR 0xFFF0\r
58#define WIDE_CHAR 0xFFF1\r
59#define NON_BREAKING_CHAR 0xFFF2\r
60#define GLYPH_WIDTH 8\r
61#define GLYPH_HEIGHT 19\r
62\r
63#define EFI_HII_FONT 1\r
64#define EFI_HII_STRING 2\r
65#define EFI_HII_IFR 3\r
66#define EFI_HII_KEYBOARD 4\r
67#define EFI_HII_HANDLES 5\r
68#define EFI_HII_VARIABLE 6\r
69#define EFI_HII_DEVICE_PATH 7\r
70\r
71\r
72// References to string tokens must use this macro to enable scanning for\r
73// token usages.\r
74//\r
75#define STRING_TOKEN(t) t\r
76\r
77//\r
78// The following types are currently defined:\r
79//\r
80typedef UINT16 EFI_FORM_ID;\r
81typedef UINT16 EFI_FORM_LABEL;\r
82\r
83#pragma pack(1)\r
84\r
85typedef struct {\r
86 UINT32 Length;\r
87 UINT16 Type;\r
88} EFI_HII_PACK_HEADER;\r
89\r
90//\r
91// A form list consists of a large variety of structure\r
92// possibilities so to represent the binary blob of data\r
93// associated with a package of forms, we will assume a\r
94// pointer to a self-describing data buffer.\r
95//\r
96typedef struct {\r
97 EFI_HII_PACK_HEADER Header;\r
98} EFI_HII_IFR_PACK;\r
99\r
100typedef struct {\r
101 EFI_HII_PACK_HEADER Header; // Must be filled in\r
102 EFI_HANDLE ImageHandle; // Must be filled in\r
103 EFI_HANDLE DeviceHandle; // Optional\r
104 EFI_HANDLE ControllerHandle; // Optional\r
105 EFI_HANDLE CallbackHandle; // Optional\r
106 EFI_HANDLE COBExportHandle; // Optional\r
107} EFI_HII_HANDLE_PACK;\r
108\r
109//\r
110// ********************************************************\r
111// EFI_VARIABLE_CONTENTS\r
112// ********************************************************\r
113//\r
114typedef struct {\r
115 EFI_HII_PACK_HEADER Header;\r
116 EFI_GUID VariableGuid;\r
117 UINT32 VariableNameLength;\r
118 UINT16 VariableId;\r
119 //\r
120 // CHAR16 VariableName[]; //Null-terminated\r
121 //\r
122} EFI_HII_VARIABLE_PACK;\r
123\r
124//\r
125// ********************************************************\r
126// EFI_DEVICE_PATH_PACK\r
127// ********************************************************\r
128//\r
129typedef struct {\r
130 EFI_HII_PACK_HEADER Header;\r
131 //\r
132 // EFI_DEVICE_PATH DevicePath[];\r
133 //\r
134} EFI_HII_DEVICE_PATH_PACK;\r
135\r
136//\r
137// ********************************************************\r
138// EFI_HII_DATA_TABLE\r
139// ********************************************************\r
140//\r
141typedef struct {\r
142 EFI_HII_HANDLE HiiHandle;\r
143 EFI_GUID PackageGuid;\r
144 UINT32 DataTableSize;\r
145 UINT32 IfrDataOffset;\r
146 UINT32 StringDataOffset;\r
147 UINT32 VariableDataOffset;\r
148 UINT32 DevicePathOffset;\r
149 UINT32 NumberOfVariableData;\r
150 UINT32 NumberOfLanguages;\r
151 //\r
152 // EFI_HII_DEVICE_PATH_PACK DevicePath[];\r
153 // EFI_HII_VARIABLE_PACK VariableData[];\r
154 // EFI_HII_IFR_PACK IfrData;\r
155 // EFI_HII_STRING_PACK StringData[];\r
156 //\r
157} EFI_HII_DATA_TABLE;\r
158\r
159//\r
160// ********************************************************\r
161// EFI_HII_EXPORT_TABLE\r
162// ********************************************************\r
163//\r
164typedef struct {\r
165 UINT32 NumberOfHiiDataTables;\r
166 EFI_GUID Revision;\r
167 //\r
168 // EFI_HII_DATA_TABLE HiiDataTable[];\r
169 //\r
170} EFI_HII_EXPORT_TABLE;\r
171\r
172typedef struct {\r
173 BOOLEAN FormSetUpdate; // If TRUE, next variable is significant\r
174 EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info\r
175 BOOLEAN FormUpdate; // If TRUE, next variable is significant\r
176 UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.\r
177 STRING_REF FormTitle; // If not 0, will update Form with this info\r
178 UINT16 DataCount; // The number of Data entries in this structure\r
179 UINT8 *Data; // An array of 1+ op-codes, specified by DataCount\r
180} EFI_HII_UPDATE_DATA;\r
181\r
182//\r
183// String attributes\r
184//\r
185#define LANG_RIGHT_TO_LEFT 0x00000001\r
186\r
187//\r
188// A string package is used to localize strings to a particular\r
189// language. The package is associated with a particular driver\r
190// or set of drivers. Tools are used to associate tokens with\r
191// string references in forms and in programs. These tokens are\r
192// language agnostic. When paired with a language pack (directly\r
193// or indirectly), the string token resolves into an actual\r
194// UNICODE string. The NumStringPointers determines how many\r
195// StringPointers (offset values) there are as well as the total\r
196// number of Strings that are defined.\r
197//\r
198typedef struct {\r
199 EFI_HII_PACK_HEADER Header;\r
200 RELOFST LanguageNameString;\r
201 RELOFST PrintableLanguageName;\r
202 UINT32 NumStringPointers;\r
203 UINT32 Attributes;\r
204 //\r
205 // RELOFST StringPointers[];\r
206 // EFI_STRING Strings[];\r
207 //\r
208} EFI_HII_STRING_PACK;\r
209\r
210//\r
211// Glyph Attributes\r
212//\r
213#define EFI_GLYPH_NON_SPACING 1\r
214#define EFI_GLYPH_WIDE 2\r
215\r
216typedef struct {\r
217 CHAR16 UnicodeWeight;\r
218 UINT8 Attributes;\r
219 UINT8 GlyphCol1[GLYPH_HEIGHT];\r
220} EFI_NARROW_GLYPH;\r
221\r
222typedef struct {\r
223 CHAR16 UnicodeWeight;\r
224 UINT8 Attributes;\r
225 UINT8 GlyphCol1[GLYPH_HEIGHT];\r
226 UINT8 GlyphCol2[GLYPH_HEIGHT];\r
227 UINT8 Pad[3];\r
228} EFI_WIDE_GLYPH;\r
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
252//\r
253// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;\r
254//\r
255typedef enum {\r
256 EfiKeyLCtrl,\r
257 EfiKeyA0,\r
258 EfiKeyLAlt,\r
259 EfiKeySpaceBar,\r
260 EfiKeyA2,\r
261 EfiKeyA3,\r
262 EfiKeyA4,\r
263 EfiKeyRCtrl,\r
264 EfiKeyLeftArrow,\r
265 EfiKeyDownArrow,\r
266 EfiKeyRightArrow,\r
267 EfiKeyZero,\r
268 EfiKeyPeriod,\r
269 EfiKeyEnter,\r
270 EfiKeyLShift,\r
271 EfiKeyB0,\r
272 EfiKeyB1,\r
273 EfiKeyB2,\r
274 EfiKeyB3,\r
275 EfiKeyB4,\r
276 EfiKeyB5,\r
277 EfiKeyB6,\r
278 EfiKeyB7,\r
279 EfiKeyB8,\r
280 EfiKeyB9,\r
281 EfiKeyB10,\r
282 EfiKeyRshift,\r
283 EfiKeyUpArrow,\r
284 EfiKeyOne,\r
285 EfiKeyTwo,\r
286 EfiKeyThree,\r
287 EfiKeyCapsLock,\r
288 EfiKeyC1,\r
289 EfiKeyC2,\r
290 EfiKeyC3,\r
291 EfiKeyC4,\r
292 EfiKeyC5,\r
293 EfiKeyC6,\r
294 EfiKeyC7,\r
295 EfiKeyC8,\r
296 EfiKeyC9,\r
297 EfiKeyC10,\r
298 EfiKeyC11,\r
299 EfiKeyC12,\r
300 EfiKeyFour,\r
301 EfiKeyFive,\r
302 EfiKeySix,\r
303 EfiKeyPlus,\r
304 EfiKeyTab,\r
305 EfiKeyD1,\r
306 EfiKeyD2,\r
307 EfiKeyD3,\r
308 EfiKeyD4,\r
309 EfiKeyD5,\r
310 EfiKeyD6,\r
311 EfiKeyD7,\r
312 EfiKeyD8,\r
313 EfiKeyD9,\r
314 EfiKeyD10,\r
315 EfiKeyD11,\r
316 EfiKeyD12,\r
317 EfiKeyD13,\r
318 EfiKeyDel,\r
319 EfiKeyEnd,\r
320 EfiKeyPgDn,\r
321 EfiKeySeven,\r
322 EfiKeyEight,\r
323 EfiKeyNine,\r
324 EfiKeyE0,\r
325 EfiKeyE1,\r
326 EfiKeyE2,\r
327 EfiKeyE3,\r
328 EfiKeyE4,\r
329 EfiKeyE5,\r
330 EfiKeyE6,\r
331 EfiKeyE7,\r
332 EfiKeyE8,\r
333 EfiKeyE9,\r
334 EfiKeyE10,\r
335 EfiKeyE11,\r
336 EfiKeyE12,\r
337 EfiKeyBackSpace,\r
338 EfiKeyIns,\r
339 EfiKeyHome,\r
340 EfiKeyPgUp,\r
341 EfiKeyNLck,\r
342 EfiKeySlash,\r
343 EfiKeyAsterisk,\r
344 EfiKeyMinus,\r
345 EfiKeyEsc,\r
346 EfiKeyF1,\r
347 EfiKeyF2,\r
348 EfiKeyF3,\r
349 EfiKeyF4,\r
350 EfiKeyF5,\r
351 EfiKeyF6,\r
352 EfiKeyF7,\r
353 EfiKeyF8,\r
354 EfiKeyF9,\r
355 EfiKeyF10,\r
356 EfiKeyF11,\r
357 EfiKeyF12,\r
358 EfiKeyPrint,\r
359 EfiKeySLck,\r
360 EfiKeyPause\r
361} EFI_KEY;\r
362\r
363typedef struct {\r
364 EFI_KEY Key;\r
365 CHAR16 Unicode;\r
366 CHAR16 ShiftedUnicode;\r
367 CHAR16 AltGrUnicode;\r
368 CHAR16 ShiftedAltGrUnicode;\r
369 UINT16 Modifier;\r
370} EFI_KEY_DESCRIPTOR;\r
371\r
372//\r
373// This structure allows a sparse set of keys to be redefined\r
374// or a complete redefinition of the keyboard layout. Most\r
375// keyboards have a lot of commonality in their layouts, therefore\r
376// only defining those keys that need to change from the default\r
377// minimizes the passed in information.\r
378//\r
379// Additionally, when an update occurs, the active keyboard layout\r
380// will be switched to the newly updated keyboard layout. This\r
381// allows for situations that when a keyboard layout driver is\r
382// loaded as part of system initialization, the system will default\r
383// the keyboard behavior to the new layout.\r
384//\r
385// Each call to update the keyboard mapping should contain the\r
386// complete set of key descriptors to be updated, since every\r
387// call to the HII which contains an EFI_HII_KEYBOARD_PACK will\r
388// wipe the previous set of overrides. A call to\r
389//\r
390typedef struct {\r
391 EFI_HII_PACK_HEADER Header;\r
392 EFI_KEY_DESCRIPTOR *Descriptor;\r
393 UINT8 DescriptorCount;\r
394} EFI_HII_KEYBOARD_PACK;\r
395\r
396//\r
397// The EFI_HII_PACKAGES can contain different types of packages just\r
398// after the structure as inline data.\r
399//\r
400typedef struct {\r
401 UINTN NumberOfPackages;\r
402 EFI_GUID *GuidId;\r
403 //\r
404 // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.\r
405 // EFI_HII_IFR_PACK *IfrPack; // Only one pack.\r
406 // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok\r
407 // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok\r
408 // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok\r
409 //\r
410} EFI_HII_PACKAGES;\r
411\r
412typedef struct _EFI_HII_VARIABLE_PACK_LIST {\r
413 struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;\r
414 EFI_HII_VARIABLE_PACK *VariablePack;\r
415} EFI_HII_VARIABLE_PACK_LIST;\r
416\r
61a30832 417\r
79964ac8 418#pragma pack()\r
419\r
420/**\r
421 Registers the various packs that are passed in via the Packages parameter.\r
422\r
423 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
424 @param Packages A pointer to an EFI_HII_PACKAGES package instance.\r
425 @param Handle A pointer to the EFI_HII_HANDLE instance.\r
426\r
427 @retval EFI_SUCCESS Data was extracted from Packages, the database\r
428 was updated with the data, and Handle returned successfully.\r
429 @retval EFI_INVALID_PARAMETER The content of Packages was invalid.\r
430\r
431**/\r
432typedef\r
433EFI_STATUS\r
434(EFIAPI *EFI_HII_NEW_PACK) (\r
435 IN EFI_HII_PROTOCOL *This,\r
436 IN EFI_HII_PACKAGES *Packages,\r
437 OUT EFI_HII_HANDLE *Handle\r
438 );\r
439\r
440/**\r
441 Removes a package from the HII database.\r
442\r
443 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
444 @param Handle The handle that was registered to the data that is requested\r
445 for removal.\r
446\r
447 @retval EFI_SUCCESS The data associated with the Handle was removed\r
448 from the HII database.\r
449 @retval EFI_INVALID_PARAMETER The Handle was not valid.\r
450\r
451**/\r
452typedef\r
453EFI_STATUS\r
454(EFIAPI *EFI_HII_REMOVE_PACK) (\r
455 IN EFI_HII_PROTOCOL *This,\r
456 IN EFI_HII_HANDLE Handle\r
457 );\r
458\r
459/**\r
460 Determines the handles that are currently active in the database.\r
461\r
462 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
463 @param HandleBufferLength On input, a pointer to the length of the handle\r
464 buffer. On output, the length of the handle buffer that is required\r
465 for the handles found.\r
466 @param Handle An array of EFI_HII_HANDLE instances returned.\r
467\r
468 @retval EFI_SUCCESS Handle was updated successfully.\r
469 @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates\r
470 that Handle is too small to support the number of handles.\r
471\r
472**/\r
473typedef\r
474EFI_STATUS\r
475(EFIAPI *EFI_HII_FIND_HANDLES) (\r
476 IN EFI_HII_PROTOCOL *This,\r
477 IN OUT UINT16 *HandleBufferLength,\r
478 OUT EFI_HII_HANDLE *Handle\r
479 );\r
480\r
481/**\r
482 Exports the contents of the database into a buffer.\r
483\r
484 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
485 @param Handle An EFI_HII_HANDLE that corresponds to the desired\r
486 handle to export. If the value is 0, the entire database will be exported.\r
487 In either case, the data will be exported in a format described by the\r
488 structure definition of EFI_HII_EXPORT_TABLE.\r
489 @param BufferSize\r
490 On input, a pointer to the length of the buffer. On output, the length\r
491 of the buffer that is required for the export data.\r
492 @param Buffer A pointer to a buffer that will contain the results of the export function.\r
493\r
494 @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.\r
495 @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.\r
496\r
497**/\r
498typedef\r
499EFI_STATUS\r
500(EFIAPI *EFI_HII_EXPORT) (\r
501 IN EFI_HII_PROTOCOL *This,\r
502 IN EFI_HII_HANDLE Handle,\r
503 IN OUT UINTN *BufferSize,\r
504 OUT VOID *Buffer\r
505 );\r
506\r
507/**\r
508 Remove any new strings that were added after the initial string export\r
509 for this handle.\r
510\r
511 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
512 @param Handle The handle on which the string resides.\r
513\r
514 @retval EFI_SUCCESS Remove strings from the handle successfully.\r
515 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
516\r
517**/\r
518typedef\r
519EFI_STATUS\r
520(EFIAPI *EFI_HII_RESET_STRINGS) (\r
521 IN EFI_HII_PROTOCOL *This,\r
522 IN EFI_HII_HANDLE Handle\r
523 );\r
524\r
525/**\r
526 Tests if all of the characters in a string have corresponding font characters.\r
527\r
528 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
529 @param StringToTest A pointer to a Unicode string.\r
530 @param FirstMissing A pointer to an index into the string. On input,\r
531 the index of the first character in the StringToTest to examine. On exit,\r
532 the index of the first character encountered for which a glyph is unavailable.\r
533 If all glyphs in the string are available, the index is the index of the\r
534 terminator of the string.\r
535 @param GlyphBufferSize A pointer to a value. On output, if the function\r
536 returns EFI_SUCCESS, it contains the amount of memory that is required to\r
537 store the string's glyph equivalent.\r
538\r
539 @retval EFI_SUCCESS All glyphs are available. Note that an empty string\r
540 always returns this value.\r
541 @retval EFI_NOT_FOUND A glyph was not found for a character.\r
542\r
543**/\r
544typedef\r
545EFI_STATUS\r
546(EFIAPI *EFI_HII_TEST_STRING) (\r
547 IN EFI_HII_PROTOCOL *This,\r
548 IN CHAR16 *StringToTest,\r
549 IN OUT UINT32 *FirstMissing,\r
550 OUT UINT32 *GlyphBufferSize\r
551 );\r
552\r
553/**\r
554 Translates a Unicode character into the corresponding font glyph.\r
555\r
556 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
557 @param Source A pointer to a Unicode string.\r
558 @param Index On input, the offset into the string from which to fetch\r
559 the character.On successful completion, the index is updated to the first\r
560 character past the character(s) making up the just extracted glyph.\r
561 @param GlyphBuffer Pointer to an array where the glyphs corresponding\r
562 to the characters in the source may be stored. GlyphBuffer is assumed\r
563 to be wide enough to accept a wide glyph character.\r
564 @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by\r
565 this value is filled with the length of the glyph in pixels. It is unchanged\r
566 if the call was unsuccessful.\r
567 @param InternalStatus The cell pointed to by this parameter must be\r
568 initialized to zero prior to invoking the call the first time for any string.\r
569\r
570 @retval EFI_SUCCESS It worked.\r
571 @retval EFI_NOT_FOUND A glyph for a character was not found.\r
572\r
573**/\r
574typedef\r
575EFI_STATUS\r
576(EFIAPI *EFI_HII_GET_GLYPH) (\r
577 IN EFI_HII_PROTOCOL *This,\r
578 IN CHAR16 *Source,\r
579 IN OUT UINT16 *Index,\r
580 OUT UINT8 **GlyphBuffer,\r
581 OUT UINT16 *BitWidth,\r
582 IN OUT UINT32 *InternalStatus\r
583 );\r
584\r
585/**\r
586 Translates a glyph into the format required for input to the Universal\r
587 Graphics Adapter (UGA) Block Transfer (BLT) routines.\r
588\r
589 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
590 @param GlyphBuffer A pointer to the buffer that contains glyph data.\r
591 @param Foreground The foreground setting requested to be used for the\r
592 generated BltBuffer data.\r
593 @param Background The background setting requested to be used for the\r
594 generated BltBuffer data.\r
595 @param Count The entry in the BltBuffer upon which to act.\r
596 @param Width The width in bits of the glyph being converted.\r
597 @param Height The height in bits of the glyph being converted\r
598 @param BltBuffer A pointer to the buffer that contains the data that is\r
599 ready to be used by the UGA BLT routines.\r
600\r
601 @retval EFI_SUCCESS It worked.\r
602 @retval EFI_NOT_FOUND A glyph for a character was not found.\r
603\r
604**/\r
605typedef\r
606EFI_STATUS\r
607(EFIAPI *EFI_HII_GLYPH_TO_BLT) (\r
608 IN EFI_HII_PROTOCOL *This,\r
609 IN UINT8 *GlyphBuffer,\r
610 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,\r
611 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,\r
612 IN UINTN Count,\r
613 IN UINTN Width,\r
614 IN UINTN Height,\r
615 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer\r
616 );\r
617\r
618/**\r
619 Allows a new string to be added to an already existing string package.\r
620\r
621 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
622 @param Pointer to a NULL-terminated string containing a single ISO 639-2\r
623 language identifier, indicating the language in which the string is translated.\r
624 @param Handle The handle of the language pack to which the string is to be added.\r
625 @param Reference The identifier of the string to be added. If the reference\r
626 value is zero, then the string will be assigned a new identifier on that\r
627 handle for the language specified. Otherwise, the string will be updated\r
628 with the NewString Value.\r
629 @param NewString The string to be added.\r
630\r
631 @retval EFI_SUCCESS The string was effectively registered.\r
632 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
633\r
634**/\r
635typedef\r
636EFI_STATUS\r
637(EFIAPI *EFI_HII_NEW_STRING) (\r
638 IN EFI_HII_PROTOCOL *This,\r
639 IN CHAR16 *Language,\r
640 IN EFI_HII_HANDLE Handle,\r
641 IN OUT STRING_REF *Reference,\r
642 IN CHAR16 *NewString\r
643 );\r
644\r
645/**\r
646 Allows a program to determine the primary languages that are supported\r
647 on a given handle.\r
648\r
649 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
650 @param Handle The handle on which the strings reside.\r
651 @param LanguageString A string allocated by GetPrimaryLanguages() that\r
652 contains a list of all primary languages registered on the handle.\r
653\r
654 @retval EFI_SUCCESS LanguageString was correctly returned.\r
655 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
656\r
657**/\r
658typedef\r
659EFI_STATUS\r
660(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (\r
661 IN EFI_HII_PROTOCOL *This,\r
662 IN EFI_HII_HANDLE Handle,\r
663 OUT EFI_STRING *LanguageString\r
664 );\r
665\r
666/**\r
667 Allows a program to determine which secondary languages are supported\r
668 on a given handle for a given primary language.\r
669\r
670 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
671 @param Handle The handle on which the strings reside.\r
672 @param PrimaryLanguage Pointer to a NULL-terminated string containing a single\r
673 ISO 639-2 language identifier, indicating the primary language.\r
674 @param LanguageString A string allocated by GetSecondaryLanguages()\r
675 containing a list of all secondary languages registered on the handle.\r
676\r
677 @retval EFI_SUCCESS LanguageString was correctly returned.\r
678 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
679\r
680**/\r
681typedef\r
682EFI_STATUS\r
683(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (\r
684 IN EFI_HII_PROTOCOL *This,\r
685 IN EFI_HII_HANDLE Handle,\r
686 IN CHAR16 *PrimaryLanguage,\r
687 OUT EFI_STRING *LanguageString\r
688 );\r
689\r
690/**\r
691 Extracts a string from a package already registered with the EFI HII database.\r
692\r
693 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
694 @param Handle The handle on which the string resides.\r
695 @param Token The string token assigned to the string.\r
696 @param Raw If TRUE, the string is returned unedited in the internal\r
697 storage format described above. If false, the string returned is edited\r
698 by replacing <cr> with <space> and by removing special characters such\r
699 as the <wide> prefix.\r
700 @param LanguageString Pointer to a NULL-terminated string containing a\r
701 single ISO 639-2 language identifier, indicating the language to print.\r
702 If the LanguageString is empty (starts with a NULL), the default system\r
703 language will be used to determine the language.\r
704 @param BufferLength Length of the StringBuffer.\r
705 @param StringBuffer The buffer designed to receive the characters in the string.\r
706\r
707 @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.\r
708 @retval EFI_INVALID_PARAMETER The handle or string token is unknown.\r
709 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to\r
710 allow the entire string to be stored.\r
711\r
712**/\r
713typedef\r
714EFI_STATUS\r
715(EFIAPI *EFI_HII_GET_STRING) (\r
716 IN EFI_HII_PROTOCOL *This,\r
717 IN EFI_HII_HANDLE Handle,\r
718 IN STRING_REF Token,\r
719 IN BOOLEAN Raw,\r
720 IN CHAR16 *LanguageString,\r
721 IN OUT UINTN *BufferLength,\r
722 OUT EFI_STRING StringBuffer\r
723 );\r
724\r
725/**\r
726 Allows a program to extract a part of a string of not more than a given width.\r
727\r
728 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
729 @param Handle The handle on which the string resides.\r
730 @param Token The string token assigned to the string.\r
731 @param Index On input, the offset into the string where the line is to start.\r
732 On output, the index is updated to point to beyond the last character returned\r
733 in the call.\r
734 @param LineWidth The maximum width of the line in units of narrow glyphs.\r
735 @param LanguageString Pointer to a NULL-terminated string containing a\r
736 single ISO 639-2 language identifier, indicating the language to print.\r
737 @param BufferLength Pointer to the length of the StringBuffer.\r
738 @param StringBuffer The buffer designed to receive the characters in the string.\r
739\r
740 @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.\r
741 @retval EFI_NOT_FOUND The font glyph for at least one of the characters in\r
742 the string is not in the font database.\r
743 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough\r
744 to allow the entire string to be stored.\r
745\r
746**/\r
747typedef\r
748EFI_STATUS\r
749(EFIAPI *EFI_HII_GET_LINE) (\r
750 IN EFI_HII_PROTOCOL *This,\r
751 IN EFI_HII_HANDLE Handle,\r
752 IN STRING_REF Token,\r
753 IN OUT UINT16 *Index,\r
754 IN UINT16 LineWidth,\r
755 IN CHAR16 *LanguageString,\r
756 IN OUT UINT16 *BufferLength,\r
757 OUT EFI_STRING StringBuffer\r
758 );\r
759\r
760/**\r
761 Allows a program to extract a form or form package that has previously\r
762 been registered with the HII database.\r
763\r
764 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
765 @param Handle Handle on which the form resides.\r
766 @param FormId The ID of the form to return. If the ID is zero,\r
767 the entire form package is returned.\r
768 @param BufferLength On input, the length of the Buffer. On output,\r
769 the length of the returned buffer,\r
770 @param Buffer The buffer designed to receive the form(s).\r
771\r
772 @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength\r
773 was updated.\r
774 @retval EFI_INVALID_PARAMETER The handle is unknown.\r
775 @retval EFI_NOT_FOUND A form on the requested handle cannot be found with\r
776 the requested FormId.\r
777 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough\r
778 to allow the form to be stored.\r
779\r
780**/\r
781typedef\r
782EFI_STATUS\r
783(EFIAPI *EFI_HII_GET_FORMS) (\r
784 IN EFI_HII_PROTOCOL *This,\r
785 IN EFI_HII_HANDLE Handle,\r
786 IN EFI_FORM_ID FormId,\r
787 IN OUT UINTN *BufferLength,\r
788 OUT UINT8 *Buffer\r
789 );\r
790\r
791/**\r
792 Extracts the defaults that are associated with a given handle in the HII database.\r
793\r
794 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
795 @param Handle The HII handle from which will have default data retrieved.\r
796 @param DefaultMask The mask used to specify some type of default override when extracting\r
797 the default image data.\r
798 @param VariablePackList A indirect pointer to the first entry of a link list with\r
799 type EFI_HII_VARIABLE_PACK_LIST.\r
800\r
801 @retval EFI_SUCCESS The VariablePackList was populated with the appropriate\r
802 default setting data.\r
803 @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).\r
804 @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle\r
805 contain invalid data.\r
806\r
807**/\r
808typedef\r
809EFI_STATUS\r
810(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (\r
811 IN EFI_HII_PROTOCOL *This,\r
812 IN EFI_HII_HANDLE Handle,\r
813 IN UINTN DefaultMask,\r
814 OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r
815 );\r
816\r
817/**\r
818 Allows the caller to update a form or form package that has previously been\r
819 registered with the EFI HII database.\r
820\r
821 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
822 @param Handle Handle of the package where the form to be updated resides.\r
823 @param Label The label inside the form package where the update is to take place.\r
824 @param AddData If TRUE, adding data at a given Label; otherwise,\r
825 if FALSE, removing data at a given Label.\r
826 @param Data The buffer containing the new tags to insert after the Label\r
827\r
828 @retval EFI_SUCCESS The form was updated with the new tags.\r
829 @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not\r
830 contain an integral number of tags.\r
831 @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.\r
832\r
833**/\r
834typedef\r
835EFI_STATUS\r
836(EFIAPI *EFI_HII_UPDATE_FORM) (\r
837 IN EFI_HII_PROTOCOL *This,\r
838 IN EFI_HII_HANDLE Handle,\r
839 IN EFI_FORM_LABEL Label,\r
840 IN BOOLEAN AddData,\r
841 IN EFI_HII_UPDATE_DATA *Data\r
842 );\r
843\r
844/**\r
845 Retrieves the current keyboard layout.\r
846\r
847 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
848 @param DescriptorCount A pointer to the number of Descriptor entries being\r
849 described in the keyboard layout being retrieved.\r
850 @param Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR\r
851 entries. Each entry will reflect the definition of a specific physical key.\r
852\r
853 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r
854\r
855**/\r
856typedef\r
857EFI_STATUS\r
858(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
859 IN EFI_HII_PROTOCOL *This,\r
860 OUT UINT16 *DescriptorCount,\r
861 OUT EFI_KEY_DESCRIPTOR *Descriptor\r
862 );\r
863\r
864/**\r
865 @par Protocol Description:\r
866 The HII Protocol manages the HII database, which is a repository for data\r
867 having to do with fonts, strings, forms, keyboards, and other future human\r
868 interface items.\r
869\r
870 @param NewPack\r
871 Extracts the various packs from a package list.\r
872\r
873 @param RemovePack\r
874 Removes a package from the HII database.\r
875\r
876 @param FindHandles\r
877 Determines the handles that are currently active in the database.\r
878\r
879 @param ExportDatabase\r
880 Export the entire contents of the database to a buffer.\r
881\r
882 @param TestString\r
883 Tests if all of the characters in a string have corresponding font characters.\r
884\r
885 @param GetGlyph\r
886 Translates a Unicode character into the corresponding font glyph.\r
887\r
888 @param GlyphToBlt\r
889 Converts a glyph value into a format that is ready for a UGA BLT command.\r
890\r
891 @param NewString\r
892 Allows a new string to be added to an already existing string package.\r
893\r
894 @param GetPrimaryLanguages\r
895 Allows a program to determine the primary languages that are supported\r
896 on a given handle.\r
897\r
898 @param GetSecondaryLanguages\r
899 Allows a program to determine which secondary languages are supported\r
900 on a given handle for a given primary language.\r
901\r
902 @param GetString\r
903 Extracts a string from a package that is already registered with the\r
904 EFI HII database.\r
905\r
906 @param ResetString\r
907 Remove any new strings that were added after the initial string export\r
908 for this handle.\r
909\r
910 @param GetLine\r
911 Allows a program to extract a part of a string of not more than a given width.\r
912\r
913 @param GetForms\r
914 Allows a program to extract a form or form package that has been previously registered.\r
915\r
916 @param GetDefaultImage\r
917 Allows a program to extract the nonvolatile image that represents the default storage image.\r
918\r
919 @param UpdateForm\r
920 Allows a program to update a previously registered form.\r
921\r
922 @param GetKeyboardLayout\r
923 Allows a program to extract the current keyboard layout.\r
924\r
925**/\r
926struct _EFI_HII_PROTOCOL {\r
927 EFI_HII_NEW_PACK NewPack;\r
928 EFI_HII_REMOVE_PACK RemovePack;\r
929 EFI_HII_FIND_HANDLES FindHandles;\r
930 EFI_HII_EXPORT ExportDatabase;\r
931\r
932 EFI_HII_TEST_STRING TestString;\r
933 EFI_HII_GET_GLYPH GetGlyph;\r
934 EFI_HII_GLYPH_TO_BLT GlyphToBlt;\r
935\r
936 EFI_HII_NEW_STRING NewString;\r
937 EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;\r
938 EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;\r
939 EFI_HII_GET_STRING GetString;\r
940 EFI_HII_RESET_STRINGS ResetStrings;\r
941 EFI_HII_GET_LINE GetLine;\r
942 EFI_HII_GET_FORMS GetForms;\r
943 EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;\r
944 EFI_HII_UPDATE_FORM UpdateForm;\r
945\r
946 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
947};\r
948\r
949extern EFI_GUID gEfiHiiProtocolGuid;\r
950\r
951#endif\r