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