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