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