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