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