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