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