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