]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
don't set all bytes in TargetID as zero. This change is made due to keep consistent...
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabase.h
CommitLineData
ac644614 1/** @file\r
e90b081a 2Private structures definitions in HiiDatabase.\r
ac644614 3\r
9937b365 4Copyright (c) 2007 - 2009, Intel Corporation\r
ac644614 5All rights reserved. This 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
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\r
46#define HII_DATABASE_NOTIFY_GUID \\r
47 { \\r
48 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \\r
49 }\r
50\r
51#define MAX_STRING_LENGTH 1024\r
52#define MAX_FONT_NAME_LEN 256\r
53#define NARROW_BASELINE 15\r
54#define WIDE_BASELINE 14\r
55#define SYS_FONT_INFO_MASK 0x37\r
56#define REPLACE_UNKNOWN_GLYPH 0xFFFD\r
57#define PROPORTIONAL_GLYPH 0x80\r
58#define NARROW_GLYPH 0x40\r
59\r
60#define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))\r
61#define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))\r
62#define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))\r
63#define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)\r
64\r
84f9a9ec
LG
65//\r
66// IFR data structure\r
67//\r
68// BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.\r
69\r
70typedef struct {\r
71 LIST_ENTRY Entry; // Link to VarStorage\r
72 EFI_GUID Guid;\r
73 CHAR16 *Name;\r
74 EFI_VARSTORE_ID VarStoreId;\r
75 UINT16 Size;\r
76 LIST_ENTRY BlockEntry; // Link to its Block array\r
77} IFR_VARSTORAGE_DATA;\r
78\r
79typedef struct {\r
80 LIST_ENTRY Entry; // Link to Block array\r
81 UINT16 Offset;\r
82 UINT16 Width;\r
83 EFI_QUESTION_ID QuestionId;\r
84 UINT8 OpCode;\r
85 UINT8 Scope;\r
86 LIST_ENTRY DefaultValueEntry; // Link to its default value array\r
87} IFR_BLOCK_DATA;\r
88\r
89typedef struct {\r
90 LIST_ENTRY Entry;\r
91 EFI_STRING_ID DefaultName;\r
92 UINT16 DefaultId;\r
93 UINT64 Value;\r
94} IFR_DEFAULT_DATA;\r
95\r
ac644614 96//\r
97// Storage types\r
98//\r
99#define EFI_HII_VARSTORE_BUFFER 0\r
100#define EFI_HII_VARSTORE_NAME_VALUE 1\r
101#define EFI_HII_VARSTORE_EFI_VARIABLE 2\r
102\r
f3f2e05d 103#define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')\r
ac644614 104typedef struct {\r
105 UINTN Signature;\r
106 LIST_ENTRY Entry;\r
107\r
108 EFI_HII_HANDLE HiiHandle;\r
109 EFI_HANDLE DriverHandle;\r
110\r
111 UINT8 Type; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE\r
112 EFI_GUID Guid;\r
113 CHAR16 *Name;\r
114 UINT16 Size;\r
115} HII_FORMSET_STORAGE;\r
116\r
ac644614 117\r
118//\r
119// String Package definitions\r
120//\r
f3f2e05d 121#define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')\r
ac644614 122typedef struct _HII_STRING_PACKAGE_INSTANCE {\r
123 UINTN Signature;\r
124 EFI_HII_STRING_PACKAGE_HDR *StringPkgHdr;\r
125 UINT8 *StringBlock;\r
126 LIST_ENTRY StringEntry;\r
127 LIST_ENTRY FontInfoList; // local font info list\r
128 UINT8 FontId;\r
129} HII_STRING_PACKAGE_INSTANCE;\r
130\r
131//\r
132// Form Package definitions\r
133//\r
f3f2e05d 134#define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')\r
ac644614 135typedef struct _HII_IFR_PACKAGE_INSTANCE {\r
136 UINTN Signature;\r
137 EFI_HII_PACKAGE_HEADER FormPkgHdr;\r
138 UINT8 *IfrData;\r
139 LIST_ENTRY IfrEntry;\r
140} HII_IFR_PACKAGE_INSTANCE;\r
141\r
142//\r
143// Simple Font Package definitions\r
144//\r
f3f2e05d 145#define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')\r
ac644614 146typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {\r
147 UINTN Signature;\r
148 EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimpleFontPkgHdr;\r
149 LIST_ENTRY SimpleFontEntry;\r
150} HII_SIMPLE_FONT_PACKAGE_INSTANCE;\r
151\r
152//\r
153// Font Package definitions\r
154//\r
f3f2e05d 155#define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')\r
ac644614 156typedef struct _HII_FONT_PACKAGE_INSTANCE {\r
157 UINTN Signature;\r
158 EFI_HII_FONT_PACKAGE_HDR *FontPkgHdr;\r
159 UINT8 *GlyphBlock;\r
160 LIST_ENTRY FontEntry;\r
161 LIST_ENTRY GlyphInfoList;\r
162} HII_FONT_PACKAGE_INSTANCE;\r
163\r
f3f2e05d 164#define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')\r
ac644614 165typedef struct _HII_GLYPH_INFO {\r
166 UINTN Signature;\r
167 LIST_ENTRY Entry;\r
168 CHAR16 CharId;\r
169 EFI_HII_GLYPH_INFO Cell;\r
170} HII_GLYPH_INFO;\r
171\r
f3f2e05d 172#define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')\r
ac644614 173typedef struct _HII_FONT_INFO {\r
174 UINTN Signature;\r
175 LIST_ENTRY Entry;\r
176 LIST_ENTRY *GlobalEntry;\r
177 UINT8 FontId;\r
178} HII_FONT_INFO;\r
179\r
f3f2e05d 180#define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')\r
ac644614 181typedef struct _HII_GLOBAL_FONT_INFO {\r
182 UINTN Signature;\r
183 LIST_ENTRY Entry;\r
184 HII_FONT_PACKAGE_INSTANCE *FontPackage;\r
185 UINTN FontInfoSize;\r
186 EFI_FONT_INFO *FontInfo;\r
187} HII_GLOBAL_FONT_INFO;\r
188\r
189//\r
190// Image Package definitions\r
191//\r
192\r
193#define HII_PIXEL_MASK 0x80\r
194\r
195typedef struct _HII_IMAGE_PACKAGE_INSTANCE {\r
196 EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr;\r
197 UINT32 ImageBlockSize;\r
198 UINT32 PaletteInfoSize;\r
199 UINT8 *ImageBlock;\r
200 UINT8 *PaletteBlock;\r
201} HII_IMAGE_PACKAGE_INSTANCE;\r
202\r
203//\r
204// Keyboard Layout Pacakge definitions\r
205//\r
f3f2e05d 206#define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')\r
ac644614 207typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {\r
208 UINTN Signature;\r
209 UINT8 *KeyboardPkg;\r
210 LIST_ENTRY KeyboardEntry;\r
211} HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE;\r
212\r
213//\r
214// Guid Package definitions\r
215//\r
f3f2e05d 216#define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')\r
ac644614 217typedef struct _HII_GUID_PACKAGE_INSTANCE {\r
218 UINTN Signature;\r
219 UINT8 *GuidPkg;\r
220 LIST_ENTRY GuidEntry;\r
221} HII_GUID_PACKAGE_INSTANCE;\r
222\r
223//\r
224// A package list can contain only one or less than one device path package.\r
225// This rule also applies to image package since ImageId can not be duplicate.\r
226//\r
227typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE {\r
228 EFI_HII_PACKAGE_LIST_HEADER PackageListHdr;\r
229 LIST_ENTRY GuidPkgHdr;\r
230 LIST_ENTRY FormPkgHdr;\r
231 LIST_ENTRY KeyboardLayoutHdr;\r
232 LIST_ENTRY StringPkgHdr;\r
233 LIST_ENTRY FontPkgHdr;\r
234 HII_IMAGE_PACKAGE_INSTANCE *ImagePkg;\r
235 LIST_ENTRY SimpleFontPkgHdr;\r
236 UINT8 *DevicePathPkg;\r
237} HII_DATABASE_PACKAGE_LIST_INSTANCE;\r
238\r
f3f2e05d 239#define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')\r
ac644614 240\r
241typedef struct {\r
242 UINTN Signature;\r
243 LIST_ENTRY Handle;\r
244 UINTN Key;\r
245} HII_HANDLE;\r
246\r
f3f2e05d 247#define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')\r
ac644614 248\r
249typedef struct _HII_DATABASE_RECORD {\r
250 UINTN Signature;\r
251 HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList;\r
252 EFI_HANDLE DriverHandle;\r
253 EFI_HII_HANDLE Handle;\r
254 LIST_ENTRY DatabaseEntry;\r
255} HII_DATABASE_RECORD;\r
256\r
f3f2e05d 257#define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')\r
ac644614 258\r
259typedef struct _HII_DATABASE_NOTIFY {\r
260 UINTN Signature;\r
261 EFI_HANDLE NotifyHandle;\r
262 UINT8 PackageType;\r
263 EFI_GUID *PackageGuid;\r
264 EFI_HII_DATABASE_NOTIFY PackageNotifyFn;\r
265 EFI_HII_DATABASE_NOTIFY_TYPE NotifyType;\r
266 LIST_ENTRY DatabaseNotifyEntry;\r
267} HII_DATABASE_NOTIFY;\r
268\r
f3f2e05d 269#define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')\r
ac644614 270\r
271typedef struct _HII_DATABASE_PRIVATE_DATA {\r
272 UINTN Signature;\r
273 LIST_ENTRY DatabaseList;\r
274 LIST_ENTRY DatabaseNotifyList;\r
275 EFI_HII_FONT_PROTOCOL HiiFont;\r
ac644614 276 EFI_HII_IMAGE_PROTOCOL HiiImage;\r
ac644614 277 EFI_HII_STRING_PROTOCOL HiiString;\r
278 EFI_HII_DATABASE_PROTOCOL HiiDatabase;\r
279 EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting;\r
280 LIST_ENTRY HiiHandleList;\r
281 INTN HiiHandleCount;\r
282 LIST_ENTRY FontInfoList; // global font info list\r
283 UINTN Attribute; // default system color\r
284 EFI_GUID CurrentLayoutGuid;\r
285 EFI_HII_KEYBOARD_LAYOUT *CurrentLayout;\r
286} HII_DATABASE_PRIVATE_DATA;\r
287\r
288#define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
289 CR (a, \\r
290 HII_DATABASE_PRIVATE_DATA, \\r
291 HiiFont, \\r
292 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
293 )\r
294\r
295#define HII_IMAGE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
296 CR (a, \\r
297 HII_DATABASE_PRIVATE_DATA, \\r
298 HiiImage, \\r
299 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
300 )\r
301\r
302#define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
303 CR (a, \\r
304 HII_DATABASE_PRIVATE_DATA, \\r
305 HiiString, \\r
306 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
307 )\r
308\r
309#define HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
310 CR (a, \\r
311 HII_DATABASE_PRIVATE_DATA, \\r
312 HiiDatabase, \\r
313 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
314 )\r
315\r
316#define CONFIG_ROUTING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
317 CR (a, \\r
318 HII_DATABASE_PRIVATE_DATA, \\r
319 ConfigRouting, \\r
320 HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
321 )\r
322\r
323//\r
324// Internal function prototypes.\r
325//\r
326\r
327/**\r
e90b081a 328 This function checks whether a handle is a valid EFI_HII_HANDLE.\r
ac644614 329\r
330 @param Handle Pointer to a EFI_HII_HANDLE\r
331\r
332 @retval TRUE Valid\r
333 @retval FALSE Invalid\r
334\r
335**/\r
336BOOLEAN\r
337IsHiiHandleValid (\r
338 EFI_HII_HANDLE Handle\r
ed66e1bc 339 );\r
ac644614 340\r
341\r
342/**\r
343 This function checks whether EFI_FONT_INFO exists in current database. If\r
344 FontInfoMask is specified, check what options can be used to make a match.\r
345 Note that the masks relate to where the system default should be supplied\r
346 are ignored by this function.\r
347\r
348 @param Private Hii database private structure.\r
349 @param FontInfo Points to EFI_FONT_INFO structure.\r
350 @param FontInfoMask If not NULL, describes what options can be used\r
351 to make a match between the font requested and\r
352 the font available. The caller must guarantee\r
353 this mask is valid.\r
354 @param FontHandle On entry, Points to the font handle returned by a\r
355 previous call to GetFontInfo() or NULL to start\r
356 with the first font.\r
357 @param GlobalFontInfo If not NULL, output the corresponding globa font\r
358 info.\r
359\r
360 @retval TRUE Existed\r
361 @retval FALSE Not existed\r
362\r
363**/\r
364BOOLEAN\r
365IsFontInfoExisted (\r
366 IN HII_DATABASE_PRIVATE_DATA *Private,\r
367 IN EFI_FONT_INFO *FontInfo,\r
368 IN EFI_FONT_INFO_MASK *FontInfoMask, OPTIONAL\r
369 IN EFI_FONT_HANDLE FontHandle, OPTIONAL\r
370 OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo OPTIONAL\r
ed66e1bc 371 );\r
ac644614 372\r
8d00a0f1 373/**\r
374\r
375 This function invokes the matching registered function.\r
376 \r
377 @param Private HII Database driver private structure.\r
378 @param NotifyType The type of change concerning the database.\r
379 @param PackageInstance Points to the package referred to by the notification.\r
380 @param PackageType Package type\r
381 @param Handle The handle of the package list which contains the specified package.\r
382 \r
383 @retval EFI_SUCCESS Already checked all registered function and invoked \r
384 if matched.\r
385 @retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
386 \r
387**/\r
388EFI_STATUS\r
389InvokeRegisteredFunction (\r
390 IN HII_DATABASE_PRIVATE_DATA *Private, \r
391 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
392 IN VOID *PackageInstance,\r
393 IN UINT8 PackageType,\r
394 IN EFI_HII_HANDLE Handle\r
395 )\r
396;\r
ac644614 397\r
398/**\r
399 Retrieve system default font and color.\r
400\r
401 @param Private HII database driver private data.\r
402 @param FontInfo Points to system default font output-related\r
403 information. It's caller's responsibility to free\r
404 this buffer.\r
405 @param FontInfoSize If not NULL, output the size of buffer FontInfo.\r
406\r
407 @retval EFI_SUCCESS Cell information is added to the GlyphInfoList.\r
408 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
409 task.\r
410 @retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
411\r
412**/\r
413EFI_STATUS\r
414GetSystemFont (\r
415 IN HII_DATABASE_PRIVATE_DATA *Private,\r
416 OUT EFI_FONT_DISPLAY_INFO **FontInfo,\r
417 OUT UINTN *FontInfoSize OPTIONAL\r
ed66e1bc 418 );\r
ac644614 419\r
420\r
421/**\r
422 Parse all string blocks to find a String block specified by StringId.\r
423 If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
424 within this string package and backup its information.\r
425 If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).\r
426\r
427 @param Private Hii database private structure.\r
428 @param StringPackage Hii string package instance.\r
429 @param StringId The string's id, which is unique within\r
430 PackageList.\r
431 @param BlockType Output the block type of found string block.\r
432 @param StringBlockAddr Output the block address of found string block.\r
433 @param StringTextOffset Offset, relative to the found block address, of\r
434 the string text information.\r
435 @param LastStringId Output the last string id when StringId = 0.\r
436\r
437 @retval EFI_SUCCESS The string text and font is retrieved\r
438 successfully.\r
439 @retval EFI_NOT_FOUND The specified text or font info can not be found\r
440 out.\r
441 @retval EFI_OUT_OF_RESOURCES The system is out of resources to accomplish the\r
442 task.\r
443\r
444**/\r
445EFI_STATUS\r
446FindStringBlock (\r
447 IN HII_DATABASE_PRIVATE_DATA *Private,\r
448 IN HII_STRING_PACKAGE_INSTANCE *StringPackage,\r
449 IN EFI_STRING_ID StringId,\r
450 OUT UINT8 *BlockType, OPTIONAL\r
451 OUT UINT8 **StringBlockAddr, OPTIONAL\r
452 OUT UINTN *StringTextOffset, OPTIONAL\r
453 OUT EFI_STRING_ID *LastStringId 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
1057 @param Languages Points to the buffer to hold the returned string.\r
1058 @param LanguagesSize On entry, points to the size of the buffer\r
1059 pointed to by Languages, in bytes. On return,\r
1060 points to the length of Languages, in bytes.\r
1061\r
1062 @retval EFI_SUCCESS The languages were returned successfully.\r
1063 @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.\r
1064 @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list\r
1065 of supported languages. LanguageSize is updated\r
1066 to contain the required size.\r
1067 @retval EFI_NOT_FOUND Could not find string package in specified\r
1068 packagelist.\r
1069\r
1070**/\r
1071EFI_STATUS\r
1072EFIAPI\r
1073HiiGetLanguages (\r
1074 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1075 IN EFI_HII_HANDLE PackageList,\r
1076 IN OUT CHAR8 *Languages,\r
1077 IN OUT UINTN *LanguagesSize\r
ed66e1bc 1078 );\r
ac644614 1079\r
1080\r
1081/**\r
1082 Each string package has associated with it a single primary language and zero\r
1083 or more secondary languages. This routine returns the secondary languages\r
1084 associated with a package list.\r
1085\r
1086 @param This A pointer to the EFI_HII_STRING_PROTOCOL\r
1087 instance.\r
1088 @param PackageList The package list to examine.\r
1089 @param FirstLanguage Points to the primary language.\r
1090 @param SecondaryLanguages Points to the buffer to hold the returned list of\r
1091 secondary languages for the specified\r
1092 FirstLanguage. If there are no secondary\r
1093 languages, the function returns successfully,\r
1094 but this is set to NULL.\r
e90b081a 1095 @param SecondaryLanguagesSize On entry, points to the size of the buffer\r
ac644614 1096 pointed to by SecondLanguages, in bytes. On\r
1097 return, points to the length of SecondLanguages\r
1098 in bytes.\r
1099\r
1100 @retval EFI_SUCCESS Secondary languages were correctly returned.\r
1101 @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or\r
1102 SecondLanguagesSize was NULL.\r
1103 @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is\r
1104 too small to hold the returned information.\r
1105 SecondLanguageSize is updated to hold the size of\r
1106 the buffer required.\r
813acf3a 1107 @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not\r
ac644614 1108 present in the specified package list.\r
813acf3a 1109 @retval EFI_NOT_FOUND The specified PackageList is not in the Database. \r
ac644614 1110\r
1111**/\r
1112EFI_STATUS\r
1113EFIAPI\r
1114HiiGetSecondaryLanguages (\r
1115 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
1116 IN EFI_HII_HANDLE PackageList,\r
1117 IN CONST CHAR8 *FirstLanguage,\r
e90b081a 1118 IN OUT CHAR8 *SecondaryLanguages,\r
1119 IN OUT UINTN *SecondaryLanguagesSize\r
ed66e1bc 1120 );\r
ac644614 1121\r
1122//\r
1123// EFI_HII_DATABASE_PROTOCOL protocol interfaces\r
1124//\r
1125\r
1126\r
1127/**\r
1128 This function adds the packages in the package list to the database and returns a handle. If there is a\r
1129 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will\r
1130 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list.\r
1131\r
1132 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1133 instance.\r
1134 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
1135 structure.\r
1136 @param DriverHandle Associate the package list with this EFI handle.\r
1137 @param Handle A pointer to the EFI_HII_HANDLE instance.\r
1138\r
1139 @retval EFI_SUCCESS The package list associated with the Handle was\r
1140 added to the HII database.\r
1141 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the\r
1142 new database contents.\r
1143 @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.\r
1144\r
1145**/\r
1146EFI_STATUS\r
1147EFIAPI\r
1148HiiNewPackageList (\r
1149 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1150 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,\r
1151 IN CONST EFI_HANDLE DriverHandle,\r
1152 OUT EFI_HII_HANDLE *Handle\r
ed66e1bc 1153 );\r
ac644614 1154\r
1155\r
1156/**\r
1157 This function removes the package list that is associated with a handle Handle\r
1158 from the HII database. Before removing the package, any registered functions\r
1159 with the notification type REMOVE_PACK and the same package type will be called.\r
1160\r
1161 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1162 instance.\r
1163 @param Handle The handle that was registered to the data that\r
1164 is requested for removal.\r
1165\r
1166 @retval EFI_SUCCESS The data associated with the Handle was removed\r
1167 from the HII database.\r
813acf3a 1168 @retval EFI_NOT_FOUND The specified Handle is not in database.\r
ac644614 1169\r
1170**/\r
1171EFI_STATUS\r
1172EFIAPI\r
1173HiiRemovePackageList (\r
1174 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1175 IN EFI_HII_HANDLE Handle\r
ed66e1bc 1176 );\r
ac644614 1177\r
1178\r
1179/**\r
1180 This function updates the existing package list (which has the specified Handle)\r
1181 in the HII databases, using the new package list specified by PackageList.\r
1182\r
1183 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1184 instance.\r
1185 @param Handle The handle that was registered to the data that\r
1186 is requested to be updated.\r
1187 @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
1188 package.\r
1189\r
1190 @retval EFI_SUCCESS The HII database was successfully updated.\r
1191 @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated\r
1192 database.\r
813acf3a 1193 @retval EFI_INVALID_PARAMETER PackageList was NULL.\r
1194 @retval EFI_NOT_FOUND The specified Handle is not in database.\r
ac644614 1195\r
1196**/\r
1197EFI_STATUS\r
1198EFIAPI\r
1199HiiUpdatePackageList (\r
1200 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1201 IN EFI_HII_HANDLE Handle,\r
1202 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList\r
ed66e1bc 1203 );\r
ac644614 1204\r
1205\r
1206/**\r
1207 This function returns a list of the package handles of the specified type\r
1208 that are currently active in the database. The pseudo-type\r
1209 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.\r
1210\r
1211 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1212 instance.\r
1213 @param PackageType Specifies the package type of the packages to\r
1214 list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r
1215 to be listed.\r
1216 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r
1217 this is the pointer to the GUID which must match\r
1218 the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.\r
1219 Otherwise, it must be NULL.\r
1220 @param HandleBufferLength On input, a pointer to the length of the handle\r
1221 buffer. On output, the length of the handle\r
1222 buffer that is required for the handles found.\r
1223 @param Handle An array of EFI_HII_HANDLE instances returned.\r
1224\r
1225 @retval EFI_SUCCESS The matching handles are outputed successfully.\r
813acf3a 1226 HandleBufferLength is updated with the actual length.\r
ac644614 1227 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
1228 Handle is too small to support the number of\r
1229 handles. HandleBufferLength is updated with a\r
1230 value that will enable the data to fit.\r
1231 @retval EFI_NOT_FOUND No matching handle could not be found in\r
1232 database.\r
1233 @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.\r
813acf3a 1234 @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
1235 PackageGuid is not NULL, PackageType is a EFI_HII_\r
1236 PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
1237 \r
ac644614 1238\r
1239**/\r
1240EFI_STATUS\r
1241EFIAPI\r
1242HiiListPackageLists (\r
1243 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1244 IN UINT8 PackageType,\r
1245 IN CONST EFI_GUID *PackageGuid,\r
1246 IN OUT UINTN *HandleBufferLength,\r
1247 OUT EFI_HII_HANDLE *Handle\r
ed66e1bc 1248 );\r
ac644614 1249\r
1250\r
1251/**\r
1252 This function will export one or all package lists in the database to a buffer.\r
1253 For each package list exported, this function will call functions registered\r
1254 with EXPORT_PACK and then copy the package list to the buffer.\r
1255\r
1256 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1257 instance.\r
1258 @param Handle An EFI_HII_HANDLE that corresponds to the desired\r
1259 package list in the HII database to export or\r
1260 NULL to indicate all package lists should be\r
1261 exported.\r
1262 @param BufferSize On input, a pointer to the length of the buffer.\r
1263 On output, the length of the buffer that is\r
1264 required for the exported data.\r
1265 @param Buffer A pointer to a buffer that will contain the\r
1266 results of the export function.\r
1267\r
1268 @retval EFI_SUCCESS Package exported.\r
1269 @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
1270 Handle is too small to support the number of\r
1271 handles. HandleBufferLength is updated with\r
1272 a value that will enable the data to fit.\r
1273 @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the\r
1274 current database.\r
1275 @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.\r
1276\r
1277**/\r
1278EFI_STATUS\r
1279EFIAPI\r
1280HiiExportPackageLists (\r
1281 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1282 IN EFI_HII_HANDLE Handle,\r
1283 IN OUT UINTN *BufferSize,\r
1284 OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer\r
ed66e1bc 1285 );\r
ac644614 1286\r
1287\r
1288/**\r
1289 This function registers a function which will be called when specified actions related to packages of\r
1290 the specified type occur in the HII database. By registering a function, other HII-related drivers are\r
1291 notified when specific package types are added, removed or updated in the HII database.\r
1292 Each driver or application which registers a notification should use\r
1293 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.\r
1294\r
1295 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1296 instance.\r
1297 @param PackageType Specifies the package type of the packages to\r
1298 list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r
1299 to be listed.\r
1300 @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r
1301 this is the pointer to the GUID which must match\r
1302 the Guid field of\r
1303 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must\r
1304 be NULL.\r
1305 @param PackageNotifyFn Points to the function to be called when the\r
1306 event specified by\r
1307 NotificationType occurs.\r
1308 @param NotifyType Describes the types of notification which this\r
1309 function will be receiving.\r
1310 @param NotifyHandle Points to the unique handle assigned to the\r
1311 registered notification. Can be used in\r
1312 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()\r
1313 to stop notifications.\r
1314\r
1315 @retval EFI_SUCCESS Notification registered successfully.\r
1316 @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures\r
1317 @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.\r
1318 @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not\r
1319 EFI_HII_PACKAGE_TYPE_GUID.\r
1320 @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is\r
1321 EFI_HII_PACKAGE_TYPE_GUID.\r
1322\r
1323**/\r
1324EFI_STATUS\r
1325EFIAPI\r
1326HiiRegisterPackageNotify (\r
1327 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1328 IN UINT8 PackageType,\r
1329 IN CONST EFI_GUID *PackageGuid,\r
1330 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,\r
1331 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
1332 OUT EFI_HANDLE *NotifyHandle\r
ed66e1bc 1333 );\r
ac644614 1334\r
1335\r
1336/**\r
1337 Removes the specified HII database package-related notification.\r
1338\r
1339 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1340 instance.\r
e90b081a 1341 @param NotificationHandle The handle of the notification function being\r
ac644614 1342 unregistered.\r
1343\r
1344 @retval EFI_SUCCESS Notification is unregistered successfully.\r
813acf3a 1345 @retval EFI_NOT_FOUND The incoming notification handle does not exist \r
1346 in current hii database.\r
ac644614 1347\r
1348**/\r
1349EFI_STATUS\r
1350EFIAPI\r
1351HiiUnregisterPackageNotify (\r
1352 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1353 IN EFI_HANDLE NotificationHandle\r
ed66e1bc 1354 );\r
ac644614 1355\r
1356\r
1357/**\r
1358 This routine retrieves an array of GUID values for each keyboard layout that\r
1359 was previously registered in the system.\r
1360\r
1361 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1362 instance.\r
1363 @param KeyGuidBufferLength On input, a pointer to the length of the keyboard\r
1364 GUID buffer. On output, the length of the handle\r
1365 buffer that is required for the handles found.\r
1366 @param KeyGuidBuffer An array of keyboard layout GUID instances\r
1367 returned.\r
1368\r
1369 @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.\r
1370 @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates\r
1371 that KeyGuidBuffer is too small to support the\r
1372 number of GUIDs. KeyGuidBufferLength is\r
1373 updated with a value that will enable the data to\r
1374 fit.\r
1375 @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was\r
1376 NULL.\r
1377 @retval EFI_NOT_FOUND There was no keyboard layout.\r
1378\r
1379**/\r
1380EFI_STATUS\r
1381EFIAPI\r
1382HiiFindKeyboardLayouts (\r
1383 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1384 IN OUT UINT16 *KeyGuidBufferLength,\r
1385 OUT EFI_GUID *KeyGuidBuffer\r
ed66e1bc 1386 );\r
ac644614 1387\r
1388\r
1389/**\r
1390 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys\r
1391 on a keyboard and the character(s) that are associated with a particular set of key strokes.\r
1392\r
1393 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1394 instance.\r
1395 @param KeyGuid A pointer to the unique ID associated with a\r
1396 given keyboard layout. If KeyGuid is NULL then\r
1397 the current layout will be retrieved.\r
1398 @param KeyboardLayoutLength On input, a pointer to the length of the\r
1399 KeyboardLayout buffer. On output, the length of\r
1400 the data placed into KeyboardLayout.\r
1401 @param KeyboardLayout A pointer to a buffer containing the retrieved\r
1402 keyboard layout.\r
1403\r
1404 @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r
1405 @retval EFI_NOT_FOUND The requested keyboard layout was not found.\r
1406 @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was\r
1407 NULL.\r
1408\r
1409**/\r
1410EFI_STATUS\r
1411EFIAPI\r
1412HiiGetKeyboardLayout (\r
1413 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1414 IN CONST EFI_GUID *KeyGuid,\r
1415 IN OUT UINT16 *KeyboardLayoutLength,\r
1416 OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout\r
ed66e1bc 1417 );\r
ac644614 1418\r
1419\r
1420/**\r
1421 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine\r
1422 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID\r
1423 group type. This is so that agents which are sensitive to the current keyboard layout being changed\r
1424 can be notified of this change.\r
1425\r
1426 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1427 instance.\r
1428 @param KeyGuid A pointer to the unique ID associated with a\r
1429 given keyboard layout.\r
1430\r
1431 @retval EFI_SUCCESS The current keyboard layout was successfully set.\r
1432 @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so\r
1433 action was taken.\r
1434 @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.\r
1435\r
1436**/\r
1437EFI_STATUS\r
1438EFIAPI\r
1439HiiSetKeyboardLayout (\r
1440 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1441 IN CONST EFI_GUID *KeyGuid\r
ed66e1bc 1442 );\r
ac644614 1443\r
1444\r
1445/**\r
1446 Return the EFI handle associated with a package list.\r
1447\r
1448 @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
1449 instance.\r
1450 @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired\r
1451 package list in the HIIdatabase.\r
1452 @param DriverHandle On return, contains the EFI_HANDLE which was\r
1453 registered with the package list in\r
1454 NewPackageList().\r
1455\r
1456 @retval EFI_SUCCESS The DriverHandle was returned successfully.\r
1457 @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or\r
1458 DriverHandle was NULL.\r
1459\r
1460**/\r
1461EFI_STATUS\r
1462EFIAPI\r
1463HiiGetPackageListHandle (\r
1464 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
1465 IN EFI_HII_HANDLE PackageListHandle,\r
1466 OUT EFI_HANDLE *DriverHandle\r
ed66e1bc 1467 );\r
ac644614 1468\r
1469//\r
1470// EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces\r
1471//\r
1472\r
1473\r
1474/**\r
1475 This function allows a caller to extract the current configuration\r
1476 for one or more named elements from one or more drivers.\r
1477\r
1478 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1479 instance.\r
1480 @param Request A null-terminated Unicode string in\r
1481 <MultiConfigRequest> format.\r
1482 @param Progress On return, points to a character in the Request\r
1483 string. Points to the string's null terminator if\r
1484 request was successful. Points to the most recent\r
1485 & before the first failing name / value pair (or\r
1486 the beginning of the string if the failure is in\r
1487 the first name / value pair) if the request was\r
1488 not successful.\r
1489 @param Results Null-terminated Unicode string in\r
1490 <MultiConfigAltResp> format which has all values\r
1491 filled in for the names in the Request string.\r
1492 String to be allocated by the called function.\r
1493\r
1494 @retval EFI_SUCCESS The Results string is filled with the values\r
1495 corresponding to all requested names.\r
1496 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1497 results that must be stored awaiting possible\r
1498 future protocols.\r
1499 @retval EFI_NOT_FOUND Routing data doesn't match any known driver.\r
1500 Progress set to the "G" in "GUID" of the\r
1501 routing header that doesn't match. Note: There\r
1502 is no requirement that all routing data\r
1503 be validated before any configuration extraction.\r
1504 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request\r
1505 parameter would result in this type of error. The\r
1506 Progress parameter is set to NULL.\r
1507 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &\r
1508 before the error or the beginning of the string.\r
1509 @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the\r
1510 name in question.\r
1511\r
1512**/\r
1513EFI_STATUS\r
1514EFIAPI\r
1515HiiConfigRoutingExtractConfig (\r
1516 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1517 IN CONST EFI_STRING Request,\r
1518 OUT EFI_STRING *Progress,\r
1519 OUT EFI_STRING *Results\r
ed66e1bc 1520 );\r
ac644614 1521\r
1522\r
1523/**\r
1524 This function allows the caller to request the current configuration for the\r
1525 entirety of the current HII database and returns the data in a null-terminated Unicode string.\r
1526\r
1527 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1528 instance.\r
1529 @param Results Null-terminated Unicode string in\r
1530 <MultiConfigAltResp> format which has all values\r
1531 filled in for the names in the Request string.\r
1532 String to be allocated by the called function.\r
1533 De-allocation is up to the caller.\r
1534\r
1535 @retval EFI_SUCCESS The Results string is filled with the values\r
1536 corresponding to all requested names.\r
1537 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1538 results that must be stored awaiting possible\r
1539 future protocols.\r
1540 @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results\r
1541 parameter would result in this type of error.\r
1542\r
1543**/\r
1544EFI_STATUS\r
1545EFIAPI\r
1546HiiConfigRoutingExportConfig (\r
1547 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1548 OUT EFI_STRING *Results\r
ed66e1bc 1549 );\r
ac644614 1550\r
1551\r
1552/**\r
1553 This function processes the results of processing forms and routes it to the\r
1554 appropriate handlers or storage.\r
1555\r
1556 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1557 instance.\r
1558 @param Configuration A null-terminated Unicode string in\r
1559 <MulltiConfigResp> format.\r
1560 @param Progress A pointer to a string filled in with the offset\r
1561 of the most recent & before the first failing\r
1562 name / value pair (or the beginning of the string\r
1563 if the failure is in the first name / value pair)\r
1564 or the terminating NULL if all was successful.\r
1565\r
1566 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1567 distribution.\r
1568 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r
1569 results that must be stored awaiting possible\r
1570 future protocols.\r
1571 @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter\r
1572 would result in this type of error.\r
1573 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1574 found.\r
1575\r
1576**/\r
1577EFI_STATUS\r
1578EFIAPI\r
813acf3a 1579HiiConfigRoutingRouteConfig (\r
ac644614 1580 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1581 IN CONST EFI_STRING Configuration,\r
1582 OUT EFI_STRING *Progress\r
ed66e1bc 1583 );\r
ac644614 1584\r
1585\r
1586\r
1587/**\r
1588 This helper function is to be called by drivers to map configuration data stored\r
1589 in byte array ("block") formats such as UEFI Variables into current configuration strings.\r
1590\r
1591 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1592 instance.\r
1593 @param ConfigRequest A null-terminated Unicode string in\r
1594 <ConfigRequest> format.\r
1595 @param Block Array of bytes defining the block's\r
1596 configuration.\r
1597 @param BlockSize Length in bytes of Block.\r
1598 @param Config Filled-in configuration string. String allocated\r
1599 by the function. Returned only if call is\r
1600 successful.\r
1601 @param Progress A pointer to a string filled in with the offset\r
1602 of the most recent & before the first failing\r
1603 name/value pair (or the beginning of the string\r
1604 if the failure is in the first name / value pair)\r
1605 or the terminating NULL if all was successful.\r
1606\r
1607 @retval EFI_SUCCESS The request succeeded. Progress points to the\r
1608 null terminator at the end of the ConfigRequest\r
1609 string.\r
1610 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r
1611 Progress points to the first character of\r
1612 ConfigRequest.\r
1613 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or\r
1614 Block parameter would result in this type of\r
1615 error. Progress points to the first character of\r
1616 ConfigRequest.\r
1617 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1618 found. Progress points to the "G" in "GUID" of\r
1619 the errant routing data.\r
1620 @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.\r
1621 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.\r
1622 Block is left updated and Progress points at\r
1623 the '&' preceding the first non-<BlockName>.\r
1624\r
1625**/\r
1626EFI_STATUS\r
1627EFIAPI\r
1628HiiBlockToConfig (\r
1629 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1630 IN CONST EFI_STRING ConfigRequest,\r
1631 IN CONST UINT8 *Block,\r
1632 IN CONST UINTN BlockSize,\r
1633 OUT EFI_STRING *Config,\r
1634 OUT EFI_STRING *Progress\r
ed66e1bc 1635 );\r
ac644614 1636\r
1637\r
1638/**\r
1639 This helper function is to be called by drivers to map configuration strings\r
1640 to configurations stored in byte array ("block") formats such as UEFI Variables.\r
1641\r
1642 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1643 instance.\r
1644 @param ConfigResp A null-terminated Unicode string in <ConfigResp>\r
1645 format.\r
1646 @param Block A possibly null array of bytes representing the\r
1647 current block. Only bytes referenced in the\r
1648 ConfigResp string in the block are modified. If\r
1649 this parameter is null or if the *BlockSize\r
1650 parameter is (on input) shorter than required by\r
1651 the Configuration string, only the BlockSize\r
1652 parameter is updated and an appropriate status\r
1653 (see below) is returned.\r
1654 @param BlockSize The length of the Block in units of UINT8. On\r
1655 input, this is the size of the Block. On output,\r
1656 if successful, contains the index of the last\r
1657 modified byte in the Block.\r
1658 @param Progress On return, points to an element of the ConfigResp\r
1659 string filled in with the offset of the most\r
1660 recent '&' before the first failing name / value\r
1661 pair (or the beginning of the string if the\r
1662 failure is in the first name / value pair) or\r
1663 the terminating NULL if all was successful.\r
1664\r
1665 @retval EFI_SUCCESS The request succeeded. Progress points to the\r
1666 null terminator at the end of the ConfigResp\r
1667 string.\r
1668 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r
1669 Progress points to the first character of\r
1670 ConfigResp.\r
1671 @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or\r
1672 Block parameter would result in this type of\r
1673 error. Progress points to the first character of\r
1674 ConfigResp.\r
1675 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1676 found. Progress points to the "G" in "GUID" of\r
1677 the errant routing data.\r
1678 @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /\r
1679 value pair. Block is left updated and\r
1680 Progress points at the '&' preceding the first\r
1681 non-<BlockName>.\r
1682\r
1683**/\r
1684EFI_STATUS\r
1685EFIAPI\r
1686HiiConfigToBlock (\r
1687 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1688 IN CONST EFI_STRING ConfigResp,\r
1689 IN OUT UINT8 *Block,\r
1690 IN OUT UINTN *BlockSize,\r
1691 OUT EFI_STRING *Progress\r
ed66e1bc 1692 );\r
ac644614 1693\r
1694\r
1695/**\r
1696 This helper function is to be called by drivers to extract portions of\r
1697 a larger configuration string.\r
1698\r
1699 @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r
1700 instance.\r
1701 @param Configuration A null-terminated Unicode string in\r
1702 <MultiConfigAltResp> format.\r
1703 @param Guid A pointer to the GUID value to search for in the\r
1704 routing portion of the ConfigResp string when\r
1705 retrieving the requested data. If Guid is NULL,\r
1706 then all GUID values will be searched for.\r
1707 @param Name A pointer to the NAME value to search for in the\r
1708 routing portion of the ConfigResp string when\r
1709 retrieving the requested data. If Name is NULL,\r
1710 then all Name values will be searched for.\r
1711 @param DevicePath A pointer to the PATH value to search for in the\r
1712 routing portion of the ConfigResp string when\r
1713 retrieving the requested data. If DevicePath is\r
1714 NULL, then all DevicePath values will be\r
1715 searched for.\r
1716 @param AltCfgId A pointer to the ALTCFG value to search for in\r
1717 the routing portion of the ConfigResp string\r
1718 when retrieving the requested data. If this\r
1719 parameter is NULL, then the current setting will\r
1720 be retrieved.\r
1721 @param AltCfgResp A pointer to a buffer which will be allocated by\r
1722 the function which contains the retrieved string\r
1723 as requested. This buffer is only allocated if\r
1724 the call was successful.\r
1725\r
1726 @retval EFI_SUCCESS The request succeeded. The requested data was\r
1727 extracted and placed in the newly allocated\r
1728 AltCfgResp buffer.\r
1729 @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.\r
1730 @retval EFI_INVALID_PARAMETER Any parameter is invalid.\r
1731 @retval EFI_NOT_FOUND Target for the specified routing data was not\r
1732 found.\r
1733\r
1734**/\r
1735EFI_STATUS\r
1736EFIAPI\r
1737HiiGetAltCfg (\r
1738 IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
1739 IN CONST EFI_STRING Configuration,\r
1740 IN CONST EFI_GUID *Guid,\r
1741 IN CONST EFI_STRING Name,\r
1742 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
1743 IN CONST UINT16 *AltCfgId,\r
1744 OUT EFI_STRING *AltCfgResp\r
ed66e1bc 1745 );\r
ac644614 1746\r
ac644614 1747//\r
1748// Global variables\r
1749//\r
1750extern EFI_EVENT gHiiKeyboardLayoutChanged;\r
ac644614 1751#endif\r