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