]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/FrameworkHii.h
add some definitions about HII
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / FrameworkHii.h
CommitLineData
79964ac8 1/** @file\r
2 This file defines the Human Interface Infrastructure protocol which will\r
3 be used by resources which want to publish IFR/Font/String data and have it\r
4 collected by the Configuration engine.\r
5\r
6 Copyright (c) 2007, Intel Corporation\r
7 All rights reserved. This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
7c6d55db 15 Module Name: FrameworkHii.h\r
79964ac8 16\r
17 @par Revision Reference:\r
18 This protocol is defined in HII spec 0.92.\r
19\r
20**/\r
21\r
7c6d55db 22#ifndef _FRAMEWORK_HII_H_\r
23#define _FRAMEWORK_HII_H_\r
24\r
b80fbe85 25#include <PiDxe.h>\r
26\r
7c6d55db 27//\r
28// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,\r
29// is defined in MdePkg/Protocol/GraphicsOutput.h\r
30//\r
31#include <Protocol/GraphicsOutput.h>\r
79964ac8 32\r
33#define EFI_HII_PROTOCOL_GUID \\r
34 { \\r
35 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \\r
36 }\r
37\r
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 417typedef struct {\r
418 EFI_HII_IFR_PACK *IfrData;\r
419 EFI_HII_STRING_PACK *StringData;\r
420} EFI_IFR_PACKET;\r
421\r
422typedef struct {\r
423 UINTN LeftColumn;\r
424 UINTN RightColumn;\r
425 UINTN TopRow;\r
426 UINTN BottomRow;\r
427} EFI_SCREEN_DESCRIPTOR;\r
428\r
79964ac8 429#pragma pack()\r
430\r
431/**\r
432 Registers the various packs that are passed in via the Packages parameter.\r
433\r
434 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
435 @param Packages A pointer to an EFI_HII_PACKAGES package instance.\r
436 @param Handle A pointer to the EFI_HII_HANDLE instance.\r
437\r
438 @retval EFI_SUCCESS Data was extracted from Packages, the database\r
439 was updated with the data, and Handle returned successfully.\r
440 @retval EFI_INVALID_PARAMETER The content of Packages was invalid.\r
441\r
442**/\r
443typedef\r
444EFI_STATUS\r
445(EFIAPI *EFI_HII_NEW_PACK) (\r
446 IN EFI_HII_PROTOCOL *This,\r
447 IN EFI_HII_PACKAGES *Packages,\r
448 OUT EFI_HII_HANDLE *Handle\r
449 );\r
450\r
451/**\r
452 Removes a package from the HII database.\r
453\r
454 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
455 @param Handle The handle that was registered to the data that is requested\r
456 for removal.\r
457\r
458 @retval EFI_SUCCESS The data associated with the Handle was removed\r
459 from the HII database.\r
460 @retval EFI_INVALID_PARAMETER The Handle was not valid.\r
461\r
462**/\r
463typedef\r
464EFI_STATUS\r
465(EFIAPI *EFI_HII_REMOVE_PACK) (\r
466 IN EFI_HII_PROTOCOL *This,\r
467 IN EFI_HII_HANDLE Handle\r
468 );\r
469\r
470/**\r
471 Determines the handles that are currently active in the database.\r
472\r
473 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
474 @param HandleBufferLength On input, a pointer to the length of the handle\r
475 buffer. On output, the length of the handle buffer that is required\r
476 for the handles found.\r
477 @param Handle An array of EFI_HII_HANDLE instances returned.\r
478\r
479 @retval EFI_SUCCESS Handle was updated successfully.\r
480 @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates\r
481 that Handle is too small to support the number of handles.\r
482\r
483**/\r
484typedef\r
485EFI_STATUS\r
486(EFIAPI *EFI_HII_FIND_HANDLES) (\r
487 IN EFI_HII_PROTOCOL *This,\r
488 IN OUT UINT16 *HandleBufferLength,\r
489 OUT EFI_HII_HANDLE *Handle\r
490 );\r
491\r
492/**\r
493 Exports the contents of the database into a buffer.\r
494\r
495 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
496 @param Handle An EFI_HII_HANDLE that corresponds to the desired\r
497 handle to export. If the value is 0, the entire database will be exported.\r
498 In either case, the data will be exported in a format described by the\r
499 structure definition of EFI_HII_EXPORT_TABLE.\r
500 @param BufferSize\r
501 On input, a pointer to the length of the buffer. On output, the length\r
502 of the buffer that is required for the export data.\r
503 @param Buffer A pointer to a buffer that will contain the results of the export function.\r
504\r
505 @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.\r
506 @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.\r
507\r
508**/\r
509typedef\r
510EFI_STATUS\r
511(EFIAPI *EFI_HII_EXPORT) (\r
512 IN EFI_HII_PROTOCOL *This,\r
513 IN EFI_HII_HANDLE Handle,\r
514 IN OUT UINTN *BufferSize,\r
515 OUT VOID *Buffer\r
516 );\r
517\r
518/**\r
519 Remove any new strings that were added after the initial string export\r
520 for this handle.\r
521\r
522 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
523 @param Handle The handle on which the string resides.\r
524\r
525 @retval EFI_SUCCESS Remove strings from the handle successfully.\r
526 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
527\r
528**/\r
529typedef\r
530EFI_STATUS\r
531(EFIAPI *EFI_HII_RESET_STRINGS) (\r
532 IN EFI_HII_PROTOCOL *This,\r
533 IN EFI_HII_HANDLE Handle\r
534 );\r
535\r
536/**\r
537 Tests if all of the characters in a string have corresponding font characters.\r
538\r
539 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
540 @param StringToTest A pointer to a Unicode string.\r
541 @param FirstMissing A pointer to an index into the string. On input,\r
542 the index of the first character in the StringToTest to examine. On exit,\r
543 the index of the first character encountered for which a glyph is unavailable.\r
544 If all glyphs in the string are available, the index is the index of the\r
545 terminator of the string.\r
546 @param GlyphBufferSize A pointer to a value. On output, if the function\r
547 returns EFI_SUCCESS, it contains the amount of memory that is required to\r
548 store the string's glyph equivalent.\r
549\r
550 @retval EFI_SUCCESS All glyphs are available. Note that an empty string\r
551 always returns this value.\r
552 @retval EFI_NOT_FOUND A glyph was not found for a character.\r
553\r
554**/\r
555typedef\r
556EFI_STATUS\r
557(EFIAPI *EFI_HII_TEST_STRING) (\r
558 IN EFI_HII_PROTOCOL *This,\r
559 IN CHAR16 *StringToTest,\r
560 IN OUT UINT32 *FirstMissing,\r
561 OUT UINT32 *GlyphBufferSize\r
562 );\r
563\r
564/**\r
565 Translates a Unicode character into the corresponding font glyph.\r
566\r
567 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
568 @param Source A pointer to a Unicode string.\r
569 @param Index On input, the offset into the string from which to fetch\r
570 the character.On successful completion, the index is updated to the first\r
571 character past the character(s) making up the just extracted glyph.\r
572 @param GlyphBuffer Pointer to an array where the glyphs corresponding\r
573 to the characters in the source may be stored. GlyphBuffer is assumed\r
574 to be wide enough to accept a wide glyph character.\r
575 @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by\r
576 this value is filled with the length of the glyph in pixels. It is unchanged\r
577 if the call was unsuccessful.\r
578 @param InternalStatus The cell pointed to by this parameter must be\r
579 initialized to zero prior to invoking the call the first time for any string.\r
580\r
581 @retval EFI_SUCCESS It worked.\r
582 @retval EFI_NOT_FOUND A glyph for a character was not found.\r
583\r
584**/\r
585typedef\r
586EFI_STATUS\r
587(EFIAPI *EFI_HII_GET_GLYPH) (\r
588 IN EFI_HII_PROTOCOL *This,\r
589 IN CHAR16 *Source,\r
590 IN OUT UINT16 *Index,\r
591 OUT UINT8 **GlyphBuffer,\r
592 OUT UINT16 *BitWidth,\r
593 IN OUT UINT32 *InternalStatus\r
594 );\r
595\r
596/**\r
597 Translates a glyph into the format required for input to the Universal\r
598 Graphics Adapter (UGA) Block Transfer (BLT) routines.\r
599\r
600 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
601 @param GlyphBuffer A pointer to the buffer that contains glyph data.\r
602 @param Foreground The foreground setting requested to be used for the\r
603 generated BltBuffer data.\r
604 @param Background The background setting requested to be used for the\r
605 generated BltBuffer data.\r
606 @param Count The entry in the BltBuffer upon which to act.\r
607 @param Width The width in bits of the glyph being converted.\r
608 @param Height The height in bits of the glyph being converted\r
609 @param BltBuffer A pointer to the buffer that contains the data that is\r
610 ready to be used by the UGA BLT routines.\r
611\r
612 @retval EFI_SUCCESS It worked.\r
613 @retval EFI_NOT_FOUND A glyph for a character was not found.\r
614\r
615**/\r
616typedef\r
617EFI_STATUS\r
618(EFIAPI *EFI_HII_GLYPH_TO_BLT) (\r
619 IN EFI_HII_PROTOCOL *This,\r
620 IN UINT8 *GlyphBuffer,\r
621 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,\r
622 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,\r
623 IN UINTN Count,\r
624 IN UINTN Width,\r
625 IN UINTN Height,\r
626 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer\r
627 );\r
628\r
629/**\r
630 Allows a new string to be added to an already existing string package.\r
631\r
632 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
633 @param Pointer to a NULL-terminated string containing a single ISO 639-2\r
634 language identifier, indicating the language in which the string is translated.\r
635 @param Handle The handle of the language pack to which the string is to be added.\r
636 @param Reference The identifier of the string to be added. If the reference\r
637 value is zero, then the string will be assigned a new identifier on that\r
638 handle for the language specified. Otherwise, the string will be updated\r
639 with the NewString Value.\r
640 @param NewString The string to be added.\r
641\r
642 @retval EFI_SUCCESS The string was effectively registered.\r
643 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
644\r
645**/\r
646typedef\r
647EFI_STATUS\r
648(EFIAPI *EFI_HII_NEW_STRING) (\r
649 IN EFI_HII_PROTOCOL *This,\r
650 IN CHAR16 *Language,\r
651 IN EFI_HII_HANDLE Handle,\r
652 IN OUT STRING_REF *Reference,\r
653 IN CHAR16 *NewString\r
654 );\r
655\r
656/**\r
657 Allows a program to determine the primary languages that are supported\r
658 on a given handle.\r
659\r
660 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
661 @param Handle The handle on which the strings reside.\r
662 @param LanguageString A string allocated by GetPrimaryLanguages() that\r
663 contains a list of all primary languages registered on the handle.\r
664\r
665 @retval EFI_SUCCESS LanguageString was correctly returned.\r
666 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
667\r
668**/\r
669typedef\r
670EFI_STATUS\r
671(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (\r
672 IN EFI_HII_PROTOCOL *This,\r
673 IN EFI_HII_HANDLE Handle,\r
674 OUT EFI_STRING *LanguageString\r
675 );\r
676\r
677/**\r
678 Allows a program to determine which secondary languages are supported\r
679 on a given handle for a given primary language.\r
680\r
681 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
682 @param Handle The handle on which the strings reside.\r
683 @param PrimaryLanguage Pointer to a NULL-terminated string containing a single\r
684 ISO 639-2 language identifier, indicating the primary language.\r
685 @param LanguageString A string allocated by GetSecondaryLanguages()\r
686 containing a list of all secondary languages registered on the handle.\r
687\r
688 @retval EFI_SUCCESS LanguageString was correctly returned.\r
689 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
690\r
691**/\r
692typedef\r
693EFI_STATUS\r
694(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (\r
695 IN EFI_HII_PROTOCOL *This,\r
696 IN EFI_HII_HANDLE Handle,\r
697 IN CHAR16 *PrimaryLanguage,\r
698 OUT EFI_STRING *LanguageString\r
699 );\r
700\r
701/**\r
702 Extracts a string from a package already registered with the EFI HII database.\r
703\r
704 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
705 @param Handle The handle on which the string resides.\r
706 @param Token The string token assigned to the string.\r
707 @param Raw If TRUE, the string is returned unedited in the internal\r
708 storage format described above. If false, the string returned is edited\r
709 by replacing <cr> with <space> and by removing special characters such\r
710 as the <wide> prefix.\r
711 @param LanguageString Pointer to a NULL-terminated string containing a\r
712 single ISO 639-2 language identifier, indicating the language to print.\r
713 If the LanguageString is empty (starts with a NULL), the default system\r
714 language will be used to determine the language.\r
715 @param BufferLength Length of the StringBuffer.\r
716 @param StringBuffer The buffer designed to receive the characters in the string.\r
717\r
718 @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.\r
719 @retval EFI_INVALID_PARAMETER The handle or string token is unknown.\r
720 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to\r
721 allow the entire string to be stored.\r
722\r
723**/\r
724typedef\r
725EFI_STATUS\r
726(EFIAPI *EFI_HII_GET_STRING) (\r
727 IN EFI_HII_PROTOCOL *This,\r
728 IN EFI_HII_HANDLE Handle,\r
729 IN STRING_REF Token,\r
730 IN BOOLEAN Raw,\r
731 IN CHAR16 *LanguageString,\r
732 IN OUT UINTN *BufferLength,\r
733 OUT EFI_STRING StringBuffer\r
734 );\r
735\r
736/**\r
737 Allows a program to extract a part of a string of not more than a given width.\r
738\r
739 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
740 @param Handle The handle on which the string resides.\r
741 @param Token The string token assigned to the string.\r
742 @param Index On input, the offset into the string where the line is to start.\r
743 On output, the index is updated to point to beyond the last character returned\r
744 in the call.\r
745 @param LineWidth The maximum width of the line in units of narrow glyphs.\r
746 @param LanguageString Pointer to a NULL-terminated string containing a\r
747 single ISO 639-2 language identifier, indicating the language to print.\r
748 @param BufferLength Pointer to the length of the StringBuffer.\r
749 @param StringBuffer The buffer designed to receive the characters in the string.\r
750\r
751 @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.\r
752 @retval EFI_NOT_FOUND The font glyph for at least one of the characters in\r
753 the string is not in the font database.\r
754 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough\r
755 to allow the entire string to be stored.\r
756\r
757**/\r
758typedef\r
759EFI_STATUS\r
760(EFIAPI *EFI_HII_GET_LINE) (\r
761 IN EFI_HII_PROTOCOL *This,\r
762 IN EFI_HII_HANDLE Handle,\r
763 IN STRING_REF Token,\r
764 IN OUT UINT16 *Index,\r
765 IN UINT16 LineWidth,\r
766 IN CHAR16 *LanguageString,\r
767 IN OUT UINT16 *BufferLength,\r
768 OUT EFI_STRING StringBuffer\r
769 );\r
770\r
771/**\r
772 Allows a program to extract a form or form package that has previously\r
773 been registered with the HII database.\r
774\r
775 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
776 @param Handle Handle on which the form resides.\r
777 @param FormId The ID of the form to return. If the ID is zero,\r
778 the entire form package is returned.\r
779 @param BufferLength On input, the length of the Buffer. On output,\r
780 the length of the returned buffer,\r
781 @param Buffer The buffer designed to receive the form(s).\r
782\r
783 @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength\r
784 was updated.\r
785 @retval EFI_INVALID_PARAMETER The handle is unknown.\r
786 @retval EFI_NOT_FOUND A form on the requested handle cannot be found with\r
787 the requested FormId.\r
788 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough\r
789 to allow the form to be stored.\r
790\r
791**/\r
792typedef\r
793EFI_STATUS\r
794(EFIAPI *EFI_HII_GET_FORMS) (\r
795 IN EFI_HII_PROTOCOL *This,\r
796 IN EFI_HII_HANDLE Handle,\r
797 IN EFI_FORM_ID FormId,\r
798 IN OUT UINTN *BufferLength,\r
799 OUT UINT8 *Buffer\r
800 );\r
801\r
802/**\r
803 Extracts the defaults that are associated with a given handle in the HII database.\r
804\r
805 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
806 @param Handle The HII handle from which will have default data retrieved.\r
807 @param DefaultMask The mask used to specify some type of default override when extracting\r
808 the default image data.\r
809 @param VariablePackList A indirect pointer to the first entry of a link list with\r
810 type EFI_HII_VARIABLE_PACK_LIST.\r
811\r
812 @retval EFI_SUCCESS The VariablePackList was populated with the appropriate\r
813 default setting data.\r
814 @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).\r
815 @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle\r
816 contain invalid data.\r
817\r
818**/\r
819typedef\r
820EFI_STATUS\r
821(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (\r
822 IN EFI_HII_PROTOCOL *This,\r
823 IN EFI_HII_HANDLE Handle,\r
824 IN UINTN DefaultMask,\r
825 OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r
826 );\r
827\r
828/**\r
829 Allows the caller to update a form or form package that has previously been\r
830 registered with the EFI HII database.\r
831\r
832 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
833 @param Handle Handle of the package where the form to be updated resides.\r
834 @param Label The label inside the form package where the update is to take place.\r
835 @param AddData If TRUE, adding data at a given Label; otherwise,\r
836 if FALSE, removing data at a given Label.\r
837 @param Data The buffer containing the new tags to insert after the Label\r
838\r
839 @retval EFI_SUCCESS The form was updated with the new tags.\r
840 @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not\r
841 contain an integral number of tags.\r
842 @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.\r
843\r
844**/\r
845typedef\r
846EFI_STATUS\r
847(EFIAPI *EFI_HII_UPDATE_FORM) (\r
848 IN EFI_HII_PROTOCOL *This,\r
849 IN EFI_HII_HANDLE Handle,\r
850 IN EFI_FORM_LABEL Label,\r
851 IN BOOLEAN AddData,\r
852 IN EFI_HII_UPDATE_DATA *Data\r
853 );\r
854\r
855/**\r
856 Retrieves the current keyboard layout.\r
857\r
858 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
859 @param DescriptorCount A pointer to the number of Descriptor entries being\r
860 described in the keyboard layout being retrieved.\r
861 @param Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR\r
862 entries. Each entry will reflect the definition of a specific physical key.\r
863\r
864 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r
865\r
866**/\r
867typedef\r
868EFI_STATUS\r
869(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
870 IN EFI_HII_PROTOCOL *This,\r
871 OUT UINT16 *DescriptorCount,\r
872 OUT EFI_KEY_DESCRIPTOR *Descriptor\r
873 );\r
874\r
875/**\r
876 @par Protocol Description:\r
877 The HII Protocol manages the HII database, which is a repository for data\r
878 having to do with fonts, strings, forms, keyboards, and other future human\r
879 interface items.\r
880\r
881 @param NewPack\r
882 Extracts the various packs from a package list.\r
883\r
884 @param RemovePack\r
885 Removes a package from the HII database.\r
886\r
887 @param FindHandles\r
888 Determines the handles that are currently active in the database.\r
889\r
890 @param ExportDatabase\r
891 Export the entire contents of the database to a buffer.\r
892\r
893 @param TestString\r
894 Tests if all of the characters in a string have corresponding font characters.\r
895\r
896 @param GetGlyph\r
897 Translates a Unicode character into the corresponding font glyph.\r
898\r
899 @param GlyphToBlt\r
900 Converts a glyph value into a format that is ready for a UGA BLT command.\r
901\r
902 @param NewString\r
903 Allows a new string to be added to an already existing string package.\r
904\r
905 @param GetPrimaryLanguages\r
906 Allows a program to determine the primary languages that are supported\r
907 on a given handle.\r
908\r
909 @param GetSecondaryLanguages\r
910 Allows a program to determine which secondary languages are supported\r
911 on a given handle for a given primary language.\r
912\r
913 @param GetString\r
914 Extracts a string from a package that is already registered with the\r
915 EFI HII database.\r
916\r
917 @param ResetString\r
918 Remove any new strings that were added after the initial string export\r
919 for this handle.\r
920\r
921 @param GetLine\r
922 Allows a program to extract a part of a string of not more than a given width.\r
923\r
924 @param GetForms\r
925 Allows a program to extract a form or form package that has been previously registered.\r
926\r
927 @param GetDefaultImage\r
928 Allows a program to extract the nonvolatile image that represents the default storage image.\r
929\r
930 @param UpdateForm\r
931 Allows a program to update a previously registered form.\r
932\r
933 @param GetKeyboardLayout\r
934 Allows a program to extract the current keyboard layout.\r
935\r
936**/\r
937struct _EFI_HII_PROTOCOL {\r
938 EFI_HII_NEW_PACK NewPack;\r
939 EFI_HII_REMOVE_PACK RemovePack;\r
940 EFI_HII_FIND_HANDLES FindHandles;\r
941 EFI_HII_EXPORT ExportDatabase;\r
942\r
943 EFI_HII_TEST_STRING TestString;\r
944 EFI_HII_GET_GLYPH GetGlyph;\r
945 EFI_HII_GLYPH_TO_BLT GlyphToBlt;\r
946\r
947 EFI_HII_NEW_STRING NewString;\r
948 EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;\r
949 EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;\r
950 EFI_HII_GET_STRING GetString;\r
951 EFI_HII_RESET_STRINGS ResetStrings;\r
952 EFI_HII_GET_LINE GetLine;\r
953 EFI_HII_GET_FORMS GetForms;\r
954 EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;\r
955 EFI_HII_UPDATE_FORM UpdateForm;\r
956\r
957 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
958};\r
959\r
960extern EFI_GUID gEfiHiiProtocolGuid;\r
961\r
962#endif\r