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