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