]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
Merged in the following trackers from EDK:
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabase.h
1 /** @file
2
3 Copyright (c) 2007 - 2008, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 HiiDatabase.h
15
16 Abstract:
17
18 Private structures definitions in HiiDatabase.
19
20 Revision History
21
22
23 **/
24
25 #ifndef __HII_DATABASE_PRIVATE_H__
26 #define __HII_DATABASE_PRIVATE_H__
27
28 #include <PiDxe.h>
29
30 #include <Protocol/ConsoleControl.h>
31 #include <Protocol/DevicePath.h>
32 #include <Protocol/HiiFont.h>
33 #include <Protocol/HiiImage.h>
34 #include <Protocol/HiiString.h>
35 #include <Protocol/HiiDatabase.h>
36 #include <Protocol/HiiConfigRouting.h>
37 #include <Protocol/HiiConfigAccess.h>
38 #include <Protocol/SimpleTextOut.h>
39
40 #include <Guid/HiiKeyBoardLayout.h>
41
42
43 #include <Library/DebugLib.h>
44 #include <Library/BaseMemoryLib.h>
45 #include <Library/UefiDriverEntryPoint.h>
46 #include <Library/UefiBootServicesTableLib.h>
47 #include <Library/BaseLib.h>
48 #include <Library/DevicePathLib.h>
49 #include <Library/MemoryAllocationLib.h>
50 #include <Library/IfrSupportLib.h>
51 #include <Library/HiiLib.h>
52
53 #define HII_DATABASE_NOTIFY_GUID \
54 { \
55 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \
56 }
57
58 #define MAX_STRING_LENGTH 1024
59 #define MAX_FONT_NAME_LEN 256
60 #define NARROW_BASELINE 15
61 #define WIDE_BASELINE 14
62 #define SYS_FONT_INFO_MASK 0x37
63 #define REPLACE_UNKNOWN_GLYPH 0xFFFD
64 #define PROPORTIONAL_GLYPH 0x80
65 #define NARROW_GLYPH 0x40
66
67 #define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))
68 #define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))
69 #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))
70 #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)
71
72 //
73 // Storage types
74 //
75 #define EFI_HII_VARSTORE_BUFFER 0
76 #define EFI_HII_VARSTORE_NAME_VALUE 1
77 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
78
79 #define HII_FORMSET_STORAGE_SIGNATURE EFI_SIGNATURE_32 ('H', 'S', 'T', 'G')
80 typedef struct {
81 UINTN Signature;
82 LIST_ENTRY Entry;
83
84 EFI_HII_HANDLE HiiHandle;
85 EFI_HANDLE DriverHandle;
86
87 UINT8 Type; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE
88 EFI_GUID Guid;
89 CHAR16 *Name;
90 UINT16 Size;
91 } HII_FORMSET_STORAGE;
92
93 #define HII_FORMSET_STORAGE_FROM_LINK(a) CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE)
94
95
96 //
97 // String Package definitions
98 //
99 #define HII_STRING_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','s','p')
100 typedef struct _HII_STRING_PACKAGE_INSTANCE {
101 UINTN Signature;
102 EFI_HII_STRING_PACKAGE_HDR *StringPkgHdr;
103 UINT8 *StringBlock;
104 LIST_ENTRY StringEntry;
105 LIST_ENTRY FontInfoList; // local font info list
106 UINT8 FontId;
107 } HII_STRING_PACKAGE_INSTANCE;
108
109 //
110 // Form Package definitions
111 //
112 #define HII_IFR_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','f','r','p')
113 typedef struct _HII_IFR_PACKAGE_INSTANCE {
114 UINTN Signature;
115 EFI_HII_PACKAGE_HEADER FormPkgHdr;
116 UINT8 *IfrData;
117 LIST_ENTRY IfrEntry;
118 } HII_IFR_PACKAGE_INSTANCE;
119
120 //
121 // Simple Font Package definitions
122 //
123 #define HII_S_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','s','f','p')
124 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {
125 UINTN Signature;
126 EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimpleFontPkgHdr;
127 LIST_ENTRY SimpleFontEntry;
128 } HII_SIMPLE_FONT_PACKAGE_INSTANCE;
129
130 //
131 // Font Package definitions
132 //
133 #define HII_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','f','p')
134 typedef struct _HII_FONT_PACKAGE_INSTANCE {
135 UINTN Signature;
136 EFI_HII_FONT_PACKAGE_HDR *FontPkgHdr;
137 UINT8 *GlyphBlock;
138 LIST_ENTRY FontEntry;
139 LIST_ENTRY GlyphInfoList;
140 } HII_FONT_PACKAGE_INSTANCE;
141
142 #define HII_GLYPH_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','i','s')
143 typedef struct _HII_GLYPH_INFO {
144 UINTN Signature;
145 LIST_ENTRY Entry;
146 CHAR16 CharId;
147 EFI_HII_GLYPH_INFO Cell;
148 } HII_GLYPH_INFO;
149
150 #define HII_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','l','f','i')
151 typedef struct _HII_FONT_INFO {
152 UINTN Signature;
153 LIST_ENTRY Entry;
154 LIST_ENTRY *GlobalEntry;
155 UINT8 FontId;
156 } HII_FONT_INFO;
157
158 #define HII_GLOBAL_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','f','i')
159 typedef struct _HII_GLOBAL_FONT_INFO {
160 UINTN Signature;
161 LIST_ENTRY Entry;
162 HII_FONT_PACKAGE_INSTANCE *FontPackage;
163 UINTN FontInfoSize;
164 EFI_FONT_INFO *FontInfo;
165 } HII_GLOBAL_FONT_INFO;
166
167 //
168 // Image Package definitions
169 //
170
171 #define HII_PIXEL_MASK 0x80
172
173 typedef struct _HII_IMAGE_PACKAGE_INSTANCE {
174 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr;
175 UINT32 ImageBlockSize;
176 UINT32 PaletteInfoSize;
177 UINT8 *ImageBlock;
178 UINT8 *PaletteBlock;
179 } HII_IMAGE_PACKAGE_INSTANCE;
180
181 //
182 // Keyboard Layout Pacakge definitions
183 //
184 #define HII_KB_LAYOUT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','k','l','p')
185 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {
186 UINTN Signature;
187 UINT8 *KeyboardPkg;
188 LIST_ENTRY KeyboardEntry;
189 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE;
190
191 //
192 // Guid Package definitions
193 //
194 #define HII_GUID_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','g','p')
195 typedef struct _HII_GUID_PACKAGE_INSTANCE {
196 UINTN Signature;
197 UINT8 *GuidPkg;
198 LIST_ENTRY GuidEntry;
199 } HII_GUID_PACKAGE_INSTANCE;
200
201 //
202 // A package list can contain only one or less than one device path package.
203 // This rule also applies to image package since ImageId can not be duplicate.
204 //
205 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE {
206 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr;
207 LIST_ENTRY GuidPkgHdr;
208 LIST_ENTRY FormPkgHdr;
209 LIST_ENTRY KeyboardLayoutHdr;
210 LIST_ENTRY StringPkgHdr;
211 LIST_ENTRY FontPkgHdr;
212 HII_IMAGE_PACKAGE_INSTANCE *ImagePkg;
213 LIST_ENTRY SimpleFontPkgHdr;
214 UINT8 *DevicePathPkg;
215 } HII_DATABASE_PACKAGE_LIST_INSTANCE;
216
217 #define HII_HANDLE_SIGNATURE EFI_SIGNATURE_32 ('h','i','h','l')
218
219 typedef struct {
220 UINTN Signature;
221 LIST_ENTRY Handle;
222 UINTN Key;
223 } HII_HANDLE;
224
225 #define HII_DATABASE_RECORD_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','r')
226
227 typedef struct _HII_DATABASE_RECORD {
228 UINTN Signature;
229 HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList;
230 EFI_HANDLE DriverHandle;
231 EFI_HII_HANDLE Handle;
232 LIST_ENTRY DatabaseEntry;
233 } HII_DATABASE_RECORD;
234
235 #define HII_DATABASE_NOTIFY_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','n')
236
237 typedef struct _HII_DATABASE_NOTIFY {
238 UINTN Signature;
239 EFI_HANDLE NotifyHandle;
240 UINT8 PackageType;
241 EFI_GUID *PackageGuid;
242 EFI_HII_DATABASE_NOTIFY PackageNotifyFn;
243 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType;
244 LIST_ENTRY DatabaseNotifyEntry;
245 } HII_DATABASE_NOTIFY;
246
247 #define HII_DATABASE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'D', 'p')
248
249 typedef struct _HII_DATABASE_PRIVATE_DATA {
250 UINTN Signature;
251 LIST_ENTRY DatabaseList;
252 LIST_ENTRY DatabaseNotifyList;
253 EFI_HII_FONT_PROTOCOL HiiFont;
254 #ifndef DISABLE_UNUSED_HII_PROTOCOLS
255 EFI_HII_IMAGE_PROTOCOL HiiImage;
256 #endif
257 EFI_HII_STRING_PROTOCOL HiiString;
258 EFI_HII_DATABASE_PROTOCOL HiiDatabase;
259 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting;
260 LIST_ENTRY HiiHandleList;
261 INTN HiiHandleCount;
262 LIST_ENTRY FontInfoList; // global font info list
263 UINTN Attribute; // default system color
264 EFI_GUID CurrentLayoutGuid;
265 EFI_HII_KEYBOARD_LAYOUT *CurrentLayout;
266 } HII_DATABASE_PRIVATE_DATA;
267
268 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
269 CR (a, \
270 HII_DATABASE_PRIVATE_DATA, \
271 HiiFont, \
272 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
273 )
274
275 #define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
276 CR (a, \
277 HII_DATABASE_PRIVATE_DATA, \
278 HiiImage, \
279 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
280 )
281
282 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
283 CR (a, \
284 HII_DATABASE_PRIVATE_DATA, \
285 HiiString, \
286 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
287 )
288
289 #define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
290 CR (a, \
291 HII_DATABASE_PRIVATE_DATA, \
292 HiiDatabase, \
293 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
294 )
295
296 #define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \
297 CR (a, \
298 HII_DATABASE_PRIVATE_DATA, \
299 ConfigRouting, \
300 HII_DATABASE_PRIVATE_DATA_SIGNATURE \
301 )
302
303 //
304 // Internal function prototypes.
305 //
306
307 /**
308 This function checks whether a handle is a valid EFI_HII_HANDLE
309
310 @param Handle Pointer to a EFI_HII_HANDLE
311
312 @retval TRUE Valid
313 @retval FALSE Invalid
314
315 **/
316 BOOLEAN
317 IsHiiHandleValid (
318 EFI_HII_HANDLE Handle
319 )
320 ;
321
322
323 /**
324 This function checks whether EFI_FONT_INFO exists in current database. If
325 FontInfoMask is specified, check what options can be used to make a match.
326 Note that the masks relate to where the system default should be supplied
327 are ignored by this function.
328
329 @param Private Hii database private structure.
330 @param FontInfo Points to EFI_FONT_INFO structure.
331 @param FontInfoMask If not NULL, describes what options can be used
332 to make a match between the font requested and
333 the font available. The caller must guarantee
334 this mask is valid.
335 @param FontHandle On entry, Points to the font handle returned by a
336 previous call to GetFontInfo() or NULL to start
337 with the first font.
338 @param GlobalFontInfo If not NULL, output the corresponding globa font
339 info.
340
341 @retval TRUE Existed
342 @retval FALSE Not existed
343
344 **/
345 BOOLEAN
346 IsFontInfoExisted (
347 IN HII_DATABASE_PRIVATE_DATA *Private,
348 IN EFI_FONT_INFO *FontInfo,
349 IN EFI_FONT_INFO_MASK *FontInfoMask, OPTIONAL
350 IN EFI_FONT_HANDLE FontHandle, OPTIONAL
351 OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo OPTIONAL
352 )
353 ;
354
355
356 /**
357 Retrieve system default font and color.
358
359 @param Private HII database driver private data.
360 @param FontInfo Points to system default font output-related
361 information. It's caller's responsibility to free
362 this buffer.
363 @param FontInfoSize If not NULL, output the size of buffer FontInfo.
364
365 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.
366 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
367 task.
368 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
369
370 **/
371 EFI_STATUS
372 GetSystemFont (
373 IN HII_DATABASE_PRIVATE_DATA *Private,
374 OUT EFI_FONT_DISPLAY_INFO **FontInfo,
375 OUT UINTN *FontInfoSize OPTIONAL
376 )
377 ;
378
379
380 /**
381 Parse all string blocks to find a String block specified by StringId.
382 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks
383 within this string package and backup its information.
384 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).
385
386 @param Private Hii database private structure.
387 @param StringPackage Hii string package instance.
388 @param StringId The string's id, which is unique within
389 PackageList.
390 @param BlockType Output the block type of found string block.
391 @param StringBlockAddr Output the block address of found string block.
392 @param StringTextOffset Offset, relative to the found block address, of
393 the string text information.
394 @param LastStringId Output the last string id when StringId = 0.
395
396 @retval EFI_SUCCESS The string text and font is retrieved
397 successfully.
398 @retval EFI_NOT_FOUND The specified text or font info can not be found
399 out.
400 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
401 task.
402
403 **/
404 EFI_STATUS
405 FindStringBlock (
406 IN HII_DATABASE_PRIVATE_DATA *Private,
407 IN HII_STRING_PACKAGE_INSTANCE *StringPackage,
408 IN EFI_STRING_ID StringId,
409 OUT UINT8 *BlockType, OPTIONAL
410 OUT UINT8 **StringBlockAddr, OPTIONAL
411 OUT UINTN *StringTextOffset, OPTIONAL
412 OUT EFI_STRING_ID *LastStringId OPTIONAL
413 )
414 ;
415
416
417 /**
418 Parse all glyph blocks to find a glyph block specified by CharValue.
419 If CharValue = (CHAR16) (-1), collect all default character cell information
420 within this font package and backup its information.
421
422 @param FontPackage Hii string package instance.
423 @param CharValue Unicode character value, which identifies a glyph
424 block.
425 @param GlyphBuffer Output the corresponding bitmap data of the found
426 block. It is the caller's responsiblity to free
427 this buffer.
428 @param Cell Output cell information of the encoded bitmap.
429 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.
430
431 @retval EFI_SUCCESS The bitmap data is retrieved successfully.
432 @retval EFI_NOT_FOUND The specified CharValue does not exist in current
433 database.
434 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
435 task.
436
437 **/
438 EFI_STATUS
439 FindGlyphBlock (
440 IN HII_FONT_PACKAGE_INSTANCE *FontPackage,
441 IN CHAR16 CharValue,
442 OUT UINT8 **GlyphBuffer, OPTIONAL
443 OUT EFI_HII_GLYPH_INFO *Cell, OPTIONAL
444 OUT UINTN *GlyphBufferLen OPTIONAL
445 )
446 ;
447
448 //
449 // EFI_HII_FONT_PROTOCOL protocol interfaces
450 //
451
452
453 /**
454 Renders a string to a bitmap or to the display.
455
456 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
457 @param Flags Describes how the string is to be drawn.
458 @param String Points to the null-terminated string to be
459 displayed.
460 @param StringInfo Points to the string output information,
461 including the color and font. If NULL, then the
462 string will be output in the default system font
463 and color.
464 @param Blt If this points to a non-NULL on entry, this
465 points to the image, which is Width pixels wide
466 and Height pixels high. The string will be drawn
467 onto this image and
468 EFI_HII_OUT_FLAG_CLIP is implied. If this points
469 to a NULL on entry, then a buffer
470 will be allocated to hold the generated image and
471 the pointer updated on exit. It is the caller's
472 responsibility to free this buffer.
473 @param BltX,BLTY Specifies the offset from the left and top edge
474 of the image of the first character cell in the
475 image.
476 @param RowInfoArray If this is non-NULL on entry, then on exit, this
477 will point to an allocated buffer containing
478 row information and RowInfoArraySize will be
479 updated to contain the number of elements.
480 This array describes the characters which were at
481 least partially drawn and the heights of the
482 rows. It is the caller's responsibility to free
483 this buffer.
484 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
485 contains the number of elements in RowInfoArray.
486 @param ColumnInfoArray If this is non-NULL, then on return it will be
487 filled with the horizontal offset for each
488 character in the string on the row where it is
489 displayed. Non-printing characters will have
490 the offset ~0. The caller is responsible to
491 allocate a buffer large enough so that there
492 is one entry for each character in the string,
493 not including the null-terminator. It is possible
494 when character display is normalized that some
495 character cells overlap.
496
497 @retval EFI_SUCCESS The string was successfully rendered.
498 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
499 RowInfoArray or Blt.
500 @retval EFI_INVALID_PARAMETER The String or Blt.
501 @retval EFI_INVALID_PARAMETER Flags were invalid combination..
502
503 **/
504 EFI_STATUS
505 EFIAPI
506 HiiStringToImage (
507 IN CONST EFI_HII_FONT_PROTOCOL *This,
508 IN EFI_HII_OUT_FLAGS Flags,
509 IN CONST EFI_STRING String,
510 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,
511 IN OUT EFI_IMAGE_OUTPUT **Blt,
512 IN UINTN BltX,
513 IN UINTN BltY,
514 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,
515 OUT UINTN *RowInfoArraySize OPTIONAL,
516 OUT UINTN *ColumnInfoArray OPTIONAL
517 )
518 ;
519
520
521 /**
522 Render a string to a bitmap or the screen containing the contents of the specified string.
523
524 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
525 @param Flags Describes how the string is to be drawn.
526 @param PackageList The package list in the HII database to search
527 for the specified string.
528 @param StringId The string's id, which is unique within
529 PackageList.
530 @param Language Points to the language for the retrieved string.
531 If NULL, then the current system language is
532 used.
533 @param StringInfo Points to the string output information,
534 including the color and font. If NULL, then the
535 string will be output in the default system font
536 and color.
537 @param Blt If this points to a non-NULL on entry, this
538 points to the image, which is Width pixels wide
539 and Height pixels high. The string will be drawn
540 onto this image and
541 EFI_HII_OUT_FLAG_CLIP is implied. If this points
542 to a NULL on entry, then a buffer
543 will be allocated to hold the generated image and
544 the pointer updated on exit. It is the caller's
545 responsibility to free this buffer.
546 @param BltX,BLTY Specifies the offset from the left and top edge
547 of the image of the first character cell in the
548 image.
549 @param RowInfoArray If this is non-NULL on entry, then on exit, this
550 will point to an allocated buffer containing
551 row information and RowInfoArraySize will be
552 updated to contain the number of elements.
553 This array describes the characters which were at
554 least partially drawn and the heights of the
555 rows. It is the caller's responsibility to free
556 this buffer.
557 @param RowInfoArraySize If this is non-NULL on entry, then on exit it
558 contains the number of elements in RowInfoArray.
559 @param ColumnInfoArray If this is non-NULL, then on return it will be
560 filled with the horizontal offset for each
561 character in the string on the row where it is
562 displayed. Non-printing characters will have
563 the offset ~0. The caller is responsible to
564 allocate a buffer large enough so that there
565 is one entry for each character in the string,
566 not including the null-terminator. It is possible
567 when character display is normalized that some
568 character cells overlap.
569
570 @retval EFI_SUCCESS The string was successfully rendered.
571 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for
572 RowInfoArray or Blt.
573 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.
574 @retval EFI_INVALID_PARAMETER Flags were invalid combination.
575 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not
576 in the specified PackageList.
577
578 **/
579 EFI_STATUS
580 EFIAPI
581 HiiStringIdToImage (
582 IN CONST EFI_HII_FONT_PROTOCOL *This,
583 IN EFI_HII_OUT_FLAGS Flags,
584 IN EFI_HII_HANDLE PackageList,
585 IN EFI_STRING_ID StringId,
586 IN CONST CHAR8* Language,
587 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,
588 IN OUT EFI_IMAGE_OUTPUT **Blt,
589 IN UINTN BltX,
590 IN UINTN BltY,
591 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,
592 OUT UINTN *RowInfoArraySize OPTIONAL,
593 OUT UINTN *ColumnInfoArray OPTIONAL
594 )
595 ;
596
597
598 /**
599 Convert the glyph for a single character into a bitmap.
600
601 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
602 @param Char Character to retrieve.
603 @param StringInfo Points to the string font and color information
604 or NULL if the string should use the default
605 system font and color.
606 @param Blt Thus must point to a NULL on entry. A buffer will
607 be allocated to hold the output and the pointer
608 updated on exit. It is the caller's
609 responsibility to free this buffer.
610 @param Baseline Number of pixels from the bottom of the bitmap to
611 the baseline.
612
613 @retval EFI_SUCCESS Glyph bitmap created.
614 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.
615 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the
616 glyph for Unicode character 0xFFFD.
617 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.
618
619 **/
620 EFI_STATUS
621 EFIAPI
622 HiiGetGlyph (
623 IN CONST EFI_HII_FONT_PROTOCOL *This,
624 IN CHAR16 Char,
625 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, OPTIONAL
626 OUT EFI_IMAGE_OUTPUT **Blt,
627 OUT UINTN *Baseline OPTIONAL
628 )
629 ;
630
631
632 /**
633 This function iterates through fonts which match the specified font, using
634 the specified criteria. If String is non-NULL, then all of the characters in
635 the string must exist in order for a candidate font to be returned.
636
637 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.
638 @param FontHandle On entry, points to the font handle returned by a
639 previous call to GetFontInfo() or NULL to start
640 with the first font. On return, points to the
641 returned font handle or points to NULL if there
642 are no more matching fonts.
643 @param StringInfoIn Upon entry, points to the font to return
644 information about. If NULL, then the information about the system default
645 font will be returned.
646 @param StringInfoOut Upon return, contains the matching font's
647 information. If NULL, then no information is
648 returned. It's caller's responsibility to free
649 this buffer.
650 @param String Points to the string which will be tested to
651 determine if all characters are available. If
652 NULL, then any font is acceptable.
653
654 @retval EFI_SUCCESS Matching font returned successfully.
655 @retval EFI_NOT_FOUND No matching font was found.
656 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.
657 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.
658 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
659 request.
660 **/
661 EFI_STATUS
662 EFIAPI
663 HiiGetFontInfo (
664 IN CONST EFI_HII_FONT_PROTOCOL *This,
665 IN OUT EFI_FONT_HANDLE *FontHandle,
666 IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn,
667 OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,
668 IN CONST EFI_STRING String OPTIONAL
669 )
670 ;
671
672 //
673 // EFI_HII_IMAGE_PROTOCOL interfaces
674 //
675
676
677 /**
678 This function adds the image Image to the group of images owned by PackageList, and returns
679 a new image identifier (ImageId).
680
681 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
682 @param PackageList Handle of the package list where this image will
683 be added.
684 @param ImageId On return, contains the new image id, which is
685 unique within PackageList.
686 @param Image Points to the image.
687
688 @retval EFI_SUCCESS The new image was added successfully.
689 @retval EFI_NOT_FOUND The specified PackageList could not be found in
690 database.
691 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.
692 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.
693
694 **/
695 EFI_STATUS
696 EFIAPI
697 HiiNewImage (
698 IN CONST EFI_HII_IMAGE_PROTOCOL *This,
699 IN EFI_HII_HANDLE PackageList,
700 OUT EFI_IMAGE_ID *ImageId,
701 IN CONST EFI_IMAGE_INPUT *Image
702 )
703 ;
704
705
706 /**
707 This function retrieves the image specified by ImageId which is associated with
708 the specified PackageList and copies it into the buffer specified by Image.
709
710 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
711 @param PackageList Handle of the package list where this image will
712 be searched.
713 @param ImageId The image's id,, which is unique within
714 PackageList.
715 @param Image Points to the image.
716
717 @retval EFI_SUCCESS The new image was returned successfully.
718 @retval EFI_NOT_FOUND The image specified by ImageId is not available.
719 The specified PackageList is not in the database.
720 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to
721 hold the image.
722 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.
723 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
724 enough memory.
725
726 **/
727 EFI_STATUS
728 EFIAPI
729 HiiGetImage (
730 IN CONST EFI_HII_IMAGE_PROTOCOL *This,
731 IN EFI_HII_HANDLE PackageList,
732 IN EFI_IMAGE_ID ImageId,
733 OUT EFI_IMAGE_INPUT *Image
734 )
735 ;
736
737
738 /**
739 This function updates the image specified by ImageId in the specified PackageListHandle to
740 the image specified by Image.
741
742 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
743 @param PackageList The package list containing the images.
744 @param ImageId The image's id,, which is unique within
745 PackageList.
746 @param Image Points to the image.
747
748 @retval EFI_SUCCESS The new image was updated successfully.
749 @retval EFI_NOT_FOUND The image specified by ImageId is not in the
750 database. The specified PackageList is not in the database.
751 @retval EFI_INVALID_PARAMETER The Image was NULL.
752
753 **/
754 EFI_STATUS
755 EFIAPI
756 HiiSetImage (
757 IN CONST EFI_HII_IMAGE_PROTOCOL *This,
758 IN EFI_HII_HANDLE PackageList,
759 IN EFI_IMAGE_ID ImageId,
760 IN CONST EFI_IMAGE_INPUT *Image
761 )
762 ;
763
764
765 /**
766 This function renders an image to a bitmap or the screen using the specified
767 color and options. It draws the image on an existing bitmap, allocates a new
768 bitmap or uses the screen. The images can be clipped.
769
770 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
771 @param Flags Describes how the image is to be drawn.
772 @param Image Points to the image to be displayed.
773 @param Blt If this points to a non-NULL on entry, this
774 points to the image, which is Width pixels wide
775 and Height pixels high. The image will be drawn
776 onto this image and EFI_HII_DRAW_FLAG_CLIP is
777 implied. If this points to a NULL on entry, then
778 a buffer will be allocated to hold the generated
779 image and the pointer updated on exit. It is the
780 caller's responsibility to free this buffer.
781 @param BltY Specifies the offset from the left and top edge
782 of the output image of the first pixel in the
783 image.
784
785 @retval EFI_SUCCESS The image was successfully drawn.
786 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
787 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.
788 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.
789
790 **/
791 EFI_STATUS
792 EFIAPI
793 HiiDrawImage (
794 IN CONST EFI_HII_IMAGE_PROTOCOL *This,
795 IN EFI_HII_DRAW_FLAGS Flags,
796 IN CONST EFI_IMAGE_INPUT *Image,
797 IN OUT EFI_IMAGE_OUTPUT **Blt,
798 IN UINTN BltX,
799 IN UINTN BltY
800 )
801 ;
802
803
804 /**
805 This function renders an image to a bitmap or the screen using the specified
806 color and options. It draws the image on an existing bitmap, allocates a new
807 bitmap or uses the screen. The images can be clipped.
808
809 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
810 @param Flags Describes how the image is to be drawn.
811 @param PackageList The package list in the HII database to search
812 for the specified image.
813 @param ImageId The image's id, which is unique within
814 PackageList.
815 @param Blt If this points to a non-NULL on entry, this
816 points to the image, which is Width pixels wide
817 and Height pixels high. The image will be drawn
818 onto this image and
819 EFI_HII_DRAW_FLAG_CLIP is implied. If this points
820 to a NULL on entry, then a buffer will be
821 allocated to hold the generated image and the
822 pointer updated on exit. It is the caller's
823 responsibility to free this buffer.
824 @param BltY Specifies the offset from the left and top edge
825 of the output image of the first pixel in the
826 image.
827
828 @retval EFI_SUCCESS The image was successfully drawn.
829 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.
830 @retval EFI_INVALID_PARAMETER The Blt was NULL.
831 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
832 The specified PackageList is not in the database.
833
834 **/
835 EFI_STATUS
836 EFIAPI
837 HiiDrawImageId (
838 IN CONST EFI_HII_IMAGE_PROTOCOL *This,
839 IN EFI_HII_DRAW_FLAGS Flags,
840 IN EFI_HII_HANDLE PackageList,
841 IN EFI_IMAGE_ID ImageId,
842 IN OUT EFI_IMAGE_OUTPUT **Blt,
843 IN UINTN BltX,
844 IN UINTN BltY
845 )
846
847 ;
848
849 //
850 // EFI_HII_STRING_PROTOCOL
851 //
852
853
854 /**
855 This function adds the string String to the group of strings owned by PackageList, with the
856 specified font information StringFontInfo and returns a new string id.
857
858 @param This A pointer to the EFI_HII_STRING_PROTOCOL
859 instance.
860 @param PackageList Handle of the package list where this string will
861 be added.
862 @param StringId On return, contains the new strings id, which is
863 unique within PackageList.
864 @param Language Points to the language for the new string.
865 @param LanguageName Points to the printable language name to
866 associate with the passed in Language field.If
867 LanguageName is not NULL and the string package
868 header's LanguageName associated with a given
869 Language is not zero, the LanguageName being
870 passed in will be ignored.
871 @param String Points to the new null-terminated string.
872 @param StringFontInfo Points to the new string's font information or
873 NULL if the string should have the default system
874 font, size and style.
875
876 @retval EFI_SUCCESS The new string was added successfully.
877 @retval EFI_NOT_FOUND The specified PackageList could not be found in
878 database.
879 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of
880 resources.
881 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is
882 NULL.
883
884 **/
885 EFI_STATUS
886 EFIAPI
887 HiiNewString (
888 IN CONST EFI_HII_STRING_PROTOCOL *This,
889 IN EFI_HII_HANDLE PackageList,
890 OUT EFI_STRING_ID *StringId,
891 IN CONST CHAR8 *Language,
892 IN CONST CHAR16 *LanguageName, OPTIONAL
893 IN CONST EFI_STRING String,
894 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL
895 )
896 ;
897
898
899 /**
900 This function retrieves the string specified by StringId which is associated
901 with the specified PackageList in the language Language and copies it into
902 the buffer specified by String.
903
904 @param This A pointer to the EFI_HII_STRING_PROTOCOL
905 instance.
906 @param Language Points to the language for the retrieved string.
907 @param PackageList The package list in the HII database to search
908 for the specified string.
909 @param StringId The string's id, which is unique within
910 PackageList.
911 @param String Points to the new null-terminated string.
912 @param StringSize On entry, points to the size of the buffer
913 pointed to by String, in bytes. On return,
914 points to the length of the string, in bytes.
915 @param StringFontInfo If not NULL, points to the string's font
916 information. It's caller's responsibility to
917 free this buffer.
918
919 @retval EFI_SUCCESS The string was returned successfully.
920 @retval EFI_NOT_FOUND The string specified by StringId is not
921 available.
922 @retval EFI_NOT_FOUND The string specified by StringId is available but
923 not in the specified language.
924 The specified PackageList is not in the database.
925 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but
926 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small
927 to hold the string.
928 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.
929 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
930 request.
931
932 **/
933 EFI_STATUS
934 EFIAPI
935 HiiGetString (
936 IN CONST EFI_HII_STRING_PROTOCOL *This,
937 IN CONST CHAR8 *Language,
938 IN EFI_HII_HANDLE PackageList,
939 IN EFI_STRING_ID StringId,
940 OUT EFI_STRING String,
941 IN OUT UINTN *StringSize,
942 OUT EFI_FONT_INFO **StringFontInfo OPTIONAL
943 )
944 ;
945
946
947 /**
948 This function updates the string specified by StringId in the specified PackageList to the text
949 specified by String and, optionally, the font information specified by StringFontInfo.
950
951 @param This A pointer to the EFI_HII_STRING_PROTOCOL
952 instance.
953 @param PackageList The package list containing the strings.
954 @param StringId The string's id, which is unique within
955 PackageList.
956 @param Language Points to the language for the updated string.
957 @param String Points to the new null-terminated string.
958 @param StringFontInfo Points to the string's font information or NULL
959 if the string font information is not changed.
960
961 @retval EFI_SUCCESS The string was updated successfully.
962 @retval EFI_NOT_FOUND The string specified by StringId is not in the
963 database.
964 @retval EFI_INVALID_PARAMETER The String or Language was NULL.
965 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the
966 task.
967
968 **/
969 EFI_STATUS
970 EFIAPI
971 HiiSetString (
972 IN CONST EFI_HII_STRING_PROTOCOL *This,
973 IN EFI_HII_HANDLE PackageList,
974 IN EFI_STRING_ID StringId,
975 IN CONST CHAR8 *Language,
976 IN CONST EFI_STRING String,
977 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL
978 )
979 ;
980
981
982 /**
983 This function returns the list of supported languages, in the format specified
984 in Appendix M of UEFI 2.1 spec.
985
986 @param This A pointer to the EFI_HII_STRING_PROTOCOL
987 instance.
988 @param PackageList The package list to examine.
989 @param Languages Points to the buffer to hold the returned string.
990 @param LanguagesSize On entry, points to the size of the buffer
991 pointed to by Languages, in bytes. On return,
992 points to the length of Languages, in bytes.
993
994 @retval EFI_SUCCESS The languages were returned successfully.
995 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.
996 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list
997 of supported languages. LanguageSize is updated
998 to contain the required size.
999 @retval EFI_NOT_FOUND Could not find string package in specified
1000 packagelist.
1001
1002 **/
1003 EFI_STATUS
1004 EFIAPI
1005 HiiGetLanguages (
1006 IN CONST EFI_HII_STRING_PROTOCOL *This,
1007 IN EFI_HII_HANDLE PackageList,
1008 IN OUT CHAR8 *Languages,
1009 IN OUT UINTN *LanguagesSize
1010 )
1011 ;
1012
1013
1014 /**
1015 Each string package has associated with it a single primary language and zero
1016 or more secondary languages. This routine returns the secondary languages
1017 associated with a package list.
1018
1019 @param This A pointer to the EFI_HII_STRING_PROTOCOL
1020 instance.
1021 @param PackageList The package list to examine.
1022 @param FirstLanguage Points to the primary language.
1023 @param SecondaryLanguages Points to the buffer to hold the returned list of
1024 secondary languages for the specified
1025 FirstLanguage. If there are no secondary
1026 languages, the function returns successfully,
1027 but this is set to NULL.
1028 @param SecondaryLanguageSize On entry, points to the size of the buffer
1029 pointed to by SecondLanguages, in bytes. On
1030 return, points to the length of SecondLanguages
1031 in bytes.
1032
1033 @retval EFI_SUCCESS Secondary languages were correctly returned.
1034 @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or
1035 SecondLanguagesSize was NULL.
1036 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is
1037 too small to hold the returned information.
1038 SecondLanguageSize is updated to hold the size of
1039 the buffer required.
1040 @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not
1041 present in the specified package list.
1042 @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
1043
1044 **/
1045 EFI_STATUS
1046 EFIAPI
1047 HiiGetSecondaryLanguages (
1048 IN CONST EFI_HII_STRING_PROTOCOL *This,
1049 IN EFI_HII_HANDLE PackageList,
1050 IN CONST CHAR8 *FirstLanguage,
1051 IN OUT CHAR8 *SecondLanguages,
1052 IN OUT UINTN *SecondLanguagesSize
1053 )
1054 ;
1055
1056 //
1057 // EFI_HII_DATABASE_PROTOCOL protocol interfaces
1058 //
1059
1060
1061 /**
1062 This function adds the packages in the package list to the database and returns a handle. If there is a
1063 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will
1064 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.
1065
1066 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1067 instance.
1068 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1069 structure.
1070 @param DriverHandle Associate the package list with this EFI handle.
1071 @param Handle A pointer to the EFI_HII_HANDLE instance.
1072
1073 @retval EFI_SUCCESS The package list associated with the Handle was
1074 added to the HII database.
1075 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the
1076 new database contents.
1077 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.
1078
1079 **/
1080 EFI_STATUS
1081 EFIAPI
1082 HiiNewPackageList (
1083 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1084 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,
1085 IN CONST EFI_HANDLE DriverHandle,
1086 OUT EFI_HII_HANDLE *Handle
1087 )
1088 ;
1089
1090
1091 /**
1092 This function removes the package list that is associated with a handle Handle
1093 from the HII database. Before removing the package, any registered functions
1094 with the notification type REMOVE_PACK and the same package type will be called.
1095
1096 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1097 instance.
1098 @param Handle The handle that was registered to the data that
1099 is requested for removal.
1100
1101 @retval EFI_SUCCESS The data associated with the Handle was removed
1102 from the HII database.
1103 @retval EFI_NOT_FOUND The specified Handle is not in database.
1104
1105 **/
1106 EFI_STATUS
1107 EFIAPI
1108 HiiRemovePackageList (
1109 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1110 IN EFI_HII_HANDLE Handle
1111 )
1112 ;
1113
1114
1115 /**
1116 This function updates the existing package list (which has the specified Handle)
1117 in the HII databases, using the new package list specified by PackageList.
1118
1119 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1120 instance.
1121 @param Handle The handle that was registered to the data that
1122 is requested to be updated.
1123 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER
1124 package.
1125
1126 @retval EFI_SUCCESS The HII database was successfully updated.
1127 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated
1128 database.
1129 @retval EFI_INVALID_PARAMETER PackageList was NULL.
1130 @retval EFI_NOT_FOUND The specified Handle is not in database.
1131
1132 **/
1133 EFI_STATUS
1134 EFIAPI
1135 HiiUpdatePackageList (
1136 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1137 IN EFI_HII_HANDLE Handle,
1138 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList
1139 )
1140 ;
1141
1142
1143 /**
1144 This function returns a list of the package handles of the specified type
1145 that are currently active in the database. The pseudo-type
1146 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.
1147
1148 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1149 instance.
1150 @param PackageType Specifies the package type of the packages to
1151 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1152 to be listed.
1153 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1154 this is the pointer to the GUID which must match
1155 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.
1156 Otherwise, it must be NULL.
1157 @param HandleBufferLength On input, a pointer to the length of the handle
1158 buffer. On output, the length of the handle
1159 buffer that is required for the handles found.
1160 @param Handle An array of EFI_HII_HANDLE instances returned.
1161
1162 @retval EFI_SUCCESS The matching handles are outputed successfully.
1163 HandleBufferLength is updated with the actual length.
1164 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1165 Handle is too small to support the number of
1166 handles. HandleBufferLength is updated with a
1167 value that will enable the data to fit.
1168 @retval EFI_NOT_FOUND No matching handle could not be found in
1169 database.
1170 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.
1171 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
1172 PackageGuid is not NULL, PackageType is a EFI_HII_
1173 PACKAGE_TYPE_GUID but PackageGuid is NULL.
1174
1175
1176 **/
1177 EFI_STATUS
1178 EFIAPI
1179 HiiListPackageLists (
1180 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1181 IN UINT8 PackageType,
1182 IN CONST EFI_GUID *PackageGuid,
1183 IN OUT UINTN *HandleBufferLength,
1184 OUT EFI_HII_HANDLE *Handle
1185 )
1186 ;
1187
1188
1189 /**
1190 This function will export one or all package lists in the database to a buffer.
1191 For each package list exported, this function will call functions registered
1192 with EXPORT_PACK and then copy the package list to the buffer.
1193
1194 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1195 instance.
1196 @param Handle An EFI_HII_HANDLE that corresponds to the desired
1197 package list in the HII database to export or
1198 NULL to indicate all package lists should be
1199 exported.
1200 @param BufferSize On input, a pointer to the length of the buffer.
1201 On output, the length of the buffer that is
1202 required for the exported data.
1203 @param Buffer A pointer to a buffer that will contain the
1204 results of the export function.
1205
1206 @retval EFI_SUCCESS Package exported.
1207 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that
1208 Handle is too small to support the number of
1209 handles. HandleBufferLength is updated with
1210 a value that will enable the data to fit.
1211 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the
1212 current database.
1213 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.
1214
1215 **/
1216 EFI_STATUS
1217 EFIAPI
1218 HiiExportPackageLists (
1219 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1220 IN EFI_HII_HANDLE Handle,
1221 IN OUT UINTN *BufferSize,
1222 OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer
1223 )
1224 ;
1225
1226
1227 /**
1228 This function registers a function which will be called when specified actions related to packages of
1229 the specified type occur in the HII database. By registering a function, other HII-related drivers are
1230 notified when specific package types are added, removed or updated in the HII database.
1231 Each driver or application which registers a notification should use
1232 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.
1233
1234 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1235 instance.
1236 @param PackageType Specifies the package type of the packages to
1237 list or EFI_HII_PACKAGE_TYPE_ALL for all packages
1238 to be listed.
1239 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then
1240 this is the pointer to the GUID which must match
1241 the Guid field of
1242 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must
1243 be NULL.
1244 @param PackageNotifyFn Points to the function to be called when the
1245 event specified by
1246 NotificationType occurs.
1247 @param NotifyType Describes the types of notification which this
1248 function will be receiving.
1249 @param NotifyHandle Points to the unique handle assigned to the
1250 registered notification. Can be used in
1251 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()
1252 to stop notifications.
1253
1254 @retval EFI_SUCCESS Notification registered successfully.
1255 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures
1256 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.
1257 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not
1258 EFI_HII_PACKAGE_TYPE_GUID.
1259 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is
1260 EFI_HII_PACKAGE_TYPE_GUID.
1261
1262 **/
1263 EFI_STATUS
1264 EFIAPI
1265 HiiRegisterPackageNotify (
1266 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1267 IN UINT8 PackageType,
1268 IN CONST EFI_GUID *PackageGuid,
1269 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,
1270 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,
1271 OUT EFI_HANDLE *NotifyHandle
1272 )
1273 ;
1274
1275
1276 /**
1277 Removes the specified HII database package-related notification.
1278
1279 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1280 instance.
1281 @param NotifyHandle The handle of the notification function being
1282 unregistered.
1283
1284 @retval EFI_SUCCESS Notification is unregistered successfully.
1285 @retval EFI_NOT_FOUND The incoming notification handle does not exist
1286 in current hii database.
1287
1288 **/
1289 EFI_STATUS
1290 EFIAPI
1291 HiiUnregisterPackageNotify (
1292 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1293 IN EFI_HANDLE NotificationHandle
1294 )
1295 ;
1296
1297
1298 /**
1299 This routine retrieves an array of GUID values for each keyboard layout that
1300 was previously registered in the system.
1301
1302 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1303 instance.
1304 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard
1305 GUID buffer. On output, the length of the handle
1306 buffer that is required for the handles found.
1307 @param KeyGuidBuffer An array of keyboard layout GUID instances
1308 returned.
1309
1310 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.
1311 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates
1312 that KeyGuidBuffer is too small to support the
1313 number of GUIDs. KeyGuidBufferLength is
1314 updated with a value that will enable the data to
1315 fit.
1316 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was
1317 NULL.
1318 @retval EFI_NOT_FOUND There was no keyboard layout.
1319
1320 **/
1321 EFI_STATUS
1322 EFIAPI
1323 HiiFindKeyboardLayouts (
1324 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1325 IN OUT UINT16 *KeyGuidBufferLength,
1326 OUT EFI_GUID *KeyGuidBuffer
1327 )
1328 ;
1329
1330
1331 /**
1332 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys
1333 on a keyboard and the character(s) that are associated with a particular set of key strokes.
1334
1335 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1336 instance.
1337 @param KeyGuid A pointer to the unique ID associated with a
1338 given keyboard layout. If KeyGuid is NULL then
1339 the current layout will be retrieved.
1340 @param KeyboardLayoutLength On input, a pointer to the length of the
1341 KeyboardLayout buffer. On output, the length of
1342 the data placed into KeyboardLayout.
1343 @param KeyboardLayout A pointer to a buffer containing the retrieved
1344 keyboard layout.
1345
1346 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
1347 @retval EFI_NOT_FOUND The requested keyboard layout was not found.
1348 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was
1349 NULL.
1350
1351 **/
1352 EFI_STATUS
1353 EFIAPI
1354 HiiGetKeyboardLayout (
1355 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1356 IN CONST EFI_GUID *KeyGuid,
1357 IN OUT UINT16 *KeyboardLayoutLength,
1358 OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout
1359 )
1360 ;
1361
1362
1363 /**
1364 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine
1365 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
1366 group type. This is so that agents which are sensitive to the current keyboard layout being changed
1367 can be notified of this change.
1368
1369 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1370 instance.
1371 @param KeyGuid A pointer to the unique ID associated with a
1372 given keyboard layout.
1373
1374 @retval EFI_SUCCESS The current keyboard layout was successfully set.
1375 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so
1376 action was taken.
1377 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.
1378
1379 **/
1380 EFI_STATUS
1381 EFIAPI
1382 HiiSetKeyboardLayout (
1383 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1384 IN CONST EFI_GUID *KeyGuid
1385 )
1386 ;
1387
1388
1389 /**
1390 Return the EFI handle associated with a package list.
1391
1392 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL
1393 instance.
1394 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired
1395 package list in the HIIdatabase.
1396 @param DriverHandle On return, contains the EFI_HANDLE which was
1397 registered with the package list in
1398 NewPackageList().
1399
1400 @retval EFI_SUCCESS The DriverHandle was returned successfully.
1401 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or
1402 DriverHandle was NULL.
1403
1404 **/
1405 EFI_STATUS
1406 EFIAPI
1407 HiiGetPackageListHandle (
1408 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
1409 IN EFI_HII_HANDLE PackageListHandle,
1410 OUT EFI_HANDLE *DriverHandle
1411 )
1412 ;
1413
1414 //
1415 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces
1416 //
1417
1418
1419 /**
1420 This function allows a caller to extract the current configuration
1421 for one or more named elements from one or more drivers.
1422
1423 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1424 instance.
1425 @param Request A null-terminated Unicode string in
1426 <MultiConfigRequest> format.
1427 @param Progress On return, points to a character in the Request
1428 string. Points to the string's null terminator if
1429 request was successful. Points to the most recent
1430 & before the first failing name / value pair (or
1431 the beginning of the string if the failure is in
1432 the first name / value pair) if the request was
1433 not successful.
1434 @param Results Null-terminated Unicode string in
1435 <MultiConfigAltResp> format which has all values
1436 filled in for the names in the Request string.
1437 String to be allocated by the called function.
1438
1439 @retval EFI_SUCCESS The Results string is filled with the values
1440 corresponding to all requested names.
1441 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1442 results that must be stored awaiting possible
1443 future protocols.
1444 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.
1445 Progress set to the "G" in "GUID" of the
1446 routing header that doesn't match. Note: There
1447 is no requirement that all routing data
1448 be validated before any configuration extraction.
1449 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request
1450 parameter would result in this type of error. The
1451 Progress parameter is set to NULL.
1452 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &
1453 before the error or the beginning of the string.
1454 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the
1455 name in question.
1456
1457 **/
1458 EFI_STATUS
1459 EFIAPI
1460 HiiConfigRoutingExtractConfig (
1461 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
1462 IN CONST EFI_STRING Request,
1463 OUT EFI_STRING *Progress,
1464 OUT EFI_STRING *Results
1465 )
1466 ;
1467
1468
1469 /**
1470 This function allows the caller to request the current configuration for the
1471 entirety of the current HII database and returns the data in a null-terminated Unicode string.
1472
1473 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1474 instance.
1475 @param Results Null-terminated Unicode string in
1476 <MultiConfigAltResp> format which has all values
1477 filled in for the names in the Request string.
1478 String to be allocated by the called function.
1479 De-allocation is up to the caller.
1480
1481 @retval EFI_SUCCESS The Results string is filled with the values
1482 corresponding to all requested names.
1483 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1484 results that must be stored awaiting possible
1485 future protocols.
1486 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results
1487 parameter would result in this type of error.
1488
1489 **/
1490 EFI_STATUS
1491 EFIAPI
1492 HiiConfigRoutingExportConfig (
1493 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
1494 OUT EFI_STRING *Results
1495 )
1496 ;
1497
1498
1499 /**
1500 This function processes the results of processing forms and routes it to the
1501 appropriate handlers or storage.
1502
1503 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1504 instance.
1505 @param Configuration A null-terminated Unicode string in
1506 <MulltiConfigResp> format.
1507 @param Progress A pointer to a string filled in with the offset
1508 of the most recent & before the first failing
1509 name / value pair (or the beginning of the string
1510 if the failure is in the first name / value pair)
1511 or the terminating NULL if all was successful.
1512
1513 @retval EFI_SUCCESS The results have been distributed or are awaiting
1514 distribution.
1515 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the
1516 results that must be stored awaiting possible
1517 future protocols.
1518 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter
1519 would result in this type of error.
1520 @retval EFI_NOT_FOUND Target for the specified routing data was not
1521 found.
1522
1523 **/
1524 EFI_STATUS
1525 EFIAPI
1526 HiiConfigRoutingRouteConfig (
1527 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
1528 IN CONST EFI_STRING Configuration,
1529 OUT EFI_STRING *Progress
1530 )
1531 ;
1532
1533
1534
1535 /**
1536 This helper function is to be called by drivers to map configuration data stored
1537 in byte array ("block") formats such as UEFI Variables into current configuration strings.
1538
1539 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1540 instance.
1541 @param ConfigRequest A null-terminated Unicode string in
1542 <ConfigRequest> format.
1543 @param Block Array of bytes defining the block's
1544 configuration.
1545 @param BlockSize Length in bytes of Block.
1546 @param Config Filled-in configuration string. String allocated
1547 by the function. Returned only if call is
1548 successful.
1549 @param Progress A pointer to a string filled in with the offset
1550 of the most recent & before the first failing
1551 name/value pair (or the beginning of the string
1552 if the failure is in the first name / value pair)
1553 or the terminating NULL if all was successful.
1554
1555 @retval EFI_SUCCESS The request succeeded. Progress points to the
1556 null terminator at the end of the ConfigRequest
1557 string.
1558 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1559 Progress points to the first character of
1560 ConfigRequest.
1561 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or
1562 Block parameter would result in this type of
1563 error. Progress points to the first character of
1564 ConfigRequest.
1565 @retval EFI_NOT_FOUND Target for the specified routing data was not
1566 found. Progress points to the "G" in "GUID" of
1567 the errant routing data.
1568 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.
1569 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.
1570 Block is left updated and Progress points at
1571 the '&' preceding the first non-<BlockName>.
1572
1573 **/
1574 EFI_STATUS
1575 EFIAPI
1576 HiiBlockToConfig (
1577 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
1578 IN CONST EFI_STRING ConfigRequest,
1579 IN CONST UINT8 *Block,
1580 IN CONST UINTN BlockSize,
1581 OUT EFI_STRING *Config,
1582 OUT EFI_STRING *Progress
1583 )
1584 ;
1585
1586
1587 /**
1588 This helper function is to be called by drivers to map configuration strings
1589 to configurations stored in byte array ("block") formats such as UEFI Variables.
1590
1591 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1592 instance.
1593 @param ConfigResp A null-terminated Unicode string in <ConfigResp>
1594 format.
1595 @param Block A possibly null array of bytes representing the
1596 current block. Only bytes referenced in the
1597 ConfigResp string in the block are modified. If
1598 this parameter is null or if the *BlockSize
1599 parameter is (on input) shorter than required by
1600 the Configuration string, only the BlockSize
1601 parameter is updated and an appropriate status
1602 (see below) is returned.
1603 @param BlockSize The length of the Block in units of UINT8. On
1604 input, this is the size of the Block. On output,
1605 if successful, contains the index of the last
1606 modified byte in the Block.
1607 @param Progress On return, points to an element of the ConfigResp
1608 string filled in with the offset of the most
1609 recent '&' before the first failing name / value
1610 pair (or the beginning of the string if the
1611 failure is in the first name / value pair) or
1612 the terminating NULL if all was successful.
1613
1614 @retval EFI_SUCCESS The request succeeded. Progress points to the
1615 null terminator at the end of the ConfigResp
1616 string.
1617 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.
1618 Progress points to the first character of
1619 ConfigResp.
1620 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or
1621 Block parameter would result in this type of
1622 error. Progress points to the first character of
1623 ConfigResp.
1624 @retval EFI_NOT_FOUND Target for the specified routing data was not
1625 found. Progress points to the "G" in "GUID" of
1626 the errant routing data.
1627 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /
1628 value pair. Block is left updated and
1629 Progress points at the '&' preceding the first
1630 non-<BlockName>.
1631
1632 **/
1633 EFI_STATUS
1634 EFIAPI
1635 HiiConfigToBlock (
1636 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
1637 IN CONST EFI_STRING ConfigResp,
1638 IN OUT UINT8 *Block,
1639 IN OUT UINTN *BlockSize,
1640 OUT EFI_STRING *Progress
1641 )
1642 ;
1643
1644
1645 /**
1646 This helper function is to be called by drivers to extract portions of
1647 a larger configuration string.
1648
1649 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
1650 instance.
1651 @param Configuration A null-terminated Unicode string in
1652 <MultiConfigAltResp> format.
1653 @param Guid A pointer to the GUID value to search for in the
1654 routing portion of the ConfigResp string when
1655 retrieving the requested data. If Guid is NULL,
1656 then all GUID values will be searched for.
1657 @param Name A pointer to the NAME value to search for in the
1658 routing portion of the ConfigResp string when
1659 retrieving the requested data. If Name is NULL,
1660 then all Name values will be searched for.
1661 @param DevicePath A pointer to the PATH value to search for in the
1662 routing portion of the ConfigResp string when
1663 retrieving the requested data. If DevicePath is
1664 NULL, then all DevicePath values will be
1665 searched for.
1666 @param AltCfgId A pointer to the ALTCFG value to search for in
1667 the routing portion of the ConfigResp string
1668 when retrieving the requested data. If this
1669 parameter is NULL, then the current setting will
1670 be retrieved.
1671 @param AltCfgResp A pointer to a buffer which will be allocated by
1672 the function which contains the retrieved string
1673 as requested. This buffer is only allocated if
1674 the call was successful.
1675
1676 @retval EFI_SUCCESS The request succeeded. The requested data was
1677 extracted and placed in the newly allocated
1678 AltCfgResp buffer.
1679 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.
1680 @retval EFI_INVALID_PARAMETER Any parameter is invalid.
1681 @retval EFI_NOT_FOUND Target for the specified routing data was not
1682 found.
1683
1684 **/
1685 EFI_STATUS
1686 EFIAPI
1687 HiiGetAltCfg (
1688 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
1689 IN CONST EFI_STRING Configuration,
1690 IN CONST EFI_GUID *Guid,
1691 IN CONST EFI_STRING Name,
1692 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
1693 IN CONST UINT16 *AltCfgId,
1694 OUT EFI_STRING *AltCfgResp
1695 )
1696 ;
1697
1698
1699 //
1700 // Global variables
1701 //
1702 extern EFI_EVENT gHiiKeyboardLayoutChanged;
1703
1704 #include "R8Lib.h"
1705
1706 #endif