]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/FrameworkHii.h
fixed wrong comments format.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / FrameworkHii.h
1 /** @file
2 This file defines the Human Interface Infrastructure protocol, which is
3 used by resources that want to publish IFR/Font/String data and have it
4 collected by the Configuration engine. This protocol is defined in the.
5 Intel Platform Innovation Framework for EFI Human Interface Infrastructure
6 Specification Version 0.92.
7
8 Copyright (c) 2007 - 2009, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 **/
18
19 #ifndef _FRAMEWORK_HII_H_
20 #define _FRAMEWORK_HII_H_
21
22 //
23 // EFI_GRAPHICS_OUTPUT_BLT_PIXEL is defined in MdePkg/Protocol/GraphicsOutput.h
24 //
25 #include <Protocol/GraphicsOutput.h>
26 ///
27 /// In both EDK and EDK II, incompatbile change is done to Framework HII protocol.
28 /// This change should cause a change of GUID in both of code and HII spec. But we
29 /// update the GUID in code in EDK and EDK II. The 0.92 spec is not updated. This
30 /// is a known issue.
31 ///
32 ///
33 /// Note that EFI_HII_PROTOCOL_GUID is different from that defined in the Framework HII
34 /// 0.92 spec because the spec changed part of HII interfaces but did not update the protocol
35 /// GUID.
36 ///
37 #define EFI_HII_PROTOCOL_GUID \
38 { \
39 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
40 }
41
42 #define EFI_HII_COMPATIBILITY_PROTOCOL_GUID \
43 { \
44 0x5542cce1, 0xdf5c, 0x4d1b, { 0xab, 0xca, 0x36, 0x4f, 0x77, 0xd3, 0x99, 0xfb } \
45 }
46
47 typedef UINT32 RELOFST;
48
49 typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
50
51 ///
52 /// Note: Name difference between code and the Framework HII 0.92 spec.
53 /// Add FRAMEWORK_ prefix to avoid name confict with EFI_HII_HANDLE defined in the
54 /// UEFI 2.1d spec.
55 ///
56 typedef UINT16 FRAMEWORK_EFI_HII_HANDLE;
57
58 ///
59 /// HII package type values
60 ///
61 #define EFI_HII_FONT 1
62 #define EFI_HII_STRING 2
63 #define EFI_HII_IFR 3
64 #define EFI_HII_KEYBOARD 4
65 #define EFI_HII_HANDLES 5
66 #define EFI_HII_VARIABLE 6
67 #define EFI_HII_DEVICE_PATH 7
68
69 //
70 // References to string tokens must use this macro to enable scanning for
71 // token usages.
72 //
73 #define STRING_TOKEN(t) t
74
75 //
76 // The following types are currently defined:
77 // EFI_FORM_ID has been defined in UEFI spec.
78 //
79 typedef UINT16 EFI_FORM_LABEL;
80
81 #pragma pack(1)
82
83 ///
84 /// The header found at the start of each package.
85 ///
86 typedef struct {
87 UINT32 Length; ///< The size of the package in bytes.
88 UINT16 Type; ///< The type of the package.
89 } EFI_HII_PACK_HEADER;
90
91 ///
92 /// IFR package structure.
93 /// Immediately following the EFI_HII_IFR_PACK structure will be a series of IFR opcodes.
94 ///
95 typedef struct {
96 EFI_HII_PACK_HEADER Header; ///< Header of the IFR package.
97 } EFI_HII_IFR_PACK;
98
99 ///
100 /// HII Handle package structure.
101 ///
102 typedef struct {
103 ///
104 /// Header of the package.
105 ///
106 EFI_HII_PACK_HEADER Header; ///< Must be filled in
107 ///
108 /// The image handle of the driver to which the package is referring.
109 ///
110 EFI_HANDLE ImageHandle; ///< Must be filled in
111 ///
112 /// The handle of the device that is being described by this package.
113 ///
114 EFI_HANDLE DeviceHandle; ///< Optional
115 ///
116 /// The handle of the parent of the device that is being described by this package.
117 ///
118 EFI_HANDLE ControllerHandle; ///< Optional
119 ///
120 /// The handle that was registered to receive EFI_FORM_CALLBACK_PROTOCOL calls from other drivers.
121 ///
122 EFI_HANDLE CallbackHandle; ///< Optional
123 ///
124 /// Note this field is not defined in the Framework HII 0.92 spec.
125 /// Unused. Reserved for source code compatibility.
126 ///
127 EFI_HANDLE COBExportHandle; ///< Optional
128 } EFI_HII_HANDLE_PACK;
129
130 ///
131 /// Variable package structure.
132 ///
133 typedef struct {
134 ///
135 /// Header of the package.
136 ///
137 EFI_HII_PACK_HEADER Header;
138 ///
139 /// GUID of the EFI variable
140 ///
141 EFI_GUID VariableGuid;
142 ///
143 /// Length in bytes of the EFI variable
144 ///
145 UINT32 VariableNameLength;
146 ///
147 /// The unique value for this variable
148 ///
149 UINT16 VariableId;
150 //
151 // CHAR16 VariableName[]; //Null-terminated
152 //
153 } EFI_HII_VARIABLE_PACK;
154
155 ///
156 /// Device path package structure.
157 ///
158 typedef struct {
159 ///
160 /// Header of the package.
161 ///
162 EFI_HII_PACK_HEADER Header;
163 //
164 // EFI_DEVICE_PATH DevicePath[];
165 //
166 } EFI_HII_DEVICE_PATH_PACK;
167
168 typedef struct {
169 ///
170 /// Unique value that correlates to the original HII handle.
171 ///
172 FRAMEWORK_EFI_HII_HANDLE HiiHandle;
173 ///
174 /// If an IFR pack exists in a data table that does not contain strings,
175 /// then the strings for that IFR pack are located in another data table
176 /// that contains a string pack and has a matching HiiDataTable.PackageGuid.
177 ///
178 EFI_GUID PackageGuid;
179 ///
180 /// Size of the EFI_HII_DATA_TABLE in bytes.
181 ///
182 UINT32 DataTableSize;
183 ///
184 /// Byte offset from the start of this structure to the IFR data.
185 /// If the offset value is 0, then no IFR data is enclosed.
186 ///
187 UINT32 IfrDataOffset;
188 ///
189 /// Byte offset from the start of this structure to the string data.
190 /// If the offset value is 0, then no string data is enclosed.
191 ///
192 UINT32 StringDataOffset;
193 ///
194 /// Byte offset from the start of this structure to the variable data.
195 /// If the offset value is 0, then no variable data is enclosed.
196 ///
197 UINT32 VariableDataOffset;
198 ///
199 /// Byte offset from the start of this structure to the device path data.
200 /// If the offset value is 0, then no DevicePath data is enclosed.
201 ///
202 UINT32 DevicePathOffset;
203 ///
204 /// Number of VariableData[] elements in the array.
205 ///
206 UINT32 NumberOfVariableData;
207 ///
208 /// The number of language string packages.
209 ///
210 UINT32 NumberOfLanguages;
211 //
212 // EFI_HII_DEVICE_PATH_PACK DevicePath[];
213 // EFI_HII_VARIABLE_PACK VariableData[];
214 // EFI_HII_IFR_PACK IfrData;
215 // EFI_HII_STRING_PACK StringData[];
216 //
217 } EFI_HII_DATA_TABLE;
218
219 ///
220 /// Structure defining format for exporting data from the HII Database.
221 ///
222 typedef struct {
223 ///
224 /// Number of EFI_HII_DATA_TABLE entries.
225 ///
226 UINT32 NumberOfHiiDataTables;
227 ///
228 /// Defines the revision of the EFI_HII_DATA_TABLE structure.
229 ///
230 EFI_GUID Revision;
231 //
232 // EFI_HII_DATA_TABLE HiiDataTable[];
233 //
234 } EFI_HII_EXPORT_TABLE;
235
236 ///
237 /// Structure used to pass data to update a form or form package
238 /// that has previously been registered with the EFI HII database.
239 ///
240 typedef struct {
241 ///
242 /// If TRUE, indicates that the FormCallbackHandle value will
243 /// be used to update the contents of the CallBackHandle entry in the form set.
244 ///
245 BOOLEAN FormSetUpdate;
246 ///
247 /// This parameter is valid only when FormSetUpdate is TRUE.
248 /// The value in this parameter will be used to update the contents
249 /// of the CallbackHandle entry in the form set.
250 ///
251 EFI_PHYSICAL_ADDRESS FormCallbackHandle;
252 ///
253 /// If TRUE, indicates that the FormTitle contents will be
254 /// used to update the FormValue's title.
255 ///
256 BOOLEAN FormUpdate;
257 ///
258 /// Specifies which form is to be updated if the FormUpdate value is TRUE.
259 ///
260 UINT16 FormValue;
261 ///
262 /// This parameter is valid only when the FormUpdate parameter is TRUE.
263 /// The value in this parameter will be used to update the contents of the form title.
264 ///
265 STRING_REF FormTitle;
266 ///
267 /// The number of Data entries in this structure.
268 UINT16 DataCount;
269 ///
270 /// An array of 1+ opcodes, specified by DataCount.
271 ///
272 UINT8 *Data;
273 } EFI_HII_UPDATE_DATA;
274
275 //
276 // String attributes
277 //
278 #define LANG_RIGHT_TO_LEFT 0x00000001
279
280 ///
281 /// A string package is used to localize strings to a particular
282 /// language. The package is associated with a particular driver
283 /// or set of drivers. Tools are used to associate tokens with
284 /// string references in forms and in programs. These tokens are
285 /// language agnostic. When paired with a language pack (directly
286 /// or indirectly), the string token resolves into an actual
287 /// UNICODE string. The NumStringPointers determines how many
288 /// StringPointers (offset values) there are as well as the total
289 /// number of Strings that are defined.
290 ///
291 typedef struct {
292 ///
293 /// Header of the package.
294 ///
295 EFI_HII_PACK_HEADER Header;
296 ///
297 /// The string containing one or more ISO 639-2 three-character designator(s)
298 /// of the language or languages whose translations are contained in this language pack.
299 /// The first designator indicates the primary language while the others are secondary languages.
300 ///
301 RELOFST LanguageNameString;
302 ///
303 /// Contains the offset into this structure of a printable name of the language
304 /// for use when prompting the user. The language printed is to be the primary language.
305 ///
306 RELOFST PrintableLanguageName;
307 ///
308 /// The number of Strings and StringPointers contained within the string package.
309 ///
310 UINT32 NumStringPointers;
311 ///
312 /// Indicates the direction the language is to be printed.
313 ///
314 UINT32 Attributes;
315 //
316 // RELOFST StringPointers[];
317 // EFI_STRING Strings[];
318 //
319 } EFI_HII_STRING_PACK;
320
321
322 ///
323 /// A font list consists of a font header followed by a series
324 /// of glyph structures. Note that fonts are not language specific.
325 ///
326 typedef struct {
327 ///
328 /// Header of the package.
329 ///
330 EFI_HII_PACK_HEADER Header;
331 ///
332 /// The number of NarrowGlyphs that are included in the font package.
333 ///
334 UINT16 NumberOfNarrowGlyphs;
335 ///
336 /// The number of WideGlyphs that are included in the font package.
337 ///
338 UINT16 NumberOfWideGlyphs;
339 //EFI_NARROW_GLYPH NarrowGlyphs[];
340 //EFI_WIDE_GLYPH WideGlyphs[];
341 } EFI_HII_FONT_PACK;
342
343 ///
344 /// The definition of a specific physical key
345 ///
346 /// Note: Name difference between code and the Framework HII 0.92 spec.
347 /// Add FRAMEWORK_ prefix to avoid name confict with EFI_KEY_DESCRIPTOR defined in the
348 /// UEFI 2.1d spec.
349 ///
350 typedef struct {
351 ///
352 /// Used to describe a physical key on a keyboard.
353 ///
354 EFI_KEY Key;
355 ///
356 /// Unicode value for the Key.
357 CHAR16 Unicode;
358 ///
359 /// Unicode value for the key with the shift key being held down.
360 ///
361 CHAR16 ShiftedUnicode;
362 ///
363 /// Unicode value for the key with the Alt-GR being held down.
364 ///
365 CHAR16 AltGrUnicode;
366 ///
367 /// Unicode value for the key with the Alt-GR and shift keys being held down.
368 ///
369 CHAR16 ShiftedAltGrUnicode;
370 ///
371 /// Modifier keys are defined to allow for special functionality that
372 /// is not necessarily accomplished by a printable character.
373 ///
374 UINT16 Modifier;
375 } FRAMEWORK_EFI_KEY_DESCRIPTOR;
376
377 ///
378 /// This structure allows a sparse set of keys to be redefined
379 /// or a complete redefinition of the keyboard layout. Most
380 /// keyboards have a lot of commonality in their layouts, therefore
381 /// only defining those keys that need to change from the default
382 /// minimizes the passed in information.
383 ///
384 /// Additionally, when an update occurs, the active keyboard layout
385 /// will be switched to the newly updated keyboard layout. This
386 /// allows for situations that when a keyboard layout driver is
387 /// loaded as part of system initialization, the system will default
388 /// the keyboard behavior to the new layout.
389 ///
390 typedef struct {
391 ///
392 /// Header of the package.
393 EFI_HII_PACK_HEADER Header;
394 ///
395 /// A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR entries.
396 /// Each entry will reflect the definition of a specific physical key.
397 ///
398 FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor;
399 ///
400 /// The number of Descriptor entries being described.
401 ///
402 UINT8 DescriptorCount;
403 } EFI_HII_KEYBOARD_PACK;
404
405 ///
406 /// The packages structure that will be used to pass contents into the HII database.
407 ///
408 /// The EFI_HII_PACKAGES can contain various number of packages of different types just
409 /// after the structure as inline data.
410 ///
411 typedef struct {
412 ///
413 /// The number of packages being defined in this structure.
414 ///
415 UINTN NumberOfPackages;
416 ///
417 /// The GUID to be used to identify this set of packages that are being exported
418 /// to the HII database.
419 ///
420 EFI_GUID *GuidId;
421 //
422 // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
423 // EFI_HII_IFR_PACK *IfrPack; // Only one pack.
424 // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
425 // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
426 // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
427 //
428 } EFI_HII_PACKAGES;
429
430 ///
431 /// Packed link list that contains all the discernable defaults of variables
432 /// for the opcodes that are defined in this Handle's domain of data.
433 ///
434 typedef struct _EFI_HII_VARIABLE_PACK_LIST {
435 ///
436 /// A pointer points to the next data structure of type
437 /// EFI_HII_VARIABLE_PACK_LIST in the packed link list.
438 ///
439 struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
440 ///
441 /// A pointer points to the content of the variable entry defined by GUID/name/data.
442 ///
443 EFI_HII_VARIABLE_PACK *VariablePack;
444 //EFI_HII_VARIABLE_PACK Content
445 } EFI_HII_VARIABLE_PACK_LIST;
446
447
448 #pragma pack()
449
450 /**
451 Registers the various packs that are passed in via the Packages parameter.
452
453 @param This A pointer to the EFI_HII_PROTOCOL instance.
454 @param Packages A pointer to an EFI_HII_PACKAGES package instance.
455 @param Handle A pointer to the FRAMEWORK_EFI_HII_HANDLE instance.
456
457 @retval EFI_SUCCESS Data was extracted from Packages, the database
458 was updated with the data, and Handle returned successfully.
459 @retval EFI_INVALID_PARAMETER The content of Packages was invalid.
460
461 **/
462 typedef
463 EFI_STATUS
464 (EFIAPI *EFI_HII_NEW_PACK)(
465 IN EFI_HII_PROTOCOL *This,
466 IN EFI_HII_PACKAGES *Packages,
467 OUT FRAMEWORK_EFI_HII_HANDLE *Handle
468 );
469
470 /**
471 Removes a package from the HII database.
472
473 @param This A pointer to the EFI_HII_PROTOCOL instance.
474 @param Handle The handle that was registered to the data that is requested
475 for removal.
476
477 @retval EFI_SUCCESS The data associated with the Handle was removed
478 from the HII database.
479 @retval EFI_INVALID_PARAMETER The Handle was not valid.
480
481 **/
482 typedef
483 EFI_STATUS
484 (EFIAPI *EFI_HII_REMOVE_PACK)(
485 IN EFI_HII_PROTOCOL *This,
486 IN FRAMEWORK_EFI_HII_HANDLE Handle
487 );
488
489 /**
490 Determines the handles that are currently active in the database.
491
492 @param This A pointer to the EFI_HII_PROTOCOL instance.
493 @param HandleBufferLength On input, a pointer to the length of the handle
494 buffer. On output, the length of the handle buffer that is required
495 for the handles found.
496 @param Handle An array of FRAMEWORK_EFI_HII_HANDLE instances returned.
497
498 @retval EFI_SUCCESS Handle was updated successfully.
499 @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates
500 that Handle is too small to support the number of handles.
501
502 **/
503 typedef
504 EFI_STATUS
505 (EFIAPI *EFI_HII_FIND_HANDLES)(
506 IN EFI_HII_PROTOCOL *This,
507 IN OUT UINT16 *HandleBufferLength,
508 OUT FRAMEWORK_EFI_HII_HANDLE *Handle
509 );
510
511 /**
512 Exports the contents of the database into a buffer.
513
514 @param This A pointer to the EFI_HII_PROTOCOL instance.
515 @param Handle A FRAMEWORK_EFI_HII_HANDLE that corresponds to the desired
516 handle to export. If the value is 0, the entire database will be exported.
517 The data is exported in a format described by the
518 structure definition of EFI_HII_EXPORT_TABLE.
519 @param BufferSize
520 On input, a pointer to the length of the buffer. On output, the length
521 of the buffer that is required for the export data.
522 @param Buffer A pointer to a buffer that will contain the results of the export function.
523
524 @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.
525 @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.
526
527 **/
528 typedef
529 EFI_STATUS
530 (EFIAPI *EFI_HII_EXPORT)(
531 IN EFI_HII_PROTOCOL *This,
532 IN FRAMEWORK_EFI_HII_HANDLE Handle,
533 IN OUT UINTN *BufferSize,
534 OUT VOID *Buffer
535 );
536
537 /**
538 Remove any new strings that were added after the initial string export
539 for this handle.
540
541 @param This A pointer to the EFI_HII_PROTOCOL instance.
542 @param Handle The handle on which the string resides.
543
544 @retval EFI_SUCCESS Successfully removed strings from the handle.
545 @retval EFI_INVALID_PARAMETER The Handle was unknown.
546
547 **/
548 typedef
549 EFI_STATUS
550 (EFIAPI *EFI_HII_RESET_STRINGS)(
551 IN EFI_HII_PROTOCOL *This,
552 IN FRAMEWORK_EFI_HII_HANDLE Handle
553 );
554
555 /**
556 Tests if all of the characters in a string have corresponding font characters.
557
558 @param This A pointer to the EFI_HII_PROTOCOL instance.
559 @param StringToTest A pointer to a Unicode string.
560 @param FirstMissing A pointer to an index into the string. On input,
561 the index of the first character in the StringToTest to examine. On exit,
562 the index of the first character encountered for which a glyph is unavailable.
563 If all glyphs in the string are available, the index is the index of the
564 terminator of the string.
565 @param GlyphBufferSize A pointer to a value. On output, if the function
566 returns EFI_SUCCESS, it contains the amount of memory that is required to
567 store the string's glyph equivalent.
568
569 @retval EFI_SUCCESS All glyphs are available. Note that an empty string
570 always returns this value.
571 @retval EFI_NOT_FOUND A glyph was not found for a character.
572
573 **/
574 typedef
575 EFI_STATUS
576 (EFIAPI *EFI_HII_TEST_STRING)(
577 IN EFI_HII_PROTOCOL *This,
578 IN CHAR16 *StringToTest,
579 IN OUT UINT32 *FirstMissing,
580 OUT UINT32 *GlyphBufferSize
581 );
582
583 /**
584 Translates a Unicode character into the corresponding font glyph.
585
586 Note that this function prototype name is different from that in the Framework HII 0.92 spec
587 to avoid name confict with EFI_HII_GET_GLYPH defined in the UEFI 2.1d spec.
588
589 @param This A pointer to the EFI_HII_PROTOCOL instance.
590 @param Source A pointer to a Unicode string.
591 @param Index On input, the offset into the string from which to fetch
592 the character. On successful completion, the index is updated to the first
593 character past the character(s) making up the just extracted glyph.
594 @param GlyphBuffer Pointer to an array where the glyphs corresponding
595 to the characters in the source may be stored. GlyphBuffer is assumed
596 to be wide enough to accept a wide glyph character.
597 @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by
598 this value is filled with the length of the glyph in pixels. It is unchanged
599 if the call was unsuccessful.
600 @param InternalStatus The cell pointed to by this parameter must be
601 initialized to zero prior to invoking the call the first time for any string.
602
603 @retval EFI_SUCCESS It worked.
604 @retval EFI_NOT_FOUND A glyph for a character was not found.
605
606 **/
607 typedef
608 EFI_STATUS
609 (EFIAPI *FRAMEWORK_EFI_HII_GET_GLYPH)(
610 IN EFI_HII_PROTOCOL *This,
611 IN CHAR16 *Source,
612 IN OUT UINT16 *Index,
613 OUT UINT8 **GlyphBuffer,
614 OUT UINT16 *BitWidth,
615 IN OUT UINT32 *InternalStatus
616 );
617
618 /**
619 Translates a glyph into the format required for input to the Universal
620 Graphics Adapter (UGA) Block Transfer (BLT) routines.
621
622 @param This A pointer to the EFI_HII_PROTOCOL instance.
623 @param GlyphBuffer A pointer to the buffer that contains glyph data.
624 @param Foreground The foreground setting requested to be used for the
625 generated BltBuffer data.
626 @param Background The background setting requested to be used for the
627 generated BltBuffer data.
628 @param Count The entry in the BltBuffer upon which to act.
629 @param Width The width in bits of the glyph being converted.
630 @param Height The height in bits of the glyph being converted
631 @param BltBuffer A pointer to the buffer that contains the data that is
632 ready to be used by the UGA BLT routines.
633
634 @retval EFI_SUCCESS It worked.
635 @retval EFI_NOT_FOUND A glyph for a character was not found.
636 @note: Inconsistent with specification here:
637 In Framework Spec, HII spec 0.92. The type of 3rd, 4th and 8th parameter is EFI_UGA_PIXEL.
638 Here the definition uses the EFI_GRAPHICS_OUTPUT_BLT_PIXEL, which is defined in UEFI 2.1 spec
639 **/
640 typedef
641 EFI_STATUS
642 (EFIAPI *EFI_HII_GLYPH_TO_BLT)(
643 IN EFI_HII_PROTOCOL *This,
644 IN UINT8 *GlyphBuffer,
645 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
646 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
647 IN UINTN Count,
648 IN UINTN Width,
649 IN UINTN Height,
650 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
651 );
652
653 /**
654 Allows a new string to be added to an already existing string package.
655
656 Note that this function prototype name is different from that in the Framework HII 0.92 spec
657 to avoid name confict with EFI_HII_NEW_STRING defined in the UEFI 2.1d spec.
658
659 @param This A pointer to the EFI_HII_PROTOCOL instance.
660 @param Pointer to a NULL-terminated string containing a single ISO 639-2
661 language identifier, indicating the language in which the string is translated.
662 @param Handle The handle of the language pack to which the string is to be added.
663 @param Reference The identifier of the string to be added. If the reference
664 value is zero, then the string will be assigned a new identifier on that
665 handle for the language specified. Otherwise, the string will be updated
666 with the NewString Value.
667 @param NewString The string to be added.
668
669 @retval EFI_SUCCESS The string was effectively registered.
670 @retval EFI_INVALID_PARAMETER The Handle was unknown.
671
672 **/
673 typedef
674 EFI_STATUS
675 (EFIAPI *FRAMEWORK_EFI_HII_NEW_STRING)(
676 IN EFI_HII_PROTOCOL *This,
677 IN CHAR16 *Language,
678 IN FRAMEWORK_EFI_HII_HANDLE Handle,
679 IN OUT STRING_REF *Reference,
680 IN CHAR16 *NewString
681 );
682
683 /**
684 Allows a program to determine the primary languages that are supported
685 on a given handle.
686
687 @param This A pointer to the EFI_HII_PROTOCOL instance.
688 @param Handle The handle on which the strings reside.
689 @param LanguageString A string allocated by GetPrimaryLanguages() that
690 contains a list of all primary languages registered on the handle.
691
692 @retval EFI_SUCCESS LanguageString was correctly returned.
693 @retval EFI_INVALID_PARAMETER The Handle was unknown.
694
695 **/
696 typedef
697 EFI_STATUS
698 (EFIAPI *EFI_HII_GET_PRI_LANGUAGES)(
699 IN EFI_HII_PROTOCOL *This,
700 IN FRAMEWORK_EFI_HII_HANDLE Handle,
701 OUT EFI_STRING *LanguageString
702 );
703
704 /**
705 Allows a program to determine which secondary languages are supported
706 on a given handle for a given primary language.
707
708 @param This A pointer to the EFI_HII_PROTOCOL instance.
709 @param Handle The handle on which the strings reside.
710 @param PrimaryLanguage Pointer to a NULL-terminated string containing a single
711 ISO 639-2 language identifier, indicating the primary language.
712 @param LanguageString A string allocated by GetSecondaryLanguages()
713 containing a list of all secondary languages registered on the handle.
714
715 @retval EFI_SUCCESS LanguageString was correctly returned.
716 @retval EFI_INVALID_PARAMETER The Handle was unknown.
717
718 **/
719 typedef
720 EFI_STATUS
721 (EFIAPI *EFI_HII_GET_SEC_LANGUAGES)(
722 IN EFI_HII_PROTOCOL *This,
723 IN FRAMEWORK_EFI_HII_HANDLE Handle,
724 IN CHAR16 *PrimaryLanguage,
725 OUT EFI_STRING *LanguageString
726 );
727
728 /**
729 Extracts a string from a package already registered with the EFI HII database.
730
731 Note that this function prototype name is different from that in the Framework HII 0.92 spec
732 to avoid name confict with EFI_HII_GET_STRING defined in the UEFI 2.1d spec.
733
734 @param This A pointer to the EFI_HII_PROTOCOL instance.
735 @param Handle The handle on which the string resides.
736 @param Token The string token assigned to the string.
737 @param Raw If TRUE, the string is returned unedited in the internal
738 storage format. If false, the string returned is edited
739 by replacing <cr> with <space> and by removing special characters such
740 as the <wide> prefix.
741 @param LanguageString Pointer to a NULL-terminated string containing a
742 single ISO 639-2 language identifier, indicating the language to print.
743 If the LanguageString is empty (starts with a NULL), the default system
744 language will be used to determine the language.
745 @param BufferLength Length of the StringBuffer.
746 @param StringBuffer The buffer designed to receive the characters in the string.
747
748 @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.
749 @retval EFI_INVALID_PARAMETER The handle or string token is unknown.
750 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to
751 allow the entire string to be stored.
752
753 **/
754 typedef
755 EFI_STATUS
756 (EFIAPI *FRAMEWORK_EFI_HII_GET_STRING)(
757 IN EFI_HII_PROTOCOL *This,
758 IN FRAMEWORK_EFI_HII_HANDLE Handle,
759 IN STRING_REF Token,
760 IN BOOLEAN Raw,
761 IN CHAR16 *LanguageString,
762 IN OUT UINTN *BufferLength,
763 OUT EFI_STRING StringBuffer
764 );
765
766 /**
767 Allows a program to extract a part of a string of not more than a given width.
768
769 @param This A pointer to the EFI_HII_PROTOCOL instance.
770 @param Handle The handle on which the string resides.
771 @param Token The string token assigned to the string.
772 @param Index On input, the offset into the string where the line is to start.
773 On output, the index is updated to point to beyond the last character returned
774 in the call.
775 @param LineWidth The maximum width of the line in units of narrow glyphs.
776 @param LanguageString Pointer to a NULL-terminated string containing a
777 single ISO 639-2 language identifier, indicating the language to print.
778 @param BufferLength Pointer to the length of the StringBuffer.
779 @param StringBuffer The buffer designed to receive the characters in the string.
780
781 @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.
782 @retval EFI_NOT_FOUND The font glyph for at least one of the characters in
783 the string is not in the font database.
784 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
785 to allow the entire string to be stored.
786
787 **/
788 typedef
789 EFI_STATUS
790 (EFIAPI *EFI_HII_GET_LINE)(
791 IN EFI_HII_PROTOCOL *This,
792 IN FRAMEWORK_EFI_HII_HANDLE Handle,
793 IN STRING_REF Token,
794 IN OUT UINT16 *Index,
795 IN UINT16 LineWidth,
796 IN CHAR16 *LanguageString,
797 IN OUT UINT16 *BufferLength,
798 OUT EFI_STRING StringBuffer
799 );
800
801 /**
802 Allows a program to extract a form or form package that has previously
803 been registered with the HII database.
804
805 @param This A pointer to the EFI_HII_PROTOCOL instance.
806 @param Handle Handle on which the form resides.
807 @param FormId The ID of the form to return. If the ID is zero,
808 the entire form package is returned.
809 @param BufferLength On input, the length of the Buffer. On output,
810 the length of the returned buffer,
811 @param Buffer The buffer designed to receive the form(s).
812
813 @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength
814 was updated.
815 @retval EFI_INVALID_PARAMETER The handle is unknown.
816 @retval EFI_NOT_FOUND A form on the requested handle cannot be found with
817 the requested FormId.
818 @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
819 to allow the form to be stored.
820
821 **/
822 typedef
823 EFI_STATUS
824 (EFIAPI *EFI_HII_GET_FORMS)(
825 IN EFI_HII_PROTOCOL *This,
826 IN FRAMEWORK_EFI_HII_HANDLE Handle,
827 IN EFI_FORM_ID FormId,
828 IN OUT UINTN *BufferLength,
829 OUT UINT8 *Buffer
830 );
831
832 /**
833 Extracts the defaults that are associated with a given handle in the HII database.
834
835 @param This A pointer to the EFI_HII_PROTOCOL instance.
836 @param Handle The HII handle from which will have default data retrieved.
837 @param DefaultMask The mask used to specify some type of default override when extracting
838 the default image data.
839 @param VariablePackList An indirect pointer to the first entry of a link list with
840 type EFI_HII_VARIABLE_PACK_LIST.
841
842 @retval EFI_SUCCESS The VariablePackList was populated with the appropriate
843 default setting data.
844 @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).
845 @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle
846 contain invalid data.
847
848 **/
849 typedef
850 EFI_STATUS
851 (EFIAPI *EFI_HII_GET_DEFAULT_IMAGE)(
852 IN EFI_HII_PROTOCOL *This,
853 IN FRAMEWORK_EFI_HII_HANDLE Handle,
854 IN UINTN DefaultMask,
855 OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
856 );
857
858 /**
859 Allows the caller to update a form or form package that has previously been
860 registered with the EFI HII database.
861
862 @param This A pointer to the EFI_HII_PROTOCOL instance.
863 @param Handle Handle of the package where the form to be updated resides.
864 @param Label The label inside the form package where the update is to take place.
865 @param AddData If TRUE, adding data at a given Label; otherwise,
866 if FALSE, removing data at a given Label.
867 @param Data The buffer containing the new tags to insert after the Label
868
869 @retval EFI_SUCCESS The form was updated with the new tags.
870 @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not
871 contain an integral number of tags.
872 @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.
873
874 **/
875 typedef
876 EFI_STATUS
877 (EFIAPI *EFI_HII_UPDATE_FORM)(
878 IN EFI_HII_PROTOCOL *This,
879 IN FRAMEWORK_EFI_HII_HANDLE Handle,
880 IN EFI_FORM_LABEL Label,
881 IN BOOLEAN AddData,
882 IN EFI_HII_UPDATE_DATA *Data
883 );
884
885 /**
886 Retrieves the current keyboard layout.
887
888 Note that this function prototype name is different from that in the Framework HII 0.92 spec
889 to avoid name confict with EFI_HII_GET_KEYBOARD_LAYOUT defined in the UEFI 2.1d spec.
890
891 @param This A pointer to the EFI_HII_PROTOCOL instance.
892 @param DescriptorCount A pointer to the number of Descriptor entries being
893 described in the keyboard layout being retrieved.
894 @param Descriptor A pointer to a buffer containing an array of FRAMEWORK_EFI_KEY_DESCRIPTOR
895 entries. Each entry will reflect the definition of a specific physical key.
896
897 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
898
899 **/
900 typedef
901 EFI_STATUS
902 (EFIAPI *FRAMEWORK_EFI_HII_GET_KEYBOARD_LAYOUT)(
903 IN EFI_HII_PROTOCOL *This,
904 OUT UINT16 *DescriptorCount,
905 OUT FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor
906 );
907
908 ///
909 /// The HII Protocol manages the HII database, which is a repository for data
910 /// having to do with fonts, strings, forms, keyboards, and other future human
911 /// interface items.
912 ///
913 struct _EFI_HII_PROTOCOL {
914 ///
915 /// Extracts the various packs from a package list.
916 ///
917 EFI_HII_NEW_PACK NewPack;
918
919 ///
920 /// Removes a package from the HII database.
921 ///
922 EFI_HII_REMOVE_PACK RemovePack;
923
924 ///
925 /// Determines the handles that are currently active in the database.
926 ///
927 EFI_HII_FIND_HANDLES FindHandles;
928
929 ///
930 /// Export the entire contents of the database to a buffer.
931 ///
932 EFI_HII_EXPORT ExportDatabase;
933
934 ///
935 /// Tests if all of the characters in a string have corresponding font characters.
936 ///
937 EFI_HII_TEST_STRING TestString;
938
939 ///
940 /// Translates a Unicode character into the corresponding font glyph.
941 ///
942 FRAMEWORK_EFI_HII_GET_GLYPH GetGlyph;
943
944 ///
945 /// Converts a glyph value into a format that is ready for a UGA BLT command.
946 ///
947 EFI_HII_GLYPH_TO_BLT GlyphToBlt;
948
949 ///
950 /// Allows a new string to be added to an already existing string package.
951 ///
952 FRAMEWORK_EFI_HII_NEW_STRING NewString;
953
954 ///
955 /// Allows a program to determine the primary languages that are supported
956 /// on a given handle.
957 ///
958 EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
959
960 ///
961 /// Allows a program to determine which secondary languages are supported
962 /// on a given handle for a given primary language.
963 ///
964 EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;
965
966 ///
967 /// Extracts a string from a package that is already registered with the
968 /// EFI HII database.
969 ///
970 FRAMEWORK_EFI_HII_GET_STRING GetString;
971
972 ///
973 /// Remove any new strings that were added after the initial string export
974 /// for this handle.
975 ///
976 /// Note this function is not defined in the Framework HII 0.92 spec.
977 ///
978 EFI_HII_RESET_STRINGS ResetStrings;
979
980 ///
981 /// Allows a program to extract a part of a string of not more than a given width.
982 ///
983 EFI_HII_GET_LINE GetLine;
984
985 ///
986 /// Allows a program to extract a form or form package that has been previously registered.
987 ///
988 EFI_HII_GET_FORMS GetForms;
989
990 ///
991 /// Allows a program to extract the nonvolatile image that represents the default storage image.
992 ///
993 EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;
994
995 ///
996 /// Allows a program to update a previously registered form.
997 ///
998 EFI_HII_UPDATE_FORM UpdateForm;
999
1000 ///
1001 /// Allows a program to extract the current keyboard layout.
1002 ///
1003 FRAMEWORK_EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
1004 };
1005
1006 extern EFI_GUID gEfiHiiProtocolGuid;
1007 extern EFI_GUID gEfiHiiCompatibilityProtocolGuid;
1008
1009 #endif
1010