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