]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/FrameworkHii.h
define #define EFI_HII_UPDATE_DATA FRAMEWORK_EFI_HII_UPDATE_DATA to avoid duplicated...
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / FrameworkHii.h
1 /** @file
2 This file defines the Human Interface Infrastructure protocol which will
3 be used by resources which want to publish IFR/Font/String data and have it
4 collected by the Configuration engine.
5
6 Copyright (c) 2007, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 Module Name: FrameworkHii.h
16
17 @par Revision Reference:
18 This protocol is defined in HII spec 0.92.
19
20 **/
21
22 #ifndef _FRAMEWORK_HII_H_
23 #define _FRAMEWORK_HII_H_
24
25 #include <PiDxe.h>
26
27 //
28 // To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,
29 // is defined in MdePkg/Protocol/GraphicsOutput.h
30 //
31 #include <Protocol/GraphicsOutput.h>
32
33 #define EFI_HII_PROTOCOL_GUID \
34 { \
35 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
36 }
37
38 // BugBug:
39 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
40 // If UGA goes away we need to put this some place. I'm not sure where?
41 //
42 //typedef struct {
43 // UINT8 Blue;
44 // UINT8 Green;
45 // UINT8 Red;
46 // UINT8 Reserved;
47 //} EFI_UGA_PIXEL;
48
49 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
50 //
51
52 typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
53
54 typedef UINT16 FRAMEWORK_EFI_HII_HANDLE;
55
56 //
57 // Global definition
58 //
59 #define NARROW_CHAR 0xFFF0
60 #define WIDE_CHAR 0xFFF1
61 #define NON_BREAKING_CHAR 0xFFF2
62 #define GLYPH_WIDTH 8
63 #define GLYPH_HEIGHT 19
64
65 #define EFI_HII_FONT 1
66 #define EFI_HII_STRING 2
67 #define EFI_HII_IFR 3
68 #define EFI_HII_KEYBOARD 4
69 #define EFI_HII_HANDLES 5
70 #define EFI_HII_VARIABLE 6
71 #define EFI_HII_DEVICE_PATH 7
72
73
74 // References to string tokens must use this macro to enable scanning for
75 // token usages.
76 //
77 #define STRING_TOKEN(t) t
78
79 //
80 // The following types are currently defined:
81 // EFI_FROM_ID has been defined in UEFI spec.
82 //
83 typedef UINT16 EFI_FORM_LABEL;
84
85 #pragma pack(1)
86
87 typedef struct {
88 UINT32 Length;
89 UINT16 Type;
90 } EFI_HII_PACK_HEADER;
91
92 //
93 // A form list consists of a large variety of structure
94 // possibilities so to represent the binary blob of data
95 // associated with a package of forms, we will assume a
96 // pointer to a self-describing data buffer.
97 //
98 typedef struct {
99 EFI_HII_PACK_HEADER Header;
100 } EFI_HII_IFR_PACK;
101
102 typedef struct {
103 EFI_HII_PACK_HEADER Header; // Must be filled in
104 EFI_HANDLE ImageHandle; // Must be filled in
105 EFI_HANDLE DeviceHandle; // Optional
106 EFI_HANDLE ControllerHandle; // Optional
107 EFI_HANDLE CallbackHandle; // Optional
108 EFI_HANDLE COBExportHandle; // Optional
109 } EFI_HII_HANDLE_PACK;
110
111 //
112 // ********************************************************
113 // EFI_VARIABLE_CONTENTS
114 // ********************************************************
115 //
116 typedef struct {
117 EFI_HII_PACK_HEADER Header;
118 EFI_GUID VariableGuid;
119 UINT32 VariableNameLength;
120 UINT16 VariableId;
121 //
122 // CHAR16 VariableName[]; //Null-terminated
123 //
124 } EFI_HII_VARIABLE_PACK;
125
126 //
127 // ********************************************************
128 // EFI_DEVICE_PATH_PACK
129 // ********************************************************
130 //
131 typedef struct {
132 EFI_HII_PACK_HEADER Header;
133 //
134 // EFI_DEVICE_PATH DevicePath[];
135 //
136 } EFI_HII_DEVICE_PATH_PACK;
137
138 //
139 // ********************************************************
140 // EFI_HII_DATA_TABLE
141 // ********************************************************
142 //
143 typedef struct {
144 FRAMEWORK_EFI_HII_HANDLE HiiHandle;
145 EFI_GUID PackageGuid;
146 UINT32 DataTableSize;
147 UINT32 IfrDataOffset;
148 UINT32 StringDataOffset;
149 UINT32 VariableDataOffset;
150 UINT32 DevicePathOffset;
151 UINT32 NumberOfVariableData;
152 UINT32 NumberOfLanguages;
153 //
154 // EFI_HII_DEVICE_PATH_PACK DevicePath[];
155 // EFI_HII_VARIABLE_PACK VariableData[];
156 // EFI_HII_IFR_PACK IfrData;
157 // EFI_HII_STRING_PACK StringData[];
158 //
159 } EFI_HII_DATA_TABLE;
160
161 //
162 // ********************************************************
163 // EFI_HII_EXPORT_TABLE
164 // ********************************************************
165 //
166 typedef struct {
167 UINT32 NumberOfHiiDataTables;
168 EFI_GUID Revision;
169 //
170 // EFI_HII_DATA_TABLE HiiDataTable[];
171 //
172 } EFI_HII_EXPORT_TABLE;
173
174 #define EFI_HII_UPDATE_DATA FRAMEWORK_EFI_HII_UPDATE_DATA
175 typedef struct {
176 BOOLEAN FormSetUpdate; // If TRUE, next variable is significant
177 EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info
178 BOOLEAN FormUpdate; // If TRUE, next variable is significant
179 UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.
180 STRING_REF FormTitle; // If not 0, will update Form with this info
181 UINT16 DataCount; // The number of Data entries in this structure
182 UINT8 *Data; // An array of 1+ op-codes, specified by DataCount
183 } EFI_HII_UPDATE_DATA;
184
185 //
186 // String attributes
187 //
188 #define LANG_RIGHT_TO_LEFT 0x00000001
189
190 //
191 // A string package is used to localize strings to a particular
192 // language. The package is associated with a particular driver
193 // or set of drivers. Tools are used to associate tokens with
194 // string references in forms and in programs. These tokens are
195 // language agnostic. When paired with a language pack (directly
196 // or indirectly), the string token resolves into an actual
197 // UNICODE string. The NumStringPointers determines how many
198 // StringPointers (offset values) there are as well as the total
199 // number of Strings that are defined.
200 //
201 typedef struct {
202 EFI_HII_PACK_HEADER Header;
203 RELOFST LanguageNameString;
204 RELOFST PrintableLanguageName;
205 UINT32 NumStringPointers;
206 UINT32 Attributes;
207 //
208 // RELOFST StringPointers[];
209 // EFI_STRING Strings[];
210 //
211 } EFI_HII_STRING_PACK;
212
213
214 //
215 // A font list consists of a font header followed by a series
216 // of glyph structures. Note that fonts are not language specific.
217 //
218 typedef struct {
219 EFI_HII_PACK_HEADER Header;
220 UINT16 NumberOfNarrowGlyphs;
221 UINT16 NumberOfWideGlyphs;
222 } EFI_HII_FONT_PACK;
223
224 //
225 // The IfrData in the EFI_HII_IFR_PACK structure definition
226 // is variable length, and not really part of the header. To
227 // simplify from code the size of the header, define an
228 // identical structure that does not include the IfrData field.
229 // Then use sizeof() this new structure to determine the
230 // actual size of the header.
231 //
232 typedef struct {
233 EFI_HII_PACK_HEADER Header;
234 } EFI_HII_IFR_PACK_HEADER;
235
236 typedef struct {
237 EFI_KEY Key;
238 CHAR16 Unicode;
239 CHAR16 ShiftedUnicode;
240 CHAR16 AltGrUnicode;
241 CHAR16 ShiftedAltGrUnicode;
242 UINT16 Modifier;
243 } FRAMEWORK_EFI_KEY_DESCRIPTOR;
244
245 //
246 // This structure allows a sparse set of keys to be redefined
247 // or a complete redefinition of the keyboard layout. Most
248 // keyboards have a lot of commonality in their layouts, therefore
249 // only defining those keys that need to change from the default
250 // minimizes the passed in information.
251 //
252 // Additionally, when an update occurs, the active keyboard layout
253 // will be switched to the newly updated keyboard layout. This
254 // allows for situations that when a keyboard layout driver is
255 // loaded as part of system initialization, the system will default
256 // the keyboard behavior to the new layout.
257 //
258 // Each call to update the keyboard mapping should contain the
259 // complete set of key descriptors to be updated, since every
260 // call to the HII which contains an EFI_HII_KEYBOARD_PACK will
261 // wipe the previous set of overrides. A call to
262 //
263 typedef struct {
264 EFI_HII_PACK_HEADER Header;
265 FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor;
266 UINT8 DescriptorCount;
267 } EFI_HII_KEYBOARD_PACK;
268
269 //
270 // The EFI_HII_PACKAGES can contain different types of packages just
271 // after the structure as inline data.
272 //
273 typedef struct {
274 UINTN NumberOfPackages;
275 EFI_GUID *GuidId;
276 //
277 // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
278 // EFI_HII_IFR_PACK *IfrPack; // Only one pack.
279 // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
280 // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
281 // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
282 //
283 } EFI_HII_PACKAGES;
284
285 typedef struct _EFI_HII_VARIABLE_PACK_LIST {
286 struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
287 EFI_HII_VARIABLE_PACK *VariablePack;
288 } EFI_HII_VARIABLE_PACK_LIST;
289
290
291 #pragma pack()
292
293 /**
294 Registers the various packs that are passed in via the Packages parameter.
295
296 @param This A pointer to the EFI_HII_PROTOCOL instance.
297 @param Packages A pointer to an EFI_HII_PACKAGES package instance.
298 @param Handle A pointer to the FRAMEWORK_EFI_HII_HANDLE instance.
299
300 @retval EFI_SUCCESS Data was extracted from Packages, the database
301 was updated with the data, and Handle returned successfully.
302 @retval EFI_INVALID_PARAMETER The content of Packages was invalid.
303
304 **/
305 typedef
306 EFI_STATUS
307 (EFIAPI *FRAMEWORK_EFI_HII_NEW_PACK) (
308 IN EFI_HII_PROTOCOL *This,
309 IN EFI_HII_PACKAGES *Packages,
310 OUT FRAMEWORK_EFI_HII_HANDLE *Handle
311 );
312
313 /**
314 Removes a package from the HII database.
315
316 @param This A pointer to the EFI_HII_PROTOCOL instance.
317 @param Handle The handle that was registered to the data that is requested
318 for removal.
319
320 @retval EFI_SUCCESS The data associated with the Handle was removed
321 from the HII database.
322 @retval EFI_INVALID_PARAMETER The Handle was not valid.
323
324 **/
325 typedef
326 EFI_STATUS
327 (EFIAPI *FRAMEWORK_EFI_HII_REMOVE_PACK) (
328 IN EFI_HII_PROTOCOL *This,
329 IN FRAMEWORK_EFI_HII_HANDLE Handle
330 );
331
332 /**
333 Determines the handles that are currently active in the database.
334
335 @param This A pointer to the EFI_HII_PROTOCOL instance.
336 @param HandleBufferLength On input, a pointer to the length of the handle
337 buffer. On output, the length of the handle buffer that is required
338 for the handles found.
339 @param Handle An array of FRAMEWORK_EFI_HII_HANDLE instances returned.
340
341 @retval EFI_SUCCESS Handle was updated successfully.
342 @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates
343 that Handle is too small to support the number of handles.
344
345 **/
346 typedef
347 EFI_STATUS
348 (EFIAPI *FRAMEWORK_EFI_HII_FIND_HANDLES) (
349 IN EFI_HII_PROTOCOL *This,
350 IN OUT UINT16 *HandleBufferLength,
351 OUT FRAMEWORK_EFI_HII_HANDLE *Handle
352 );
353
354 /**
355 Exports the contents of the database into a buffer.
356
357 @param This A pointer to the EFI_HII_PROTOCOL instance.
358 @param Handle An FRAMEWORK_EFI_HII_HANDLE that corresponds to the desired
359 handle to export. If the value is 0, the entire database will be exported.
360 In either case, the data will be exported in a format described by the
361 structure definition of EFI_HII_EXPORT_TABLE.
362 @param BufferSize
363 On input, a pointer to the length of the buffer. On output, the length
364 of the buffer that is required for the export data.
365 @param Buffer A pointer to a buffer that will contain the results of the export function.
366
367 @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.
368 @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.
369
370 **/
371 typedef
372 EFI_STATUS
373 (EFIAPI *FRAMEWORK_EFI_HII_EXPORT) (
374 IN EFI_HII_PROTOCOL *This,
375 IN FRAMEWORK_EFI_HII_HANDLE Handle,
376 IN OUT UINTN *BufferSize,
377 OUT VOID *Buffer
378 );
379
380 /**
381 Remove any new strings that were added after the initial string export
382 for this handle.
383
384 @param This A pointer to the EFI_HII_PROTOCOL instance.
385 @param Handle The handle on which the string resides.
386
387 @retval EFI_SUCCESS Remove strings from the handle successfully.
388 @retval EFI_INVALID_PARAMETER The Handle was unknown.
389
390 **/
391 typedef
392 EFI_STATUS
393 (EFIAPI *FRAMEWORK_EFI_HII_RESET_STRINGS) (
394 IN EFI_HII_PROTOCOL *This,
395 IN FRAMEWORK_EFI_HII_HANDLE Handle
396 );
397
398 /**
399 Tests if all of the characters in a string have corresponding font characters.
400
401 @param This A pointer to the EFI_HII_PROTOCOL instance.
402 @param StringToTest A pointer to a Unicode string.
403 @param FirstMissing A pointer to an index into the string. On input,
404 the index of the first character in the StringToTest to examine. On exit,
405 the index of the first character encountered for which a glyph is unavailable.
406 If all glyphs in the string are available, the index is the index of the
407 terminator of the string.
408 @param GlyphBufferSize A pointer to a value. On output, if the function
409 returns EFI_SUCCESS, it contains the amount of memory that is required to
410 store the string's glyph equivalent.
411
412 @retval EFI_SUCCESS All glyphs are available. Note that an empty string
413 always returns this value.
414 @retval EFI_NOT_FOUND A glyph was not found for a character.
415
416 **/
417 typedef
418 EFI_STATUS
419 (EFIAPI *FRAMEWORK_EFI_HII_TEST_STRING) (
420 IN EFI_HII_PROTOCOL *This,
421 IN CHAR16 *StringToTest,
422 IN OUT UINT32 *FirstMissing,
423 OUT UINT32 *GlyphBufferSize
424 );
425
426 /**
427 Translates a Unicode character into the corresponding font glyph.
428
429 @param This A pointer to the EFI_HII_PROTOCOL instance.
430 @param Source A pointer to a Unicode string.
431 @param Index On input, the offset into the string from which to fetch
432 the character.On successful completion, the index is updated to the first
433 character past the character(s) making up the just extracted glyph.
434 @param GlyphBuffer Pointer to an array where the glyphs corresponding
435 to the characters in the source may be stored. GlyphBuffer is assumed
436 to be wide enough to accept a wide glyph character.
437 @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by
438 this value is filled with the length of the glyph in pixels. It is unchanged
439 if the call was unsuccessful.
440 @param InternalStatus The cell pointed to by this parameter must be
441 initialized to zero prior to invoking the call the first time for any string.
442
443 @retval EFI_SUCCESS It worked.
444 @retval EFI_NOT_FOUND A glyph for a character was not found.
445
446 **/
447 typedef
448 EFI_STATUS
449 (EFIAPI *FRAMEWORK_EFI_HII_GET_GLYPH) (
450 IN EFI_HII_PROTOCOL *This,
451 IN CHAR16 *Source,
452 IN OUT UINT16 *Index,
453 OUT UINT8 **GlyphBuffer,
454 OUT UINT16 *BitWidth,
455 IN OUT UINT32 *InternalStatus
456 );
457
458 /**
459 Translates a glyph into the format required for input to the Universal
460 Graphics Adapter (UGA) Block Transfer (BLT) routines.
461
462 @param This A pointer to the EFI_HII_PROTOCOL instance.
463 @param GlyphBuffer A pointer to the buffer that contains glyph data.
464 @param Foreground The foreground setting requested to be used for the
465 generated BltBuffer data.
466 @param Background The background setting requested to be used for the
467 generated BltBuffer data.
468 @param Count The entry in the BltBuffer upon which to act.
469 @param Width The width in bits of the glyph being converted.
470 @param Height The height in bits of the glyph being converted
471 @param BltBuffer A pointer to the buffer that contains the data that is
472 ready to be used by the UGA BLT routines.
473
474 @retval EFI_SUCCESS It worked.
475 @retval EFI_NOT_FOUND A glyph for a character was not found.
476
477 **/
478 typedef
479 EFI_STATUS
480 (EFIAPI *FRAMEWORK_EFI_HII_GLYPH_TO_BLT) (
481 IN EFI_HII_PROTOCOL *This,
482 IN UINT8 *GlyphBuffer,
483 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
484 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
485 IN UINTN Count,
486 IN UINTN Width,
487 IN UINTN Height,
488 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
489 );
490
491 /**
492 Allows a new string to be added to an already existing string package.
493
494 @param This A pointer to the EFI_HII_PROTOCOL instance.
495 @param Pointer to a NULL-terminated string containing a single ISO 639-2
496 language identifier, indicating the language in which the string is translated.
497 @param Handle The handle of the language pack to which the string is to be added.
498 @param Reference The identifier of the string to be added. If the reference
499 value is zero, then the string will be assigned a new identifier on that
500 handle for the language specified. Otherwise, the string will be updated
501 with the NewString Value.
502 @param NewString The string to be added.
503
504 @retval EFI_SUCCESS The string was effectively registered.
505 @retval EFI_INVALID_PARAMETER The Handle was unknown.
506
507 **/
508 typedef
509 EFI_STATUS
510 (EFIAPI *FRAMEWORK_EFI_HII_NEW_STRING) (
511 IN EFI_HII_PROTOCOL *This,
512 IN CHAR16 *Language,
513 IN FRAMEWORK_EFI_HII_HANDLE Handle,
514 IN OUT STRING_REF *Reference,
515 IN CHAR16 *NewString
516 );
517
518 /**
519 Allows a program to determine the primary languages that are supported
520 on a given handle.
521
522 @param This A pointer to the EFI_HII_PROTOCOL instance.
523 @param Handle The handle on which the strings reside.
524 @param LanguageString A string allocated by GetPrimaryLanguages() that
525 contains a list of all primary languages registered on the handle.
526
527 @retval EFI_SUCCESS LanguageString was correctly returned.
528 @retval EFI_INVALID_PARAMETER The Handle was unknown.
529
530 **/
531 typedef
532 EFI_STATUS
533 (EFIAPI *FRAMEWORK_EFI_HII_GET_PRI_LANGUAGES) (
534 IN EFI_HII_PROTOCOL *This,
535 IN FRAMEWORK_EFI_HII_HANDLE Handle,
536 OUT EFI_STRING *LanguageString
537 );
538
539 /**
540 Allows a program to determine which secondary languages are supported
541 on a given handle for a given primary language.
542
543 @param This A pointer to the EFI_HII_PROTOCOL instance.
544 @param Handle The handle on which the strings reside.
545 @param PrimaryLanguage Pointer to a NULL-terminated string containing a single
546 ISO 639-2 language identifier, indicating the primary language.
547 @param LanguageString A string allocated by GetSecondaryLanguages()
548 containing a list of all secondary languages registered on the handle.
549
550 @retval EFI_SUCCESS LanguageString was correctly returned.
551 @retval EFI_INVALID_PARAMETER The Handle was unknown.
552
553 **/
554 typedef
555 EFI_STATUS
556 (EFIAPI *FRAMEWORK_EFI_HII_GET_SEC_LANGUAGES) (
557 IN EFI_HII_PROTOCOL *This,
558 IN FRAMEWORK_EFI_HII_HANDLE Handle,
559 IN CHAR16 *PrimaryLanguage,
560 OUT EFI_STRING *LanguageString
561 );
562
563 /**
564 Extracts a string from a package already registered with the EFI HII database.
565
566 @param This A pointer to the EFI_HII_PROTOCOL instance.
567 @param Handle The handle on which the string resides.
568 @param Token The string token assigned to the string.
569 @param Raw If TRUE, the string is returned unedited in the internal
570 storage format described above. If false, the string returned is edited
571 by replacing <cr> with <space> and by removing special characters such
572 as the <wide> prefix.
573 @param LanguageString Pointer to a NULL-terminated string containing a
574 single ISO 639-2 language identifier, indicating the language to print.
575 If the LanguageString is empty (starts with a NULL), the default system
576 language will be used to determine the language.
577 @param BufferLength Length of the StringBuffer.
578 @param StringBuffer The buffer designed to receive the characters in the string.
579
580 @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.
581 @retval EFI_INVALID_PARAMETER The handle or string token is unknown.
582 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to
583 allow the entire string to be stored.
584
585 **/
586 typedef
587 EFI_STATUS
588 (EFIAPI *FRAMEWORK_EFI_HII_GET_STRING) (
589 IN EFI_HII_PROTOCOL *This,
590 IN FRAMEWORK_EFI_HII_HANDLE Handle,
591 IN STRING_REF Token,
592 IN BOOLEAN Raw,
593 IN CHAR16 *LanguageString,
594 IN OUT UINTN *BufferLength,
595 OUT EFI_STRING StringBuffer
596 );
597
598 /**
599 Allows a program to extract a part of a string of not more than a given width.
600
601 @param This A pointer to the EFI_HII_PROTOCOL instance.
602 @param Handle The handle on which the string resides.
603 @param Token The string token assigned to the string.
604 @param Index On input, the offset into the string where the line is to start.
605 On output, the index is updated to point to beyond the last character returned
606 in the call.
607 @param LineWidth The maximum width of the line in units of narrow glyphs.
608 @param LanguageString Pointer to a NULL-terminated string containing a
609 single ISO 639-2 language identifier, indicating the language to print.
610 @param BufferLength Pointer to the length of the StringBuffer.
611 @param StringBuffer The buffer designed to receive the characters in the string.
612
613 @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.
614 @retval EFI_NOT_FOUND The font glyph for at least one of the characters in
615 the string is not in the font database.
616 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
617 to allow the entire string to be stored.
618
619 **/
620 typedef
621 EFI_STATUS
622 (EFIAPI *FRAMEWORK_EFI_HII_GET_LINE) (
623 IN EFI_HII_PROTOCOL *This,
624 IN FRAMEWORK_EFI_HII_HANDLE Handle,
625 IN STRING_REF Token,
626 IN OUT UINT16 *Index,
627 IN UINT16 LineWidth,
628 IN CHAR16 *LanguageString,
629 IN OUT UINT16 *BufferLength,
630 OUT EFI_STRING StringBuffer
631 );
632
633 /**
634 Allows a program to extract a form or form package that has previously
635 been registered with the HII database.
636
637 @param This A pointer to the EFI_HII_PROTOCOL instance.
638 @param Handle Handle on which the form resides.
639 @param FormId The ID of the form to return. If the ID is zero,
640 the entire form package is returned.
641 @param BufferLength On input, the length of the Buffer. On output,
642 the length of the returned buffer,
643 @param Buffer The buffer designed to receive the form(s).
644
645 @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength
646 was updated.
647 @retval EFI_INVALID_PARAMETER The handle is unknown.
648 @retval EFI_NOT_FOUND A form on the requested handle cannot be found with
649 the requested FormId.
650 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
651 to allow the form to be stored.
652
653 **/
654 typedef
655 EFI_STATUS
656 (EFIAPI *FRAMEWORK_EFI_HII_GET_FORMS) (
657 IN EFI_HII_PROTOCOL *This,
658 IN FRAMEWORK_EFI_HII_HANDLE Handle,
659 IN EFI_FORM_ID FormId,
660 IN OUT UINTN *BufferLength,
661 OUT UINT8 *Buffer
662 );
663
664 /**
665 Extracts the defaults that are associated with a given handle in the HII database.
666
667 @param This A pointer to the EFI_HII_PROTOCOL instance.
668 @param Handle The HII handle from which will have default data retrieved.
669 @param DefaultMask The mask used to specify some type of default override when extracting
670 the default image data.
671 @param VariablePackList A indirect pointer to the first entry of a link list with
672 type EFI_HII_VARIABLE_PACK_LIST.
673
674 @retval EFI_SUCCESS The VariablePackList was populated with the appropriate
675 default setting data.
676 @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).
677 @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle
678 contain invalid data.
679
680 **/
681 typedef
682 EFI_STATUS
683 (EFIAPI *FRAMEWORK_EFI_HII_GET_DEFAULT_IMAGE) (
684 IN EFI_HII_PROTOCOL *This,
685 IN FRAMEWORK_EFI_HII_HANDLE Handle,
686 IN UINTN DefaultMask,
687 OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
688 );
689
690 /**
691 Allows the caller to update a form or form package that has previously been
692 registered with the EFI HII database.
693
694 @param This A pointer to the EFI_HII_PROTOCOL instance.
695 @param Handle Handle of the package where the form to be updated resides.
696 @param Label The label inside the form package where the update is to take place.
697 @param AddData If TRUE, adding data at a given Label; otherwise,
698 if FALSE, removing data at a given Label.
699 @param Data The buffer containing the new tags to insert after the Label
700
701 @retval EFI_SUCCESS The form was updated with the new tags.
702 @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not
703 contain an integral number of tags.
704 @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.
705
706 **/
707 typedef
708 EFI_STATUS
709 (EFIAPI *FRAMEWORK_EFI_HII_UPDATE_FORM) (
710 IN EFI_HII_PROTOCOL *This,
711 IN FRAMEWORK_EFI_HII_HANDLE Handle,
712 IN EFI_FORM_LABEL Label,
713 IN BOOLEAN AddData,
714 IN EFI_HII_UPDATE_DATA *Data
715 );
716
717 /**
718 Retrieves the current keyboard layout.
719
720 @param This A pointer to the EFI_HII_PROTOCOL instance.
721 @param DescriptorCount A pointer to the number of Descriptor entries being
722 described in the keyboard layout being retrieved.
723 @param Descriptor A pointer to a buffer containing an array of FRAMEWORK_EFI_KEY_DESCRIPTOR
724 entries. Each entry will reflect the definition of a specific physical key.
725
726 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
727
728 **/
729 typedef
730 EFI_STATUS
731 (EFIAPI *FRAMEWORK_EFI_HII_GET_KEYBOARD_LAYOUT) (
732 IN EFI_HII_PROTOCOL *This,
733 OUT UINT16 *DescriptorCount,
734 OUT FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor
735 );
736
737 /**
738 @par Protocol Description:
739 The HII Protocol manages the HII database, which is a repository for data
740 having to do with fonts, strings, forms, keyboards, and other future human
741 interface items.
742
743 @param NewPack
744 Extracts the various packs from a package list.
745
746 @param RemovePack
747 Removes a package from the HII database.
748
749 @param FindHandles
750 Determines the handles that are currently active in the database.
751
752 @param ExportDatabase
753 Export the entire contents of the database to a buffer.
754
755 @param TestString
756 Tests if all of the characters in a string have corresponding font characters.
757
758 @param GetGlyph
759 Translates a Unicode character into the corresponding font glyph.
760
761 @param GlyphToBlt
762 Converts a glyph value into a format that is ready for a UGA BLT command.
763
764 @param NewString
765 Allows a new string to be added to an already existing string package.
766
767 @param GetPrimaryLanguages
768 Allows a program to determine the primary languages that are supported
769 on a given handle.
770
771 @param GetSecondaryLanguages
772 Allows a program to determine which secondary languages are supported
773 on a given handle for a given primary language.
774
775 @param GetString
776 Extracts a string from a package that is already registered with the
777 EFI HII database.
778
779 @param ResetString
780 Remove any new strings that were added after the initial string export
781 for this handle.
782
783 @param GetLine
784 Allows a program to extract a part of a string of not more than a given width.
785
786 @param GetForms
787 Allows a program to extract a form or form package that has been previously registered.
788
789 @param GetDefaultImage
790 Allows a program to extract the nonvolatile image that represents the default storage image.
791
792 @param UpdateForm
793 Allows a program to update a previously registered form.
794
795 @param GetKeyboardLayout
796 Allows a program to extract the current keyboard layout.
797
798 **/
799 struct _EFI_HII_PROTOCOL {
800 FRAMEWORK_EFI_HII_NEW_PACK NewPack;
801 FRAMEWORK_EFI_HII_REMOVE_PACK RemovePack;
802 FRAMEWORK_EFI_HII_FIND_HANDLES FindHandles;
803 FRAMEWORK_EFI_HII_EXPORT ExportDatabase;
804
805 FRAMEWORK_EFI_HII_TEST_STRING TestString;
806 FRAMEWORK_EFI_HII_GET_GLYPH GetGlyph;
807 FRAMEWORK_EFI_HII_GLYPH_TO_BLT GlyphToBlt;
808
809 FRAMEWORK_EFI_HII_NEW_STRING NewString;
810 FRAMEWORK_EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
811 FRAMEWORK_EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;
812 FRAMEWORK_EFI_HII_GET_STRING GetString;
813 FRAMEWORK_EFI_HII_RESET_STRINGS ResetStrings;
814 FRAMEWORK_EFI_HII_GET_LINE GetLine;
815 FRAMEWORK_EFI_HII_GET_FORMS GetForms;
816 FRAMEWORK_EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;
817 FRAMEWORK_EFI_HII_UPDATE_FORM UpdateForm;
818
819 FRAMEWORK_EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
820 };
821
822 extern EFI_GUID gEfiHiiProtocolGuid;
823
824 #endif