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