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