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