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