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