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