]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
Clean up the private GUID definition in module Level.
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabase.h
CommitLineData
ac644614 1/** @file\r
e90b081a 2Private structures definitions in HiiDatabase.\r
ac644614 3\r
e5c861ac 4Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
ac644614 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
ac644614 13**/\r
14\r
15#ifndef __HII_DATABASE_PRIVATE_H__\r
16#define __HII_DATABASE_PRIVATE_H__\r
17\r
60c93673 18#include <Uefi.h>\r
ac644614 19\r
ac644614 20#include <Protocol/DevicePath.h>\r
21#include <Protocol/HiiFont.h>\r
22#include <Protocol/HiiImage.h>\r
23#include <Protocol/HiiString.h>\r
24#include <Protocol/HiiDatabase.h>\r
25#include <Protocol/HiiConfigRouting.h>\r
26#include <Protocol/HiiConfigAccess.h>\r
27#include <Protocol/SimpleTextOut.h>\r
28\r
29#include <Guid/HiiKeyBoardLayout.h>\r
b9982883 30#include <Guid/GlobalVariable.h>\r
ac644614 31\r
32\r
33#include <Library/DebugLib.h>\r
34#include <Library/BaseMemoryLib.h>\r
35#include <Library/UefiDriverEntryPoint.h>\r
36#include <Library/UefiBootServicesTableLib.h>\r
37#include <Library/BaseLib.h>\r
38#include <Library/DevicePathLib.h>\r
39#include <Library/MemoryAllocationLib.h>\r
c27eb358 40#include <Library/UefiLib.h>\r
e94358a3 41#include <Library/PcdLib.h>\r
8db9d51d 42#include <Library/UefiRuntimeServicesTableLib.h>\r
63d55bb9 43#include <Library/PrintLib.h>\r
8db9d51d 44\r
ac644614 45#define MAX_STRING_LENGTH 1024\r
46#define MAX_FONT_NAME_LEN 256\r
47#define NARROW_BASELINE 15\r
48#define WIDE_BASELINE 14\r
49#define SYS_FONT_INFO_MASK 0x37\r
50#define REPLACE_UNKNOWN_GLYPH 0xFFFD\r
51#define PROPORTIONAL_GLYPH 0x80\r
52#define NARROW_GLYPH 0x40\r
53\r
54#define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))\r
55#define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))\r
56#define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))\r
57#define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)\r
58\r
84f9a9ec
LG
59//\r
60// IFR data structure\r
61//\r
62// BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.\r
63\r
64typedef struct {\r
65 LIST_ENTRY Entry; // Link to VarStorage\r
66 EFI_GUID Guid;\r
67 CHAR16 *Name;\r
68 EFI_VARSTORE_ID VarStoreId;\r
69 UINT16 Size;\r
70 LIST_ENTRY BlockEntry; // Link to its Block array\r
71} IFR_VARSTORAGE_DATA;\r
72\r
73typedef struct {\r
74 LIST_ENTRY Entry; // Link to Block array\r
75 UINT16 Offset;\r
76 UINT16 Width;\r
77 EFI_QUESTION_ID QuestionId;\r
78 UINT8 OpCode;\r
79 UINT8 Scope;\r
80 LIST_ENTRY DefaultValueEntry; // Link to its default value array\r
81} IFR_BLOCK_DATA;\r
82\r
83typedef struct {\r
84 LIST_ENTRY Entry;\r
6e3f5b2a 85 UINT8 OpCode;\r
84f9a9ec
LG
86 UINT16 DefaultId;\r
87 UINT64 Value;\r
88} IFR_DEFAULT_DATA;\r
89\r
ac644614 90//\r
91// Storage types\r
92//\r
93#define EFI_HII_VARSTORE_BUFFER 0\r
94#define EFI_HII_VARSTORE_NAME_VALUE 1\r
95#define EFI_HII_VARSTORE_EFI_VARIABLE 2\r
96\r
f3f2e05d 97#define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')\r
ac644614 98typedef struct {\r
99 UINTN Signature;\r
100 LIST_ENTRY Entry;\r
101\r
102 EFI_HII_HANDLE HiiHandle;\r
103 EFI_HANDLE DriverHandle;\r
104\r
105 UINT8 Type; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE\r
106 EFI_GUID Guid;\r
107 CHAR16 *Name;\r
108 UINT16 Size;\r
109} HII_FORMSET_STORAGE;\r
110\r
ac644614 111\r
112//\r
113// String Package definitions\r
114//\r
f3f2e05d 115#define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')\r
ac644614 116typedef struct _HII_STRING_PACKAGE_INSTANCE {\r
117 UINTN Signature;\r
118 EFI_HII_STRING_PACKAGE_HDR *StringPkgHdr;\r
119 UINT8 *StringBlock;\r
120 LIST_ENTRY StringEntry;\r
121 LIST_ENTRY FontInfoList; // local font info list\r
122 UINT8 FontId;\r
d6a82eaf 123 EFI_STRING_ID MaxStringId; // record StringId\r
ac644614 124} HII_STRING_PACKAGE_INSTANCE;\r
125\r
126//\r
127// Form Package definitions\r
128//\r
f3f2e05d 129#define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')\r
ac644614 130typedef struct _HII_IFR_PACKAGE_INSTANCE {\r
131 UINTN Signature;\r
132 EFI_HII_PACKAGE_HEADER FormPkgHdr;\r
133 UINT8 *IfrData;\r
134 LIST_ENTRY IfrEntry;\r
135} HII_IFR_PACKAGE_INSTANCE;\r
136\r
137//\r
138// Simple Font Package definitions\r
139//\r
f3f2e05d 140#define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')\r
ac644614 141typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {\r
142 UINTN Signature;\r
143 EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimpleFontPkgHdr;\r
144 LIST_ENTRY SimpleFontEntry;\r
145} HII_SIMPLE_FONT_PACKAGE_INSTANCE;\r
146\r
147//\r
148// Font Package definitions\r
149//\r
f3f2e05d 150#define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')\r
ac644614 151typedef struct _HII_FONT_PACKAGE_INSTANCE {\r
152 UINTN Signature;\r
153 EFI_HII_FONT_PACKAGE_HDR *FontPkgHdr;\r
f6cf5cf8
LG
154 UINT16 Height;\r
155 UINT16 BaseLine;\r
ac644614 156 UINT8 *GlyphBlock;\r
157 LIST_ENTRY FontEntry;\r
158 LIST_ENTRY GlyphInfoList;\r
159} HII_FONT_PACKAGE_INSTANCE;\r
160\r
f3f2e05d 161#define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')\r
ac644614 162typedef struct _HII_GLYPH_INFO {\r
163 UINTN Signature;\r
164 LIST_ENTRY Entry;\r
165 CHAR16 CharId;\r
166 EFI_HII_GLYPH_INFO Cell;\r
167} HII_GLYPH_INFO;\r
168\r
f3f2e05d 169#define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')\r
ac644614 170typedef struct _HII_FONT_INFO {\r
171 UINTN Signature;\r
172 LIST_ENTRY Entry;\r
173 LIST_ENTRY *GlobalEntry;\r
174 UINT8 FontId;\r
175} HII_FONT_INFO;\r
176\r
f3f2e05d 177#define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')\r
ac644614 178typedef struct _HII_GLOBAL_FONT_INFO {\r
179 UINTN Signature;\r
180 LIST_ENTRY Entry;\r
181 HII_FONT_PACKAGE_INSTANCE *FontPackage;\r
182 UINTN FontInfoSize;\r
183 EFI_FONT_INFO *FontInfo;\r
184} HII_GLOBAL_FONT_INFO;\r
185\r
186//\r
187// Image Package definitions\r
188//\r
189\r
190#define HII_PIXEL_MASK 0x80\r
191\r
192typedef struct _HII_IMAGE_PACKAGE_INSTANCE {\r
193 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr;\r
194 UINT32 ImageBlockSize;\r
195 UINT32 PaletteInfoSize;\r
196 UINT8 *ImageBlock;\r
197 UINT8 *PaletteBlock;\r
198} HII_IMAGE_PACKAGE_INSTANCE;\r
199\r
200//\r
201// Keyboard Layout Pacakge definitions\r
202//\r
f3f2e05d 203#define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')\r
ac644614 204typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {\r
205 UINTN Signature;\r
206 UINT8 *KeyboardPkg;\r
207 LIST_ENTRY KeyboardEntry;\r
208} HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE;\r
209\r
210//\r
211// Guid Package definitions\r
212//\r
f3f2e05d 213#define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')\r
ac644614 214typedef struct _HII_GUID_PACKAGE_INSTANCE {\r
215 UINTN Signature;\r
216 UINT8 *GuidPkg;\r
217 LIST_ENTRY GuidEntry;\r
218} HII_GUID_PACKAGE_INSTANCE;\r
219\r
220//\r
221// A package list can contain only one or less than one device path package.\r
222// This rule also applies to image package since ImageId can not be duplicate.\r
223//\r
224typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE {\r
225 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr;\r
226 LIST_ENTRY GuidPkgHdr;\r
227 LIST_ENTRY FormPkgHdr;\r
228 LIST_ENTRY KeyboardLayoutHdr;\r
229 LIST_ENTRY StringPkgHdr;\r
230 LIST_ENTRY FontPkgHdr;\r
231 HII_IMAGE_PACKAGE_INSTANCE *ImagePkg;\r
232 LIST_ENTRY SimpleFontPkgHdr;\r
233 UINT8 *DevicePathPkg;\r
234} HII_DATABASE_PACKAGE_LIST_INSTANCE;\r
235\r
f3f2e05d 236#define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')\r
ac644614 237\r
238typedef struct {\r
239 UINTN Signature;\r
240 LIST_ENTRY Handle;\r
241 UINTN Key;\r
242} HII_HANDLE;\r
243\r
f3f2e05d 244#define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')\r
ac644614 245\r
246typedef struct _HII_DATABASE_RECORD {\r
247 UINTN Signature;\r
248 HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList;\r
249 EFI_HANDLE DriverHandle;\r
250 EFI_HII_HANDLE Handle;\r
251 LIST_ENTRY DatabaseEntry;\r
252} HII_DATABASE_RECORD;\r
253\r
f3f2e05d 254#define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')\r
ac644614 255\r
256typedef struct _HII_DATABASE_NOTIFY {\r
257 UINTN Signature;\r
258 EFI_HANDLE NotifyHandle;\r
259 UINT8 PackageType;\r
260 EFI_GUID *PackageGuid;\r
261 EFI_HII_DATABASE_NOTIFY PackageNotifyFn;\r
262 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType;\r
263 LIST_ENTRY DatabaseNotifyEntry;\r
264} HII_DATABASE_NOTIFY;\r
265\r
f3f2e05d 266#define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')\r
ac644614 267\r
268typedef struct _HII_DATABASE_PRIVATE_DATA {\r
269 UINTN Signature;\r
270 LIST_ENTRY DatabaseList;\r
271 LIST_ENTRY DatabaseNotifyList;\r
272 EFI_HII_FONT_PROTOCOL HiiFont;\r
ac644614 273 EFI_HII_IMAGE_PROTOCOL HiiImage;\r
ac644614 274 EFI_HII_STRING_PROTOCOL HiiString;\r
275 EFI_HII_DATABASE_PROTOCOL HiiDatabase;\r
276 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting;\r
277 LIST_ENTRY HiiHandleList;\r
278 INTN HiiHandleCount;\r
279 LIST_ENTRY FontInfoList; // global font info list\r
280 UINTN Attribute; // default system color\r
281 EFI_GUID CurrentLayoutGuid;\r
282 EFI_HII_KEYBOARD_LAYOUT *CurrentLayout;\r
283} HII_DATABASE_PRIVATE_DATA;\r
284\r
285#define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
286 CR (a, \\r
287 HII_DATABASE_PRIVATE_DATA, \\r
288 HiiFont, \\r
289 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
290 )\r
291\r
292#define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
293 CR (a, \\r
294 HII_DATABASE_PRIVATE_DATA, \\r
295 HiiImage, \\r
296 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
297 )\r
298\r
299#define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
300 CR (a, \\r
301 HII_DATABASE_PRIVATE_DATA, \\r
302 HiiString, \\r
303 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
304 )\r
305\r
306#define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
307 CR (a, \\r
308 HII_DATABASE_PRIVATE_DATA, \\r
309 HiiDatabase, \\r
310 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
311 )\r
312\r
313#define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
314 CR (a, \\r
315 HII_DATABASE_PRIVATE_DATA, \\r
316 ConfigRouting, \\r
317 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
318 )\r
319\r
320//\r
321// Internal function prototypes.\r
322//\r
323\r
324/**\r
e90b081a 325 This function checks whether a handle is a valid EFI_HII_HANDLE.\r
ac644614 326\r
327 @param Handle Pointer to a EFI_HII_HANDLE\r
328\r
329 @retval TRUE Valid\r
330 @retval FALSE Invalid\r
331\r
332**/\r
333BOOLEAN\r
334IsHiiHandleValid (\r
335 EFI_HII_HANDLE Handle\r
ed66e1bc 336 );\r
ac644614 337\r
338\r
339/**\r
340 This function checks whether EFI_FONT_INFO exists in current database. If\r
341 FontInfoMask is specified, check what options can be used to make a match.\r
342 Note that the masks relate to where the system default should be supplied\r
343 are ignored by this function.\r
344\r
345 @param Private Hii database private structure.\r
346 @param FontInfo Points to EFI_FONT_INFO structure.\r
347 @param FontInfoMask If not NULL, describes what options can be used\r
348 to make a match between the font requested and\r
349 the font available. The caller must guarantee\r
350 this mask is valid.\r
351 @param FontHandle On entry, Points to the font handle returned by a\r
352 previous call to GetFontInfo() or NULL to start\r
353 with the first font.\r
354 @param GlobalFontInfo If not NULL, output the corresponding globa font\r
355 info.\r
356\r
357 @retval TRUE Existed\r
358 @retval FALSE Not existed\r
359\r
360**/\r
361BOOLEAN\r
362IsFontInfoExisted (\r
363 IN HII_DATABASE_PRIVATE_DATA *Private,\r
364 IN EFI_FONT_INFO *FontInfo,\r
365 IN EFI_FONT_INFO_MASK *FontInfoMask, OPTIONAL\r
366 IN EFI_FONT_HANDLE FontHandle, OPTIONAL\r
367 OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo OPTIONAL\r
ed66e1bc 368 );\r
ac644614 369\r
8d00a0f1 370/**\r
371\r
372 This function invokes the matching registered function.\r
373 \r
374 @param Private HII Database driver private structure.\r
375 @param NotifyType The type of change concerning the database.\r
376 @param PackageInstance Points to the package referred to by the notification.\r
377 @param PackageType Package type\r
378 @param Handle The handle of the package list which contains the specified package.\r
379 \r
380 @retval EFI_SUCCESS Already checked all registered function and invoked \r
381 if matched.\r
382 @retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
383 \r
384**/\r
385EFI_STATUS\r
386InvokeRegisteredFunction (\r
387 IN HII_DATABASE_PRIVATE_DATA *Private, \r
388 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
389 IN VOID *PackageInstance,\r
390 IN UINT8 PackageType,\r
391 IN EFI_HII_HANDLE Handle\r
392 )\r
393;\r
ac644614 394\r
395/**\r
396 Retrieve system default font and color.\r
397\r
398 @param Private HII database driver private data.\r
399 @param FontInfo Points to system default font output-related\r
400 information. It's caller's responsibility to free\r
401 this buffer.\r
402 @param FontInfoSize If not NULL, output the size of buffer FontInfo.\r
403\r
404 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.\r
405 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
406 task.\r
407 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
408\r
409**/\r
410EFI_STATUS\r
411GetSystemFont (\r
412 IN HII_DATABASE_PRIVATE_DATA *Private,\r
413 OUT EFI_FONT_DISPLAY_INFO **FontInfo,\r
414 OUT UINTN *FontInfoSize OPTIONAL\r
ed66e1bc 415 );\r
ac644614 416\r
417\r
418/**\r
419 Parse all string blocks to find a String block specified by StringId.\r
420 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
d6a82eaf
LG
421 within this string package and backup its information. If LastStringId is \r
422 specified, the string id of last string block will also be output.\r
423 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).\r
ac644614 424\r
425 @param Private Hii database private structure.\r
426 @param StringPackage Hii string package instance.\r
427 @param StringId The string's id, which is unique within\r
428 PackageList.\r
429 @param BlockType Output the block type of found string block.\r
430 @param StringBlockAddr Output the block address of found string block.\r
431 @param StringTextOffset Offset, relative to the found block address, of\r
432 the string text information.\r
d6a82eaf 433 @param LastStringId Output the last string id when StringId = 0 or StringId = -1.\r
e5c861ac 434 @param StartStringId The first id in the skip block which StringId in the block.\r
ac644614 435\r
436 @retval EFI_SUCCESS The string text and font is retrieved\r
437 successfully.\r
438 @retval EFI_NOT_FOUND The specified text or font info can not be found\r
439 out.\r
440 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
441 task.\r
442\r
443**/\r
444EFI_STATUS\r
445FindStringBlock (\r
446 IN HII_DATABASE_PRIVATE_DATA *Private,\r
447 IN HII_STRING_PACKAGE_INSTANCE *StringPackage,\r
448 IN EFI_STRING_ID StringId,\r
449 OUT UINT8 *BlockType, OPTIONAL\r
450 OUT UINT8 **StringBlockAddr, OPTIONAL\r
451 OUT UINTN *StringTextOffset, OPTIONAL\r
e5c861ac
ED
452 OUT EFI_STRING_ID *LastStringId, OPTIONAL\r
453 OUT EFI_STRING_ID *StartStringId OPTIONAL\r
ed66e1bc 454 );\r
ac644614 455\r
456\r
457/**\r
458 Parse all glyph blocks to find a glyph block specified by CharValue.\r
459 If CharValue = (CHAR16) (-1), collect all default character cell information\r
460 within this font package and backup its information.\r
461\r
462 @param FontPackage Hii string package instance.\r
463 @param CharValue Unicode character value, which identifies a glyph\r
464 block.\r
465 @param GlyphBuffer Output the corresponding bitmap data of the found\r
466 block. It is the caller's responsiblity to free\r
467 this buffer.\r
468 @param Cell Output cell information of the encoded bitmap.\r
469 @param GlyphBufferLen If not NULL, output the length of GlyphBuffer.\r
470\r
471 @retval EFI_SUCCESS The bitmap data is retrieved successfully.\r
472 @retval EFI_NOT_FOUND The specified CharValue does not exist in current\r
473 database.\r
474 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
475 task.\r
476\r
477**/\r
478EFI_STATUS\r
479FindGlyphBlock (\r
480 IN HII_FONT_PACKAGE_INSTANCE *FontPackage,\r
481 IN CHAR16 CharValue,\r
482 OUT UINT8 **GlyphBuffer, OPTIONAL\r
483 OUT EFI_HII_GLYPH_INFO *Cell, OPTIONAL\r
484 OUT UINTN *GlyphBufferLen OPTIONAL\r
ed66e1bc 485 );\r
ac644614 486\r
8567300a
LG
487/**\r
488 This function exports Form packages to a buffer.\r
489 This is a internal function.\r
490\r
491 @param Private Hii database private structure.\r
492 @param Handle Identification of a package list.\r
493 @param PackageList Pointer to a package list which will be exported.\r
494 @param UsedSize The length of buffer be used.\r
495 @param BufferSize Length of the Buffer.\r
496 @param Buffer Allocated space for storing exported data.\r
497 @param ResultSize The size of the already exported content of this\r
498 package list.\r
499\r
500 @retval EFI_SUCCESS Form Packages are exported successfully.\r
501 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
502\r
503**/\r
504EFI_STATUS\r
505ExportFormPackages (\r
506 IN HII_DATABASE_PRIVATE_DATA *Private,\r
507 IN EFI_HII_HANDLE Handle,\r
508 IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList,\r
509 IN UINTN UsedSize,\r
510 IN UINTN BufferSize,\r
511 IN OUT VOID *Buffer,\r
512 IN OUT UINTN *ResultSize\r
513 );\r
514\r
ac644614 515//\r
516// EFI_HII_FONT_PROTOCOL protocol interfaces\r
517//\r
518\r
519\r
520/**\r
521 Renders a string to a bitmap or to the display.\r
522\r
523 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
524 @param Flags Describes how the string is to be drawn.\r
525 @param String Points to the null-terminated string to be\r
526 displayed.\r
527 @param StringInfo Points to the string output information,\r
528 including the color and font. If NULL, then the\r
529 string will be output in the default system font\r
530 and color.\r
531 @param Blt If this points to a non-NULL on entry, this\r
532 points to the image, which is Width pixels wide\r
533 and Height pixels high. The string will be drawn\r
534 onto this image and\r
535 EFI_HII_OUT_FLAG_CLIP is implied. If this points\r
536 to a NULL on entry, then a buffer\r
537 will be allocated to hold the generated image and\r
538 the pointer updated on exit. It is the caller's\r
539 responsibility to free this buffer.\r
e90b081a 540 @param BltX Together with BltX, Specifies the offset from the left and top edge\r
541 of the image of the first character cell in the\r
542 image.\r
543 @param BltY Together with BltY, Specifies the offset from the left and top edge\r
ac644614 544 of the image of the first character cell in the\r
545 image.\r
546 @param RowInfoArray If this is non-NULL on entry, then on exit, this\r
547 will point to an allocated buffer containing\r
548 row information and RowInfoArraySize will be\r
549 updated to contain the number of elements.\r
550 This array describes the characters which were at\r
551 least partially drawn and the heights of the\r
552 rows. It is the caller's responsibility to free\r
553 this buffer.\r
554 @param RowInfoArraySize If this is non-NULL on entry, then on exit it\r
555 contains the number of elements in RowInfoArray.\r
556 @param ColumnInfoArray If this is non-NULL, then on return it will be\r
557 filled with the horizontal offset for each\r
558 character in the string on the row where it is\r
559 displayed. Non-printing characters will have\r
560 the offset ~0. The caller is responsible to\r
561 allocate a buffer large enough so that there\r
562 is one entry for each character in the string,\r
563 not including the null-terminator. It is possible\r
564 when character display is normalized that some\r
565 character cells overlap.\r
566\r
567 @retval EFI_SUCCESS The string was successfully rendered.\r
568 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for\r
569 RowInfoArray or Blt.\r
813acf3a 570 @retval EFI_INVALID_PARAMETER The String or Blt.\r
571 @retval EFI_INVALID_PARAMETER Flags were invalid combination..\r
ac644614 572\r
573**/\r
574EFI_STATUS\r
575EFIAPI\r
576HiiStringToImage (\r
577 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
578 IN EFI_HII_OUT_FLAGS Flags,\r
579 IN CONST EFI_STRING String,\r
580 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,\r
581 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
582 IN UINTN BltX,\r
583 IN UINTN BltY,\r
584 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r
585 OUT UINTN *RowInfoArraySize OPTIONAL,\r
586 OUT UINTN *ColumnInfoArray OPTIONAL\r
ed66e1bc 587 );\r
ac644614 588\r
589\r
590/**\r
591 Render a string to a bitmap or the screen containing the contents of the specified string.\r
592\r
593 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
594 @param Flags Describes how the string is to be drawn.\r
595 @param PackageList The package list in the HII database to search\r
596 for the specified string.\r
597 @param StringId The string's id, which is unique within\r
598 PackageList.\r
599 @param Language Points to the language for the retrieved string.\r
600 If NULL, then the current system language is\r
601 used.\r
602 @param StringInfo Points to the string output information,\r
603 including the color and font. If NULL, then the\r
604 string will be output in the default system font\r
605 and color.\r
606 @param Blt If this points to a non-NULL on entry, this\r
607 points to the image, which is Width pixels wide\r
608 and Height pixels high. The string will be drawn\r
609 onto this image and\r
610 EFI_HII_OUT_FLAG_CLIP is implied. If this points\r
611 to a NULL on entry, then a buffer\r
612 will be allocated to hold the generated image and\r
613 the pointer updated on exit. It is the caller's\r
614 responsibility to free this buffer.\r
e90b081a 615 @param BltX Together with BltX, Specifies the offset from the left and top edge\r
616 of the image of the first character cell in the\r
617 image.\r
618 @param BltY Together with BltY, Specifies the offset from the left and top edge\r
ac644614 619 of the image of the first character cell in the\r
620 image.\r
621 @param RowInfoArray If this is non-NULL on entry, then on exit, this\r
622 will point to an allocated buffer containing\r
623 row information and RowInfoArraySize will be\r
624 updated to contain the number of elements.\r
625 This array describes the characters which were at\r
626 least partially drawn and the heights of the\r
627 rows. It is the caller's responsibility to free\r
628 this buffer.\r
629 @param RowInfoArraySize If this is non-NULL on entry, then on exit it\r
630 contains the number of elements in RowInfoArray.\r
631 @param ColumnInfoArray If this is non-NULL, then on return it will be\r
632 filled with the horizontal offset for each\r
633 character in the string on the row where it is\r
634 displayed. Non-printing characters will have\r
635 the offset ~0. The caller is responsible to\r
636 allocate a buffer large enough so that there\r
637 is one entry for each character in the string,\r
638 not including the null-terminator. It is possible\r
639 when character display is normalized that some\r
640 character cells overlap.\r
641\r
642 @retval EFI_SUCCESS The string was successfully rendered.\r
643 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for\r
644 RowInfoArray or Blt.\r
813acf3a 645 @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.\r
646 @retval EFI_INVALID_PARAMETER Flags were invalid combination.\r
647 @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not \r
648 in the specified PackageList. \r
ac644614 649\r
650**/\r
651EFI_STATUS\r
652EFIAPI\r
653HiiStringIdToImage (\r
654 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
655 IN EFI_HII_OUT_FLAGS Flags,\r
656 IN EFI_HII_HANDLE PackageList,\r
657 IN EFI_STRING_ID StringId,\r
658 IN CONST CHAR8* Language,\r
659 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,\r
660 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
661 IN UINTN BltX,\r
662 IN UINTN BltY,\r
663 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r
664 OUT UINTN *RowInfoArraySize OPTIONAL,\r
665 OUT UINTN *ColumnInfoArray OPTIONAL\r
ed66e1bc 666 );\r
ac644614 667\r
668\r
669/**\r
670 Convert the glyph for a single character into a bitmap.\r
671\r
672 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
673 @param Char Character to retrieve.\r
674 @param StringInfo Points to the string font and color information\r
675 or NULL if the string should use the default\r
676 system font and color.\r
677 @param Blt Thus must point to a NULL on entry. A buffer will\r
678 be allocated to hold the output and the pointer\r
679 updated on exit. It is the caller's\r
680 responsibility to free this buffer.\r
681 @param Baseline Number of pixels from the bottom of the bitmap to\r
682 the baseline.\r
683\r
684 @retval EFI_SUCCESS Glyph bitmap created.\r
685 @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.\r
686 @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was replaced with the\r
687 glyph for Unicode character 0xFFFD.\r
688 @retval EFI_INVALID_PARAMETER Blt is NULL or *Blt is not NULL.\r
689\r
690**/\r
691EFI_STATUS\r
692EFIAPI\r
693HiiGetGlyph (\r
694 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
695 IN CHAR16 Char,\r
e90b081a 696 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,\r
ac644614 697 OUT EFI_IMAGE_OUTPUT **Blt,\r
698 OUT UINTN *Baseline OPTIONAL\r
ed66e1bc 699 );\r
ac644614 700\r
701\r
702/**\r
703 This function iterates through fonts which match the specified font, using\r
704 the specified criteria. If String is non-NULL, then all of the characters in\r
705 the string must exist in order for a candidate font to be returned.\r
706\r
707 @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
708 @param FontHandle On entry, points to the font handle returned by a\r
709 previous call to GetFontInfo() or NULL to start\r
710 with the first font. On return, points to the\r
711 returned font handle or points to NULL if there\r
712 are no more matching fonts.\r
713 @param StringInfoIn Upon entry, points to the font to return\r
813acf3a 714 information about. If NULL, then the information about the system default \r
715 font will be returned.\r
ac644614 716 @param StringInfoOut Upon return, contains the matching font's\r
717 information. If NULL, then no information is\r
718 returned. It's caller's responsibility to free\r
719 this buffer.\r
720 @param String Points to the string which will be tested to\r
721 determine if all characters are available. If\r
722 NULL, then any font is acceptable.\r
723\r
724 @retval EFI_SUCCESS Matching font returned successfully.\r
725 @retval EFI_NOT_FOUND No matching font was found.\r
726 @retval EFI_INVALID_PARAMETER StringInfoIn is NULL.\r
813acf3a 727 @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.\r
ac644614 728 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the\r
729 request.\r
ac644614 730**/\r
731EFI_STATUS\r
732EFIAPI\r
733HiiGetFontInfo (\r
734 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
735 IN OUT EFI_FONT_HANDLE *FontHandle,\r
e90b081a 736 IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL\r
ac644614 737 OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,\r
738 IN CONST EFI_STRING String OPTIONAL\r
ed66e1bc 739 );\r
ac644614 740\r
741//\r
742// EFI_HII_IMAGE_PROTOCOL interfaces\r
743//\r
744\r
745\r
746/**\r
747 This function adds the image Image to the group of images owned by PackageList, and returns\r
748 a new image identifier (ImageId).\r
749\r
750 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
751 @param PackageList Handle of the package list where this image will\r
752 be added.\r
753 @param ImageId On return, contains the new image id, which is\r
754 unique within PackageList.\r
755 @param Image Points to the image.\r
756\r
757 @retval EFI_SUCCESS The new image was added successfully.\r
758 @retval EFI_NOT_FOUND The specified PackageList could not be found in\r
759 database.\r
760 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.\r
761 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.\r
762\r
763**/\r
764EFI_STATUS\r
765EFIAPI\r
766HiiNewImage (\r
767 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
768 IN EFI_HII_HANDLE PackageList,\r
769 OUT EFI_IMAGE_ID *ImageId,\r
770 IN CONST EFI_IMAGE_INPUT *Image\r
ed66e1bc 771 );\r
ac644614 772\r
773\r
774/**\r
775 This function retrieves the image specified by ImageId which is associated with\r
776 the specified PackageList and copies it into the buffer specified by Image.\r
777\r
778 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
779 @param PackageList Handle of the package list where this image will\r
780 be searched.\r
781 @param ImageId The image's id,, which is unique within\r
782 PackageList.\r
783 @param Image Points to the image.\r
ac644614 784\r
785 @retval EFI_SUCCESS The new image was returned successfully.\r
786 @retval EFI_NOT_FOUND The image specified by ImageId is not available.\r
813acf3a 787 The specified PackageList is not in the database.\r
ac644614 788 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to\r
789 hold the image.\r
790 @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL.\r
813acf3a 791 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not\r
792 enough memory.\r
ac644614 793\r
794**/\r
795EFI_STATUS\r
796EFIAPI\r
797HiiGetImage (\r
798 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
799 IN EFI_HII_HANDLE PackageList,\r
800 IN EFI_IMAGE_ID ImageId,\r
813acf3a 801 OUT EFI_IMAGE_INPUT *Image\r
ed66e1bc 802 );\r
ac644614 803\r
804\r
805/**\r
806 This function updates the image specified by ImageId in the specified PackageListHandle to\r
807 the image specified by Image.\r
808\r
809 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
810 @param PackageList The package list containing the images.\r
811 @param ImageId The image's id,, which is unique within\r
812 PackageList.\r
813 @param Image Points to the image.\r
814\r
815 @retval EFI_SUCCESS The new image was updated successfully.\r
816 @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r
813acf3a 817 database. The specified PackageList is not in the database.\r
ac644614 818 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
819\r
820**/\r
821EFI_STATUS\r
822EFIAPI\r
823HiiSetImage (\r
824 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
825 IN EFI_HII_HANDLE PackageList,\r
826 IN EFI_IMAGE_ID ImageId,\r
827 IN CONST EFI_IMAGE_INPUT *Image\r
ed66e1bc 828 );\r
ac644614 829\r
830\r
831/**\r
832 This function renders an image to a bitmap or the screen using the specified\r
833 color and options. It draws the image on an existing bitmap, allocates a new\r
834 bitmap or uses the screen. The images can be clipped.\r
835\r
836 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
837 @param Flags Describes how the image is to be drawn.\r
838 @param Image Points to the image to be displayed.\r
839 @param Blt If this points to a non-NULL on entry, this\r
840 points to the image, which is Width pixels wide\r
841 and Height pixels high. The image will be drawn\r
842 onto this image and EFI_HII_DRAW_FLAG_CLIP is\r
843 implied. If this points to a NULL on entry, then\r
844 a buffer will be allocated to hold the generated\r
845 image and the pointer updated on exit. It is the\r
846 caller's responsibility to free this buffer.\r
e90b081a 847 @param BltX Specifies the offset from the left and top edge\r
848 of the output image of the first pixel in the\r
849 image.\r
ac644614 850 @param BltY Specifies the offset from the left and top edge\r
851 of the output image of the first pixel in the\r
852 image.\r
853\r
854 @retval EFI_SUCCESS The image was successfully drawn.\r
855 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r
856 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.\r
857 @retval EFI_INVALID_PARAMETER Any combination of Flags is invalid.\r
858\r
859**/\r
860EFI_STATUS\r
861EFIAPI\r
862HiiDrawImage (\r
863 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
864 IN EFI_HII_DRAW_FLAGS Flags,\r
865 IN CONST EFI_IMAGE_INPUT *Image,\r
866 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
867 IN UINTN BltX,\r
868 IN UINTN BltY\r
ed66e1bc 869 );\r
ac644614 870\r
871\r
872/**\r
873 This function renders an image to a bitmap or the screen using the specified\r
874 color and options. It draws the image on an existing bitmap, allocates a new\r
875 bitmap or uses the screen. The images can be clipped.\r
876\r
877 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
878 @param Flags Describes how the image is to be drawn.\r
879 @param PackageList The package list in the HII database to search\r
880 for the specified image.\r
881 @param ImageId The image's id, which is unique within\r
882 PackageList.\r
883 @param Blt If this points to a non-NULL on entry, this\r
884 points to the image, which is Width pixels wide\r
885 and Height pixels high. The image will be drawn\r
886 onto this image and\r
887 EFI_HII_DRAW_FLAG_CLIP is implied. If this points\r
888 to a NULL on entry, then a buffer will be\r
889 allocated to hold the generated image and the\r
890 pointer updated on exit. It is the caller's\r
891 responsibility to free this buffer.\r
e90b081a 892 @param BltX Specifies the offset from the left and top edge\r
893 of the output image of the first pixel in the\r
894 image.\r
ac644614 895 @param BltY Specifies the offset from the left and top edge\r
896 of the output image of the first pixel in the\r
897 image.\r
898\r
899 @retval EFI_SUCCESS The image was successfully drawn.\r
900 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r
813acf3a 901 @retval EFI_INVALID_PARAMETER The Blt was NULL.\r
902 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database. \r
903 The specified PackageList is not in the database.\r
ac644614 904\r
905**/\r
906EFI_STATUS\r
907EFIAPI\r
908HiiDrawImageId (\r
909 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
910 IN EFI_HII_DRAW_FLAGS Flags,\r
911 IN EFI_HII_HANDLE PackageList,\r
912 IN EFI_IMAGE_ID ImageId,\r
913 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
914 IN UINTN BltX,\r
915 IN UINTN BltY\r
916 )\r
917\r
918;\r
919\r
920//\r
921// EFI_HII_STRING_PROTOCOL\r
922//\r
923\r
924\r
925/**\r
926 This function adds the string String to the group of strings owned by PackageList, with the\r
927 specified font information StringFontInfo and returns a new string id.\r
928\r
929 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
930 instance.\r
931 @param PackageList Handle of the package list where this string will\r
932 be added.\r
933 @param StringId On return, contains the new strings id, which is\r
934 unique within PackageList.\r
935 @param Language Points to the language for the new string.\r
936 @param LanguageName Points to the printable language name to\r
937 associate with the passed in Language field.If\r
938 LanguageName is not NULL and the string package\r
939 header's LanguageName associated with a given\r
940 Language is not zero, the LanguageName being\r
941 passed in will be ignored.\r
942 @param String Points to the new null-terminated string.\r
943 @param StringFontInfo Points to the new string's font information or\r
944 NULL if the string should have the default system\r
945 font, size and style.\r
946\r
947 @retval EFI_SUCCESS The new string was added successfully.\r
948 @retval EFI_NOT_FOUND The specified PackageList could not be found in\r
949 database.\r
950 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of\r
951 resources.\r
952 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL or Language is\r
953 NULL.\r
954\r
955**/\r
956EFI_STATUS\r
957EFIAPI\r
958HiiNewString (\r
959 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
960 IN EFI_HII_HANDLE PackageList,\r
961 OUT EFI_STRING_ID *StringId,\r
962 IN CONST CHAR8 *Language,\r
963 IN CONST CHAR16 *LanguageName, OPTIONAL\r
964 IN CONST EFI_STRING String,\r
965 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
ed66e1bc 966 );\r
ac644614 967\r
968\r
969/**\r
970 This function retrieves the string specified by StringId which is associated\r
971 with the specified PackageList in the language Language and copies it into\r
972 the buffer specified by String.\r
973\r
974 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
975 instance.\r
976 @param Language Points to the language for the retrieved string.\r
977 @param PackageList The package list in the HII database to search\r
978 for the specified string.\r
979 @param StringId The string's id, which is unique within\r
980 PackageList.\r
981 @param String Points to the new null-terminated string.\r
982 @param StringSize On entry, points to the size of the buffer\r
983 pointed to by String, in bytes. On return,\r
984 points to the length of the string, in bytes.\r
985 @param StringFontInfo If not NULL, points to the string's font\r
986 information. It's caller's responsibility to\r
987 free this buffer.\r
988\r
989 @retval EFI_SUCCESS The string was returned successfully.\r
990 @retval EFI_NOT_FOUND The string specified by StringId is not\r
991 available.\r
992 @retval EFI_NOT_FOUND The string specified by StringId is available but\r
813acf3a 993 not in the specified language.\r
994 The specified PackageList is not in the database.\r
995 @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but\r
ac644614 996 @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small\r
997 to hold the string.\r
998 @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.\r
999 @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the\r
1000 request.\r
1001\r
1002**/\r
1003EFI_STATUS\r
1004EFIAPI\r
1005HiiGetString (\r
1006 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1007 IN CONST CHAR8 *Language,\r
1008 IN EFI_HII_HANDLE PackageList,\r
1009 IN EFI_STRING_ID StringId,\r
1010 OUT EFI_STRING String,\r
1011 IN OUT UINTN *StringSize,\r
1012 OUT EFI_FONT_INFO **StringFontInfo OPTIONAL\r
ed66e1bc 1013 );\r
ac644614 1014\r
1015\r
1016/**\r
1017 This function updates the string specified by StringId in the specified PackageList to the text\r
1018 specified by String and, optionally, the font information specified by StringFontInfo.\r
1019\r
1020 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
1021 instance.\r
1022 @param PackageList The package list containing the strings.\r
1023 @param StringId The string's id, which is unique within\r
1024 PackageList.\r
1025 @param Language Points to the language for the updated string.\r
1026 @param String Points to the new null-terminated string.\r
1027 @param StringFontInfo Points to the string's font information or NULL\r
1028 if the string font information is not changed.\r
1029\r
1030 @retval EFI_SUCCESS The string was updated successfully.\r
1031 @retval EFI_NOT_FOUND The string specified by StringId is not in the\r
1032 database.\r
1033 @retval EFI_INVALID_PARAMETER The String or Language was NULL.\r
1034 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
1035 task.\r
1036\r
1037**/\r
1038EFI_STATUS\r
1039EFIAPI\r
1040HiiSetString (\r
1041 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1042 IN EFI_HII_HANDLE PackageList,\r
1043 IN EFI_STRING_ID StringId,\r
1044 IN CONST CHAR8 *Language,\r
1045 IN CONST EFI_STRING String,\r
1046 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
ed66e1bc 1047 );\r
ac644614 1048\r
1049\r
1050/**\r
1051 This function returns the list of supported languages, in the format specified\r
1052 in Appendix M of UEFI 2.1 spec.\r
1053\r
1054 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
1055 instance.\r
1056 @param PackageList The package list to examine.\r
4f077902
SZ
1057 @param Languages Points to the buffer to hold the returned\r
1058 null-terminated ASCII string.\r
ac644614 1059 @param LanguagesSize On entry, points to the size of the buffer\r
1060 pointed to by Languages, in bytes. On return,\r
1061 points to the length of Languages, in bytes.\r
1062\r
1063 @retval EFI_SUCCESS The languages were returned successfully.\r
1064 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.\r
1065 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list\r
1066 of supported languages. LanguageSize is updated\r
1067 to contain the required size.\r
1068 @retval EFI_NOT_FOUND Could not find string package in specified\r
1069 packagelist.\r
1070\r
1071**/\r
1072EFI_STATUS\r
1073EFIAPI\r
1074HiiGetLanguages (\r
1075 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1076 IN EFI_HII_HANDLE PackageList,\r
1077 IN OUT CHAR8 *Languages,\r
1078 IN OUT UINTN *LanguagesSize\r
ed66e1bc 1079 );\r
ac644614 1080\r
1081\r
1082/**\r
1083 Each string package has associated with it a single primary language and zero\r
1084 or more secondary languages. This routine returns the secondary languages\r
1085 associated with a package list.\r
1086\r
1087 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
1088 instance.\r
1089 @param PackageList The package list to examine.\r
4f077902
SZ
1090 @param PrimaryLanguage Points to the null-terminated ASCII string that specifies\r
1091 the primary language. Languages are specified in the\r
1092 format specified in Appendix M of the UEFI 2.0 specification.\r
1093 @param SecondaryLanguages Points to the buffer to hold the returned null-terminated\r
1094 ASCII string that describes the list of\r
1095 secondary languages for the specified\r
1096 PrimaryLanguage. If there are no secondary\r
1097 languages, the function returns successfully,\r
ac644614 1098 but this is set to NULL.\r
e90b081a 1099 @param SecondaryLanguagesSize On entry, points to the size of the buffer\r
4f077902
SZ
1100 pointed to by SecondaryLanguages, in bytes. On\r
1101 return, points to the length of SecondaryLanguages\r
ac644614 1102 in bytes.\r
1103\r
1104 @retval EFI_SUCCESS Secondary languages were correctly returned.\r
4f077902
SZ
1105 @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguages or\r
1106 SecondaryLanguagesSize was NULL.\r
1107 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is\r
ac644614 1108 too small to hold the returned information.\r
4f077902 1109 SecondaryLanguageSize is updated to hold the size of\r
ac644614 1110 the buffer required.\r
4f077902 1111 @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not\r
ac644614 1112 present in the specified package list.\r
813acf3a 1113 @retval EFI_NOT_FOUND The specified PackageList is not in the Database. \r
ac644614 1114\r
1115**/\r
1116EFI_STATUS\r
1117EFIAPI\r
1118HiiGetSecondaryLanguages (\r
1119 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1120 IN EFI_HII_HANDLE PackageList,\r
4f077902 1121 IN CONST CHAR8 *PrimaryLanguage,\r
e90b081a 1122 IN OUT CHAR8 *SecondaryLanguages,\r
1123 IN OUT UINTN *SecondaryLanguagesSize\r
ed66e1bc 1124 );\r
ac644614 1125\r
1126//\r
1127// EFI_HII_DATABASE_PROTOCOL protocol interfaces\r
1128//\r
1129\r
1130\r
1131/**\r
1132 This function adds the packages in the package list to the database and returns a handle. If there is a\r
1133 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will\r
1134 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.\r
1135\r
1136 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1137 instance.\r
1138 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
1139 structure.\r
1140 @param DriverHandle Associate the package list with this EFI handle.\r
b1a803d1 1141 If a NULL is specified, this data will not be associate\r
1142 with any drivers and cannot have a callback induced.\r
ac644614 1143 @param Handle A pointer to the EFI_HII_HANDLE instance.\r
1144\r
1145 @retval EFI_SUCCESS The package list associated with the Handle was\r
1146 added to the HII database.\r
1147 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the\r
1148 new database contents.\r
1149 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.\r
1150\r
1151**/\r
1152EFI_STATUS\r
1153EFIAPI\r
1154HiiNewPackageList (\r
1155 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1156 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,\r
b1a803d1 1157 IN CONST EFI_HANDLE DriverHandle, OPTIONAL\r
ac644614 1158 OUT EFI_HII_HANDLE *Handle\r
ed66e1bc 1159 );\r
ac644614 1160\r
1161\r
1162/**\r
1163 This function removes the package list that is associated with a handle Handle\r
1164 from the HII database. Before removing the package, any registered functions\r
1165 with the notification type REMOVE_PACK and the same package type will be called.\r
1166\r
1167 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1168 instance.\r
1169 @param Handle The handle that was registered to the data that\r
1170 is requested for removal.\r
1171\r
1172 @retval EFI_SUCCESS The data associated with the Handle was removed\r
1173 from the HII database.\r
813acf3a 1174 @retval EFI_NOT_FOUND The specified Handle is not in database.\r
ac644614 1175\r
1176**/\r
1177EFI_STATUS\r
1178EFIAPI\r
1179HiiRemovePackageList (\r
1180 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1181 IN EFI_HII_HANDLE Handle\r
ed66e1bc 1182 );\r
ac644614 1183\r
1184\r
1185/**\r
1186 This function updates the existing package list (which has the specified Handle)\r
1187 in the HII databases, using the new package list specified by PackageList.\r
1188\r
1189 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1190 instance.\r
1191 @param Handle The handle that was registered to the data that\r
1192 is requested to be updated.\r
1193 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
1194 package.\r
1195\r
1196 @retval EFI_SUCCESS The HII database was successfully updated.\r
1197 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated\r
1198 database.\r
813acf3a 1199 @retval EFI_INVALID_PARAMETER PackageList was NULL.\r
1200 @retval EFI_NOT_FOUND The specified Handle is not in database.\r
ac644614 1201\r
1202**/\r
1203EFI_STATUS\r
1204EFIAPI\r
1205HiiUpdatePackageList (\r
1206 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1207 IN EFI_HII_HANDLE Handle,\r
1208 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList\r
ed66e1bc 1209 );\r
ac644614 1210\r
1211\r
1212/**\r
1213 This function returns a list of the package handles of the specified type\r
1214 that are currently active in the database. The pseudo-type\r
1215 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.\r
1216\r
1217 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1218 instance.\r
1219 @param PackageType Specifies the package type of the packages to\r
1220 list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r
1221 to be listed.\r
1222 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r
1223 this is the pointer to the GUID which must match\r
1224 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.\r
1225 Otherwise, it must be NULL.\r
1226 @param HandleBufferLength On input, a pointer to the length of the handle\r
1227 buffer. On output, the length of the handle\r
1228 buffer that is required for the handles found.\r
1229 @param Handle An array of EFI_HII_HANDLE instances returned.\r
1230\r
1231 @retval EFI_SUCCESS The matching handles are outputed successfully.\r
813acf3a 1232 HandleBufferLength is updated with the actual length.\r
ac644614 1233 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
1234 Handle is too small to support the number of\r
1235 handles. HandleBufferLength is updated with a\r
1236 value that will enable the data to fit.\r
1237 @retval EFI_NOT_FOUND No matching handle could not be found in\r
1238 database.\r
1239 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.\r
813acf3a 1240 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
1241 PackageGuid is not NULL, PackageType is a EFI_HII_\r
1242 PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
1243 \r
ac644614 1244\r
1245**/\r
1246EFI_STATUS\r
1247EFIAPI\r
1248HiiListPackageLists (\r
1249 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1250 IN UINT8 PackageType,\r
1251 IN CONST EFI_GUID *PackageGuid,\r
1252 IN OUT UINTN *HandleBufferLength,\r
1253 OUT EFI_HII_HANDLE *Handle\r
ed66e1bc 1254 );\r
ac644614 1255\r
1256\r
1257/**\r
1258 This function will export one or all package lists in the database to a buffer.\r
1259 For each package list exported, this function will call functions registered\r
1260 with EXPORT_PACK and then copy the package list to the buffer.\r
1261\r
1262 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1263 instance.\r
1264 @param Handle An EFI_HII_HANDLE that corresponds to the desired\r
1265 package list in the HII database to export or\r
1266 NULL to indicate all package lists should be\r
1267 exported.\r
1268 @param BufferSize On input, a pointer to the length of the buffer.\r
1269 On output, the length of the buffer that is\r
1270 required for the exported data.\r
1271 @param Buffer A pointer to a buffer that will contain the\r
1272 results of the export function.\r
1273\r
1274 @retval EFI_SUCCESS Package exported.\r
1275 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
1276 Handle is too small to support the number of\r
1277 handles. HandleBufferLength is updated with\r
1278 a value that will enable the data to fit.\r
1279 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the\r
1280 current database.\r
1281 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.\r
1282\r
1283**/\r
1284EFI_STATUS\r
1285EFIAPI\r
1286HiiExportPackageLists (\r
1287 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1288 IN EFI_HII_HANDLE Handle,\r
1289 IN OUT UINTN *BufferSize,\r
1290 OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer\r
ed66e1bc 1291 );\r
ac644614 1292\r
1293\r
1294/**\r
1295 This function registers a function which will be called when specified actions related to packages of\r
1296 the specified type occur in the HII database. By registering a function, other HII-related drivers are\r
1297 notified when specific package types are added, removed or updated in the HII database.\r
1298 Each driver or application which registers a notification should use\r
1299 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.\r
1300\r
1301 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1302 instance.\r
1303 @param PackageType Specifies the package type of the packages to\r
1304 list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r
1305 to be listed.\r
1306 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r
1307 this is the pointer to the GUID which must match\r
1308 the Guid field of\r
1309 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must\r
1310 be NULL.\r
1311 @param PackageNotifyFn Points to the function to be called when the\r
1312 event specified by\r
1313 NotificationType occurs.\r
1314 @param NotifyType Describes the types of notification which this\r
1315 function will be receiving.\r
1316 @param NotifyHandle Points to the unique handle assigned to the\r
1317 registered notification. Can be used in\r
1318 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()\r
1319 to stop notifications.\r
1320\r
1321 @retval EFI_SUCCESS Notification registered successfully.\r
1322 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures\r
1323 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.\r
1324 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not\r
1325 EFI_HII_PACKAGE_TYPE_GUID.\r
1326 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is\r
1327 EFI_HII_PACKAGE_TYPE_GUID.\r
1328\r
1329**/\r
1330EFI_STATUS\r
1331EFIAPI\r
1332HiiRegisterPackageNotify (\r
1333 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1334 IN UINT8 PackageType,\r
1335 IN CONST EFI_GUID *PackageGuid,\r
1336 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,\r
1337 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
1338 OUT EFI_HANDLE *NotifyHandle\r
ed66e1bc 1339 );\r
ac644614 1340\r
1341\r
1342/**\r
1343 Removes the specified HII database package-related notification.\r
1344\r
1345 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1346 instance.\r
e90b081a 1347 @param NotificationHandle The handle of the notification function being\r
ac644614 1348 unregistered.\r
1349\r
1350 @retval EFI_SUCCESS Notification is unregistered successfully.\r
813acf3a 1351 @retval EFI_NOT_FOUND The incoming notification handle does not exist \r
1352 in current hii database.\r
ac644614 1353\r
1354**/\r
1355EFI_STATUS\r
1356EFIAPI\r
1357HiiUnregisterPackageNotify (\r
1358 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1359 IN EFI_HANDLE NotificationHandle\r
ed66e1bc 1360 );\r
ac644614 1361\r
1362\r
1363/**\r
1364 This routine retrieves an array of GUID values for each keyboard layout that\r
1365 was previously registered in the system.\r
1366\r
1367 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1368 instance.\r
1369 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard\r
1370 GUID buffer. On output, the length of the handle\r
1371 buffer that is required for the handles found.\r
1372 @param KeyGuidBuffer An array of keyboard layout GUID instances\r
1373 returned.\r
1374\r
1375 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.\r
1376 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates\r
1377 that KeyGuidBuffer is too small to support the\r
1378 number of GUIDs. KeyGuidBufferLength is\r
1379 updated with a value that will enable the data to\r
1380 fit.\r
1381 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was\r
1382 NULL.\r
1383 @retval EFI_NOT_FOUND There was no keyboard layout.\r
1384\r
1385**/\r
1386EFI_STATUS\r
1387EFIAPI\r
1388HiiFindKeyboardLayouts (\r
1389 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1390 IN OUT UINT16 *KeyGuidBufferLength,\r
1391 OUT EFI_GUID *KeyGuidBuffer\r
ed66e1bc 1392 );\r
ac644614 1393\r
1394\r
1395/**\r
1396 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys\r
1397 on a keyboard and the character(s) that are associated with a particular set of key strokes.\r
1398\r
1399 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1400 instance.\r
1401 @param KeyGuid A pointer to the unique ID associated with a\r
1402 given keyboard layout. If KeyGuid is NULL then\r
1403 the current layout will be retrieved.\r
1404 @param KeyboardLayoutLength On input, a pointer to the length of the\r
1405 KeyboardLayout buffer. On output, the length of\r
1406 the data placed into KeyboardLayout.\r
1407 @param KeyboardLayout A pointer to a buffer containing the retrieved\r
1408 keyboard layout.\r
1409\r
1410 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r
1411 @retval EFI_NOT_FOUND The requested keyboard layout was not found.\r
1412 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was\r
1413 NULL.\r
1414\r
1415**/\r
1416EFI_STATUS\r
1417EFIAPI\r
1418HiiGetKeyboardLayout (\r
1419 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1420 IN CONST EFI_GUID *KeyGuid,\r
1421 IN OUT UINT16 *KeyboardLayoutLength,\r
1422 OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout\r
ed66e1bc 1423 );\r
ac644614 1424\r
1425\r
1426/**\r
1427 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine\r
1428 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID\r
1429 group type. This is so that agents which are sensitive to the current keyboard layout being changed\r
1430 can be notified of this change.\r
1431\r
1432 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1433 instance.\r
1434 @param KeyGuid A pointer to the unique ID associated with a\r
1435 given keyboard layout.\r
1436\r
1437 @retval EFI_SUCCESS The current keyboard layout was successfully set.\r
1438 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so\r
1439 action was taken.\r
1440 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.\r
1441\r
1442**/\r
1443EFI_STATUS\r
1444EFIAPI\r
1445HiiSetKeyboardLayout (\r
1446 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1447 IN CONST EFI_GUID *KeyGuid\r
ed66e1bc 1448 );\r
ac644614 1449\r
1450\r
1451/**\r
1452 Return the EFI handle associated with a package list.\r
1453\r
1454 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1455 instance.\r
1456 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired\r
1457 package list in the HIIdatabase.\r
1458 @param DriverHandle On return, contains the EFI_HANDLE which was\r
1459 registered with the package list in\r
1460 NewPackageList().\r
1461\r
1462 @retval EFI_SUCCESS The DriverHandle was returned successfully.\r
1463 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or\r
1464 DriverHandle was NULL.\r
1465\r
1466**/\r
1467EFI_STATUS\r
1468EFIAPI\r
1469HiiGetPackageListHandle (\r
1470 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1471 IN EFI_HII_HANDLE PackageListHandle,\r
1472 OUT EFI_HANDLE *DriverHandle\r
ed66e1bc 1473 );\r
ac644614 1474\r
1475//\r
1476// EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces\r
1477//\r
1478\r
1479\r
1480/**\r
1481 This function allows a caller to extract the current configuration\r
1482 for one or more named elements from one or more drivers.\r
1483\r
1484 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1485 instance.\r
1486 @param Request A null-terminated Unicode string in\r
1487 <MultiConfigRequest> format.\r
1488 @param Progress On return, points to a character in the Request\r
1489 string. Points to the string's null terminator if\r
1490 request was successful. Points to the most recent\r
1491 & before the first failing name / value pair (or\r
1492 the beginning of the string if the failure is in\r
1493 the first name / value pair) if the request was\r
1494 not successful.\r
1495 @param Results Null-terminated Unicode string in\r
1496 <MultiConfigAltResp> format which has all values\r
1497 filled in for the names in the Request string.\r
1498 String to be allocated by the called function.\r
1499\r
1500 @retval EFI_SUCCESS The Results string is filled with the values\r
1501 corresponding to all requested names.\r
1502 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1503 results that must be stored awaiting possible\r
1504 future protocols.\r
1505 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.\r
1506 Progress set to the "G" in "GUID" of the\r
1507 routing header that doesn't match. Note: There\r
1508 is no requirement that all routing data\r
1509 be validated before any configuration extraction.\r
1510 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request\r
1511 parameter would result in this type of error. The\r
1512 Progress parameter is set to NULL.\r
1513 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &\r
1514 before the error or the beginning of the string.\r
1515 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the\r
1516 name in question.\r
1517\r
1518**/\r
1519EFI_STATUS\r
1520EFIAPI\r
1521HiiConfigRoutingExtractConfig (\r
1522 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1523 IN CONST EFI_STRING Request,\r
1524 OUT EFI_STRING *Progress,\r
1525 OUT EFI_STRING *Results\r
ed66e1bc 1526 );\r
ac644614 1527\r
1528\r
1529/**\r
1530 This function allows the caller to request the current configuration for the\r
1531 entirety of the current HII database and returns the data in a null-terminated Unicode string.\r
1532\r
1533 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1534 instance.\r
1535 @param Results Null-terminated Unicode string in\r
1536 <MultiConfigAltResp> format which has all values\r
1537 filled in for the names in the Request string.\r
1538 String to be allocated by the called function.\r
1539 De-allocation is up to the caller.\r
1540\r
1541 @retval EFI_SUCCESS The Results string is filled with the values\r
1542 corresponding to all requested names.\r
1543 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1544 results that must be stored awaiting possible\r
1545 future protocols.\r
1546 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results\r
1547 parameter would result in this type of error.\r
1548\r
1549**/\r
1550EFI_STATUS\r
1551EFIAPI\r
1552HiiConfigRoutingExportConfig (\r
1553 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1554 OUT EFI_STRING *Results\r
ed66e1bc 1555 );\r
ac644614 1556\r
1557\r
1558/**\r
1559 This function processes the results of processing forms and routes it to the\r
1560 appropriate handlers or storage.\r
1561\r
1562 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1563 instance.\r
1564 @param Configuration A null-terminated Unicode string in\r
1565 <MulltiConfigResp> format.\r
1566 @param Progress A pointer to a string filled in with the offset\r
1567 of the most recent & before the first failing\r
1568 name / value pair (or the beginning of the string\r
1569 if the failure is in the first name / value pair)\r
1570 or the terminating NULL if all was successful.\r
1571\r
1572 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1573 distribution.\r
1574 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1575 results that must be stored awaiting possible\r
1576 future protocols.\r
1577 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter\r
1578 would result in this type of error.\r
1579 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1580 found.\r
1581\r
1582**/\r
1583EFI_STATUS\r
1584EFIAPI\r
813acf3a 1585HiiConfigRoutingRouteConfig (\r
ac644614 1586 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1587 IN CONST EFI_STRING Configuration,\r
1588 OUT EFI_STRING *Progress\r
ed66e1bc 1589 );\r
ac644614 1590\r
1591\r
1592\r
1593/**\r
1594 This helper function is to be called by drivers to map configuration data stored\r
1595 in byte array ("block") formats such as UEFI Variables into current configuration strings.\r
1596\r
1597 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1598 instance.\r
1599 @param ConfigRequest A null-terminated Unicode string in\r
1600 <ConfigRequest> format.\r
1601 @param Block Array of bytes defining the block's\r
1602 configuration.\r
1603 @param BlockSize Length in bytes of Block.\r
1604 @param Config Filled-in configuration string. String allocated\r
1605 by the function. Returned only if call is\r
1606 successful.\r
1607 @param Progress A pointer to a string filled in with the offset\r
1608 of the most recent & before the first failing\r
1609 name/value pair (or the beginning of the string\r
1610 if the failure is in the first name / value pair)\r
1611 or the terminating NULL if all was successful.\r
1612\r
1613 @retval EFI_SUCCESS The request succeeded. Progress points to the\r
1614 null terminator at the end of the ConfigRequest\r
1615 string.\r
1616 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r
1617 Progress points to the first character of\r
1618 ConfigRequest.\r
1619 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or\r
1620 Block parameter would result in this type of\r
1621 error. Progress points to the first character of\r
1622 ConfigRequest.\r
1623 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1624 found. Progress points to the "G" in "GUID" of\r
1625 the errant routing data.\r
1626 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.\r
1627 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.\r
1628 Block is left updated and Progress points at\r
1629 the '&' preceding the first non-<BlockName>.\r
1630\r
1631**/\r
1632EFI_STATUS\r
1633EFIAPI\r
1634HiiBlockToConfig (\r
1635 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1636 IN CONST EFI_STRING ConfigRequest,\r
1637 IN CONST UINT8 *Block,\r
1638 IN CONST UINTN BlockSize,\r
1639 OUT EFI_STRING *Config,\r
1640 OUT EFI_STRING *Progress\r
ed66e1bc 1641 );\r
ac644614 1642\r
1643\r
1644/**\r
1645 This helper function is to be called by drivers to map configuration strings\r
1646 to configurations stored in byte array ("block") formats such as UEFI Variables.\r
1647\r
1648 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1649 instance.\r
1650 @param ConfigResp A null-terminated Unicode string in <ConfigResp>\r
1651 format.\r
1652 @param Block A possibly null array of bytes representing the\r
1653 current block. Only bytes referenced in the\r
1654 ConfigResp string in the block are modified. If\r
1655 this parameter is null or if the *BlockSize\r
1656 parameter is (on input) shorter than required by\r
1657 the Configuration string, only the BlockSize\r
1658 parameter is updated and an appropriate status\r
1659 (see below) is returned.\r
1660 @param BlockSize The length of the Block in units of UINT8. On\r
1661 input, this is the size of the Block. On output,\r
1662 if successful, contains the index of the last\r
1663 modified byte in the Block.\r
1664 @param Progress On return, points to an element of the ConfigResp\r
1665 string filled in with the offset of the most\r
1666 recent '&' before the first failing name / value\r
1667 pair (or the beginning of the string if the\r
1668 failure is in the first name / value pair) or\r
1669 the terminating NULL if all was successful.\r
1670\r
1671 @retval EFI_SUCCESS The request succeeded. Progress points to the\r
1672 null terminator at the end of the ConfigResp\r
1673 string.\r
1674 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r
1675 Progress points to the first character of\r
1676 ConfigResp.\r
1677 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or\r
1678 Block parameter would result in this type of\r
1679 error. Progress points to the first character of\r
1680 ConfigResp.\r
1681 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1682 found. Progress points to the "G" in "GUID" of\r
1683 the errant routing data.\r
1684 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /\r
1685 value pair. Block is left updated and\r
1686 Progress points at the '&' preceding the first\r
1687 non-<BlockName>.\r
1688\r
1689**/\r
1690EFI_STATUS\r
1691EFIAPI\r
1692HiiConfigToBlock (\r
1693 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1694 IN CONST EFI_STRING ConfigResp,\r
1695 IN OUT UINT8 *Block,\r
1696 IN OUT UINTN *BlockSize,\r
1697 OUT EFI_STRING *Progress\r
ed66e1bc 1698 );\r
ac644614 1699\r
1700\r
1701/**\r
1702 This helper function is to be called by drivers to extract portions of\r
1703 a larger configuration string.\r
1704\r
1705 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1706 instance.\r
1707 @param Configuration A null-terminated Unicode string in\r
1708 <MultiConfigAltResp> format.\r
1709 @param Guid A pointer to the GUID value to search for in the\r
1710 routing portion of the ConfigResp string when\r
1711 retrieving the requested data. If Guid is NULL,\r
1712 then all GUID values will be searched for.\r
1713 @param Name A pointer to the NAME value to search for in the\r
1714 routing portion of the ConfigResp string when\r
1715 retrieving the requested data. If Name is NULL,\r
1716 then all Name values will be searched for.\r
1717 @param DevicePath A pointer to the PATH value to search for in the\r
1718 routing portion of the ConfigResp string when\r
1719 retrieving the requested data. If DevicePath is\r
1720 NULL, then all DevicePath values will be\r
1721 searched for.\r
1722 @param AltCfgId A pointer to the ALTCFG value to search for in\r
1723 the routing portion of the ConfigResp string\r
1724 when retrieving the requested data. If this\r
1725 parameter is NULL, then the current setting will\r
1726 be retrieved.\r
1727 @param AltCfgResp A pointer to a buffer which will be allocated by\r
1728 the function which contains the retrieved string\r
1729 as requested. This buffer is only allocated if\r
1730 the call was successful.\r
1731\r
1732 @retval EFI_SUCCESS The request succeeded. The requested data was\r
1733 extracted and placed in the newly allocated\r
1734 AltCfgResp buffer.\r
1735 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.\r
1736 @retval EFI_INVALID_PARAMETER Any parameter is invalid.\r
1737 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1738 found.\r
1739\r
1740**/\r
1741EFI_STATUS\r
1742EFIAPI\r
1743HiiGetAltCfg (\r
1744 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1745 IN CONST EFI_STRING Configuration,\r
1746 IN CONST EFI_GUID *Guid,\r
1747 IN CONST EFI_STRING Name,\r
1748 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
1749 IN CONST UINT16 *AltCfgId,\r
1750 OUT EFI_STRING *AltCfgResp\r
ed66e1bc 1751 );\r
ac644614 1752\r
f324bf4d 1753\r
1754/**\r
1755 Compare whether two names of languages are identical.\r
1756\r
b0bdc7ba
LG
1757 @param Language1 Name of language 1 from StringPackage\r
1758 @param Language2 Name of language 2 to be compared with language 1.\r
f324bf4d 1759\r
1760 @retval TRUE same\r
1761 @retval FALSE not same\r
1762\r
1763**/\r
1764BOOLEAN\r
1765HiiCompareLanguage (\r
1766 IN CHAR8 *Language1,\r
1767 IN CHAR8 *Language2\r
1768 )\r
1769;\r
1770\r
ac644614 1771//\r
1772// Global variables\r
1773//\r
1774extern EFI_EVENT gHiiKeyboardLayoutChanged;\r
ac644614 1775#endif\r