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