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