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