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