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