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