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