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