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