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