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