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