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