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