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