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