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