]>
Commit | Line | Data |
---|---|---|
ac644614 | 1 | /** @file\r |
e90b081a | 2 | Private structures definitions in HiiDatabase.\r |
ac644614 | 3 | \r |
b1a803d1 | 4 | Copyright (c) 2007 - 2010, 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 |
ac644614 | 20 | #include <Protocol/DevicePath.h>\r |
21 | #include <Protocol/HiiFont.h>\r | |
22 | #include <Protocol/HiiImage.h>\r | |
23 | #include <Protocol/HiiString.h>\r | |
24 | #include <Protocol/HiiDatabase.h>\r | |
25 | #include <Protocol/HiiConfigRouting.h>\r | |
26 | #include <Protocol/HiiConfigAccess.h>\r | |
27 | #include <Protocol/SimpleTextOut.h>\r | |
28 | \r | |
29 | #include <Guid/HiiKeyBoardLayout.h>\r | |
b9982883 | 30 | #include <Guid/GlobalVariable.h>\r |
ac644614 | 31 | \r |
32 | \r | |
33 | #include <Library/DebugLib.h>\r | |
34 | #include <Library/BaseMemoryLib.h>\r | |
35 | #include <Library/UefiDriverEntryPoint.h>\r | |
36 | #include <Library/UefiBootServicesTableLib.h>\r | |
37 | #include <Library/BaseLib.h>\r | |
38 | #include <Library/DevicePathLib.h>\r | |
39 | #include <Library/MemoryAllocationLib.h>\r | |
c27eb358 | 40 | #include <Library/UefiLib.h>\r |
e94358a3 | 41 | #include <Library/PcdLib.h>\r |
8db9d51d | 42 | #include <Library/UefiRuntimeServicesTableLib.h>\r |
63d55bb9 | 43 | #include <Library/PrintLib.h>\r |
8db9d51d | 44 | \r |
ac644614 | 45 | \r |
46 | #define HII_DATABASE_NOTIFY_GUID \\r | |
47 | { \\r | |
48 | 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \\r | |
49 | }\r | |
50 | \r | |
51 | #define MAX_STRING_LENGTH 1024\r | |
52 | #define MAX_FONT_NAME_LEN 256\r | |
53 | #define NARROW_BASELINE 15\r | |
54 | #define WIDE_BASELINE 14\r | |
55 | #define SYS_FONT_INFO_MASK 0x37\r | |
56 | #define REPLACE_UNKNOWN_GLYPH 0xFFFD\r | |
57 | #define PROPORTIONAL_GLYPH 0x80\r | |
58 | #define NARROW_GLYPH 0x40\r | |
59 | \r | |
60 | #define BITMAP_LEN_1_BIT(Width, Height) (((Width) + 7) / 8 * (Height))\r | |
61 | #define BITMAP_LEN_4_BIT(Width, Height) (((Width) + 1) / 2 * (Height))\r | |
62 | #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))\r | |
63 | #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)\r | |
64 | \r | |
84f9a9ec LG |
65 | //\r |
66 | // IFR data structure\r | |
67 | //\r | |
68 | // BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.\r | |
69 | \r | |
70 | typedef 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 | |
79 | typedef 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 | |
89 | typedef struct {\r | |
90 | LIST_ENTRY Entry;\r | |
6e3f5b2a | 91 | UINT8 OpCode;\r |
84f9a9ec LG |
92 | EFI_STRING_ID DefaultName;\r |
93 | UINT16 DefaultId;\r | |
94 | UINT64 Value;\r | |
95 | } IFR_DEFAULT_DATA;\r | |
96 | \r | |
ac644614 | 97 | //\r |
98 | // Storage types\r | |
99 | //\r | |
100 | #define EFI_HII_VARSTORE_BUFFER 0\r | |
101 | #define EFI_HII_VARSTORE_NAME_VALUE 1\r | |
102 | #define EFI_HII_VARSTORE_EFI_VARIABLE 2\r | |
103 | \r | |
f3f2e05d | 104 | #define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')\r |
ac644614 | 105 | typedef struct {\r |
106 | UINTN Signature;\r | |
107 | LIST_ENTRY Entry;\r | |
108 | \r | |
109 | EFI_HII_HANDLE HiiHandle;\r | |
110 | EFI_HANDLE DriverHandle;\r | |
111 | \r | |
112 | UINT8 Type; // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE\r | |
113 | EFI_GUID Guid;\r | |
114 | CHAR16 *Name;\r | |
115 | UINT16 Size;\r | |
116 | } HII_FORMSET_STORAGE;\r | |
117 | \r | |
ac644614 | 118 | \r |
119 | //\r | |
120 | // String Package definitions\r | |
121 | //\r | |
f3f2e05d | 122 | #define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')\r |
ac644614 | 123 | typedef 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 | |
f3f2e05d | 135 | #define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')\r |
ac644614 | 136 | typedef 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 | |
f3f2e05d | 146 | #define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')\r |
ac644614 | 147 | typedef 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 | |
f3f2e05d | 156 | #define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')\r |
ac644614 | 157 | typedef 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 | |
f3f2e05d | 165 | #define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')\r |
ac644614 | 166 | typedef 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 | |
f3f2e05d | 173 | #define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')\r |
ac644614 | 174 | typedef 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 | |
f3f2e05d | 181 | #define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')\r |
ac644614 | 182 | typedef 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 | |
196 | typedef 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 | |
f3f2e05d | 207 | #define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')\r |
ac644614 | 208 | typedef 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 | |
f3f2e05d | 217 | #define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')\r |
ac644614 | 218 | typedef 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 | |
228 | typedef 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 | |
f3f2e05d | 240 | #define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')\r |
ac644614 | 241 | \r |
242 | typedef struct {\r | |
243 | UINTN Signature;\r | |
244 | LIST_ENTRY Handle;\r | |
245 | UINTN Key;\r | |
246 | } HII_HANDLE;\r | |
247 | \r | |
f3f2e05d | 248 | #define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')\r |
ac644614 | 249 | \r |
250 | typedef 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 | |
f3f2e05d | 258 | #define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')\r |
ac644614 | 259 | \r |
260 | typedef 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 | |
f3f2e05d | 270 | #define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')\r |
ac644614 | 271 | \r |
272 | typedef 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 | |
ac644614 | 277 | EFI_HII_IMAGE_PROTOCOL HiiImage;\r |
ac644614 | 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 | |
e90b081a | 329 | This function checks whether a handle is a valid EFI_HII_HANDLE.\r |
ac644614 | 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 | |
337 | BOOLEAN\r | |
338 | IsHiiHandleValid (\r | |
339 | EFI_HII_HANDLE Handle\r | |
ed66e1bc | 340 | );\r |
ac644614 | 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 | |
365 | BOOLEAN\r | |
366 | IsFontInfoExisted (\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 | |
ed66e1bc | 372 | );\r |
ac644614 | 373 | \r |
8d00a0f1 | 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 | |
389 | EFI_STATUS\r | |
390 | InvokeRegisteredFunction (\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 | |
ac644614 | 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 | |
414 | EFI_STATUS\r | |
415 | GetSystemFont (\r | |
416 | IN HII_DATABASE_PRIVATE_DATA *Private,\r | |
417 | OUT EFI_FONT_DISPLAY_INFO **FontInfo,\r | |
418 | OUT UINTN *FontInfoSize OPTIONAL\r | |
ed66e1bc | 419 | );\r |
ac644614 | 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 | |
446 | EFI_STATUS\r | |
447 | FindStringBlock (\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 | |
ed66e1bc | 455 | );\r |
ac644614 | 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 | |
479 | EFI_STATUS\r | |
480 | FindGlyphBlock (\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 | |
ed66e1bc | 486 | );\r |
ac644614 | 487 | \r |
8567300a LG |
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 | |
505 | EFI_STATUS\r | |
506 | ExportFormPackages (\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 | |
ac644614 | 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 | |
e90b081a | 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 | |
ac644614 | 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 | |
813acf3a | 571 | @retval EFI_INVALID_PARAMETER The String or Blt.\r |
572 | @retval EFI_INVALID_PARAMETER Flags were invalid combination..\r | |
ac644614 | 573 | \r |
574 | **/\r | |
575 | EFI_STATUS\r | |
576 | EFIAPI\r | |
577 | HiiStringToImage (\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 | |
ed66e1bc | 588 | );\r |
ac644614 | 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 | |
e90b081a | 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 | |
ac644614 | 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 | |
813acf3a | 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 | |
ac644614 | 650 | \r |
651 | **/\r | |
652 | EFI_STATUS\r | |
653 | EFIAPI\r | |
654 | HiiStringIdToImage (\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 | |
ed66e1bc | 667 | );\r |
ac644614 | 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 | |
692 | EFI_STATUS\r | |
693 | EFIAPI\r | |
694 | HiiGetGlyph (\r | |
695 | IN CONST EFI_HII_FONT_PROTOCOL *This,\r | |
696 | IN CHAR16 Char,\r | |
e90b081a | 697 | IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,\r |
ac644614 | 698 | OUT EFI_IMAGE_OUTPUT **Blt,\r |
699 | OUT UINTN *Baseline OPTIONAL\r | |
ed66e1bc | 700 | );\r |
ac644614 | 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 | |
813acf3a | 715 | information about. If NULL, then the information about the system default \r |
716 | font will be returned.\r | |
ac644614 | 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 | |
813acf3a | 728 | @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination.\r |
ac644614 | 729 | @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the\r |
730 | request.\r | |
ac644614 | 731 | **/\r |
732 | EFI_STATUS\r | |
733 | EFIAPI\r | |
734 | HiiGetFontInfo (\r | |
735 | IN CONST EFI_HII_FONT_PROTOCOL *This,\r | |
736 | IN OUT EFI_FONT_HANDLE *FontHandle,\r | |
e90b081a | 737 | IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL\r |
ac644614 | 738 | OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,\r |
739 | IN CONST EFI_STRING String OPTIONAL\r | |
ed66e1bc | 740 | );\r |
ac644614 | 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 | |
765 | EFI_STATUS\r | |
766 | EFIAPI\r | |
767 | HiiNewImage (\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 | |
ed66e1bc | 772 | );\r |
ac644614 | 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 | |
ac644614 | 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 | |
813acf3a | 788 | The specified PackageList is not in the database.\r |
ac644614 | 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 | |
813acf3a | 792 | @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not\r |
793 | enough memory.\r | |
ac644614 | 794 | \r |
795 | **/\r | |
796 | EFI_STATUS\r | |
797 | EFIAPI\r | |
798 | HiiGetImage (\r | |
799 | IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r | |
800 | IN EFI_HII_HANDLE PackageList,\r | |
801 | IN EFI_IMAGE_ID ImageId,\r | |
813acf3a | 802 | OUT EFI_IMAGE_INPUT *Image\r |
ed66e1bc | 803 | );\r |
ac644614 | 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 | |
813acf3a | 818 | database. The specified PackageList is not in the database.\r |
ac644614 | 819 | @retval EFI_INVALID_PARAMETER The Image was NULL.\r |
820 | \r | |
821 | **/\r | |
822 | EFI_STATUS\r | |
823 | EFIAPI\r | |
824 | HiiSetImage (\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 | |
ed66e1bc | 829 | );\r |
ac644614 | 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 | |
e90b081a | 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 | |
ac644614 | 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 | |
861 | EFI_STATUS\r | |
862 | EFIAPI\r | |
863 | HiiDrawImage (\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 | |
ed66e1bc | 870 | );\r |
ac644614 | 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 | |
e90b081a | 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 | |
ac644614 | 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 | |
813acf3a | 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 | |
ac644614 | 905 | \r |
906 | **/\r | |
907 | EFI_STATUS\r | |
908 | EFIAPI\r | |
909 | HiiDrawImageId (\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 | |
957 | EFI_STATUS\r | |
958 | EFIAPI\r | |
959 | HiiNewString (\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 | |
ed66e1bc | 967 | );\r |
ac644614 | 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 | |
813acf3a | 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 | |
ac644614 | 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 | |
1004 | EFI_STATUS\r | |
1005 | EFIAPI\r | |
1006 | HiiGetString (\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 | |
ed66e1bc | 1014 | );\r |
ac644614 | 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 | |
1039 | EFI_STATUS\r | |
1040 | EFIAPI\r | |
1041 | HiiSetString (\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 | |
ed66e1bc | 1048 | );\r |
ac644614 | 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 | |
1072 | EFI_STATUS\r | |
1073 | EFIAPI\r | |
1074 | HiiGetLanguages (\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 | |
ed66e1bc | 1079 | );\r |
ac644614 | 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 | |
e90b081a | 1096 | @param SecondaryLanguagesSize On entry, points to the size of the buffer\r |
ac644614 | 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 | |
813acf3a | 1108 | @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not\r |
ac644614 | 1109 | present in the specified package list.\r |
813acf3a | 1110 | @retval EFI_NOT_FOUND The specified PackageList is not in the Database. \r |
ac644614 | 1111 | \r |
1112 | **/\r | |
1113 | EFI_STATUS\r | |
1114 | EFIAPI\r | |
1115 | HiiGetSecondaryLanguages (\r | |
1116 | IN CONST EFI_HII_STRING_PROTOCOL *This,\r | |
1117 | IN EFI_HII_HANDLE PackageList,\r | |
1118 | IN CONST CHAR8 *FirstLanguage,\r | |
e90b081a | 1119 | IN OUT CHAR8 *SecondaryLanguages,\r |
1120 | IN OUT UINTN *SecondaryLanguagesSize\r | |
ed66e1bc | 1121 | );\r |
ac644614 | 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 | |
b1a803d1 | 1138 | If a NULL is specified, this data will not be associate\r |
1139 | with any drivers and cannot have a callback induced.\r | |
ac644614 | 1140 | @param Handle A pointer to the EFI_HII_HANDLE instance.\r |
1141 | \r | |
1142 | @retval EFI_SUCCESS The package list associated with the Handle was\r | |
1143 | added to the HII database.\r | |
1144 | @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the\r | |
1145 | new database contents.\r | |
1146 | @retval EFI_INVALID_PARAMETER PackageList is NULL or Handle is NULL.\r | |
1147 | \r | |
1148 | **/\r | |
1149 | EFI_STATUS\r | |
1150 | EFIAPI\r | |
1151 | HiiNewPackageList (\r | |
1152 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1153 | IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,\r | |
b1a803d1 | 1154 | IN CONST EFI_HANDLE DriverHandle, OPTIONAL\r |
ac644614 | 1155 | OUT EFI_HII_HANDLE *Handle\r |
ed66e1bc | 1156 | );\r |
ac644614 | 1157 | \r |
1158 | \r | |
1159 | /**\r | |
1160 | This function removes the package list that is associated with a handle Handle\r | |
1161 | from the HII database. Before removing the package, any registered functions\r | |
1162 | with the notification type REMOVE_PACK and the same package type will be called.\r | |
1163 | \r | |
1164 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1165 | instance.\r | |
1166 | @param Handle The handle that was registered to the data that\r | |
1167 | is requested for removal.\r | |
1168 | \r | |
1169 | @retval EFI_SUCCESS The data associated with the Handle was removed\r | |
1170 | from the HII database.\r | |
813acf3a | 1171 | @retval EFI_NOT_FOUND The specified Handle is not in database.\r |
ac644614 | 1172 | \r |
1173 | **/\r | |
1174 | EFI_STATUS\r | |
1175 | EFIAPI\r | |
1176 | HiiRemovePackageList (\r | |
1177 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1178 | IN EFI_HII_HANDLE Handle\r | |
ed66e1bc | 1179 | );\r |
ac644614 | 1180 | \r |
1181 | \r | |
1182 | /**\r | |
1183 | This function updates the existing package list (which has the specified Handle)\r | |
1184 | in the HII databases, using the new package list specified by PackageList.\r | |
1185 | \r | |
1186 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1187 | instance.\r | |
1188 | @param Handle The handle that was registered to the data that\r | |
1189 | is requested to be updated.\r | |
1190 | @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r | |
1191 | package.\r | |
1192 | \r | |
1193 | @retval EFI_SUCCESS The HII database was successfully updated.\r | |
1194 | @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated\r | |
1195 | database.\r | |
813acf3a | 1196 | @retval EFI_INVALID_PARAMETER PackageList was NULL.\r |
1197 | @retval EFI_NOT_FOUND The specified Handle is not in database.\r | |
ac644614 | 1198 | \r |
1199 | **/\r | |
1200 | EFI_STATUS\r | |
1201 | EFIAPI\r | |
1202 | HiiUpdatePackageList (\r | |
1203 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1204 | IN EFI_HII_HANDLE Handle,\r | |
1205 | IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList\r | |
ed66e1bc | 1206 | );\r |
ac644614 | 1207 | \r |
1208 | \r | |
1209 | /**\r | |
1210 | This function returns a list of the package handles of the specified type\r | |
1211 | that are currently active in the database. The pseudo-type\r | |
1212 | EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.\r | |
1213 | \r | |
1214 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1215 | instance.\r | |
1216 | @param PackageType Specifies the package type of the packages to\r | |
1217 | list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r | |
1218 | to be listed.\r | |
1219 | @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r | |
1220 | this is the pointer to the GUID which must match\r | |
1221 | the Guid field of EFI_HII_GUID_PACKAGE_GUID_HDR.\r | |
1222 | Otherwise, it must be NULL.\r | |
1223 | @param HandleBufferLength On input, a pointer to the length of the handle\r | |
1224 | buffer. On output, the length of the handle\r | |
1225 | buffer that is required for the handles found.\r | |
1226 | @param Handle An array of EFI_HII_HANDLE instances returned.\r | |
1227 | \r | |
1228 | @retval EFI_SUCCESS The matching handles are outputed successfully.\r | |
813acf3a | 1229 | HandleBufferLength is updated with the actual length.\r |
ac644614 | 1230 | @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r |
1231 | Handle is too small to support the number of\r | |
1232 | handles. HandleBufferLength is updated with a\r | |
1233 | value that will enable the data to fit.\r | |
1234 | @retval EFI_NOT_FOUND No matching handle could not be found in\r | |
1235 | database.\r | |
1236 | @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.\r | |
813acf3a | 1237 | @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r |
1238 | PackageGuid is not NULL, PackageType is a EFI_HII_\r | |
1239 | PACKAGE_TYPE_GUID but PackageGuid is NULL.\r | |
1240 | \r | |
ac644614 | 1241 | \r |
1242 | **/\r | |
1243 | EFI_STATUS\r | |
1244 | EFIAPI\r | |
1245 | HiiListPackageLists (\r | |
1246 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1247 | IN UINT8 PackageType,\r | |
1248 | IN CONST EFI_GUID *PackageGuid,\r | |
1249 | IN OUT UINTN *HandleBufferLength,\r | |
1250 | OUT EFI_HII_HANDLE *Handle\r | |
ed66e1bc | 1251 | );\r |
ac644614 | 1252 | \r |
1253 | \r | |
1254 | /**\r | |
1255 | This function will export one or all package lists in the database to a buffer.\r | |
1256 | For each package list exported, this function will call functions registered\r | |
1257 | with EXPORT_PACK and then copy the package list to the buffer.\r | |
1258 | \r | |
1259 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1260 | instance.\r | |
1261 | @param Handle An EFI_HII_HANDLE that corresponds to the desired\r | |
1262 | package list in the HII database to export or\r | |
1263 | NULL to indicate all package lists should be\r | |
1264 | exported.\r | |
1265 | @param BufferSize On input, a pointer to the length of the buffer.\r | |
1266 | On output, the length of the buffer that is\r | |
1267 | required for the exported data.\r | |
1268 | @param Buffer A pointer to a buffer that will contain the\r | |
1269 | results of the export function.\r | |
1270 | \r | |
1271 | @retval EFI_SUCCESS Package exported.\r | |
1272 | @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r | |
1273 | Handle is too small to support the number of\r | |
1274 | handles. HandleBufferLength is updated with\r | |
1275 | a value that will enable the data to fit.\r | |
1276 | @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the\r | |
1277 | current database.\r | |
1278 | @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL.\r | |
1279 | \r | |
1280 | **/\r | |
1281 | EFI_STATUS\r | |
1282 | EFIAPI\r | |
1283 | HiiExportPackageLists (\r | |
1284 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1285 | IN EFI_HII_HANDLE Handle,\r | |
1286 | IN OUT UINTN *BufferSize,\r | |
1287 | OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer\r | |
ed66e1bc | 1288 | );\r |
ac644614 | 1289 | \r |
1290 | \r | |
1291 | /**\r | |
1292 | This function registers a function which will be called when specified actions related to packages of\r | |
1293 | the specified type occur in the HII database. By registering a function, other HII-related drivers are\r | |
1294 | notified when specific package types are added, removed or updated in the HII database.\r | |
1295 | Each driver or application which registers a notification should use\r | |
1296 | EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting.\r | |
1297 | \r | |
1298 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1299 | instance.\r | |
1300 | @param PackageType Specifies the package type of the packages to\r | |
1301 | list or EFI_HII_PACKAGE_TYPE_ALL for all packages\r | |
1302 | to be listed.\r | |
1303 | @param PackageGuid If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then\r | |
1304 | this is the pointer to the GUID which must match\r | |
1305 | the Guid field of\r | |
1306 | EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must\r | |
1307 | be NULL.\r | |
1308 | @param PackageNotifyFn Points to the function to be called when the\r | |
1309 | event specified by\r | |
1310 | NotificationType occurs.\r | |
1311 | @param NotifyType Describes the types of notification which this\r | |
1312 | function will be receiving.\r | |
1313 | @param NotifyHandle Points to the unique handle assigned to the\r | |
1314 | registered notification. Can be used in\r | |
1315 | EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify()\r | |
1316 | to stop notifications.\r | |
1317 | \r | |
1318 | @retval EFI_SUCCESS Notification registered successfully.\r | |
1319 | @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures\r | |
1320 | @retval EFI_INVALID_PARAMETER NotifyHandle is NULL.\r | |
1321 | @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when PackageType is not\r | |
1322 | EFI_HII_PACKAGE_TYPE_GUID.\r | |
1323 | @retval EFI_INVALID_PARAMETER PackageGuid is NULL when PackageType is\r | |
1324 | EFI_HII_PACKAGE_TYPE_GUID.\r | |
1325 | \r | |
1326 | **/\r | |
1327 | EFI_STATUS\r | |
1328 | EFIAPI\r | |
1329 | HiiRegisterPackageNotify (\r | |
1330 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1331 | IN UINT8 PackageType,\r | |
1332 | IN CONST EFI_GUID *PackageGuid,\r | |
1333 | IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,\r | |
1334 | IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r | |
1335 | OUT EFI_HANDLE *NotifyHandle\r | |
ed66e1bc | 1336 | );\r |
ac644614 | 1337 | \r |
1338 | \r | |
1339 | /**\r | |
1340 | Removes the specified HII database package-related notification.\r | |
1341 | \r | |
1342 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1343 | instance.\r | |
e90b081a | 1344 | @param NotificationHandle The handle of the notification function being\r |
ac644614 | 1345 | unregistered.\r |
1346 | \r | |
1347 | @retval EFI_SUCCESS Notification is unregistered successfully.\r | |
813acf3a | 1348 | @retval EFI_NOT_FOUND The incoming notification handle does not exist \r |
1349 | in current hii database.\r | |
ac644614 | 1350 | \r |
1351 | **/\r | |
1352 | EFI_STATUS\r | |
1353 | EFIAPI\r | |
1354 | HiiUnregisterPackageNotify (\r | |
1355 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1356 | IN EFI_HANDLE NotificationHandle\r | |
ed66e1bc | 1357 | );\r |
ac644614 | 1358 | \r |
1359 | \r | |
1360 | /**\r | |
1361 | This routine retrieves an array of GUID values for each keyboard layout that\r | |
1362 | was previously registered in the system.\r | |
1363 | \r | |
1364 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1365 | instance.\r | |
1366 | @param KeyGuidBufferLength On input, a pointer to the length of the keyboard\r | |
1367 | GUID buffer. On output, the length of the handle\r | |
1368 | buffer that is required for the handles found.\r | |
1369 | @param KeyGuidBuffer An array of keyboard layout GUID instances\r | |
1370 | returned.\r | |
1371 | \r | |
1372 | @retval EFI_SUCCESS KeyGuidBuffer was updated successfully.\r | |
1373 | @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength parameter indicates\r | |
1374 | that KeyGuidBuffer is too small to support the\r | |
1375 | number of GUIDs. KeyGuidBufferLength is\r | |
1376 | updated with a value that will enable the data to\r | |
1377 | fit.\r | |
1378 | @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was\r | |
1379 | NULL.\r | |
1380 | @retval EFI_NOT_FOUND There was no keyboard layout.\r | |
1381 | \r | |
1382 | **/\r | |
1383 | EFI_STATUS\r | |
1384 | EFIAPI\r | |
1385 | HiiFindKeyboardLayouts (\r | |
1386 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1387 | IN OUT UINT16 *KeyGuidBufferLength,\r | |
1388 | OUT EFI_GUID *KeyGuidBuffer\r | |
ed66e1bc | 1389 | );\r |
ac644614 | 1390 | \r |
1391 | \r | |
1392 | /**\r | |
1393 | This routine retrieves the requested keyboard layout. The layout is a physical description of the keys\r | |
1394 | on a keyboard and the character(s) that are associated with a particular set of key strokes.\r | |
1395 | \r | |
1396 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1397 | instance.\r | |
1398 | @param KeyGuid A pointer to the unique ID associated with a\r | |
1399 | given keyboard layout. If KeyGuid is NULL then\r | |
1400 | the current layout will be retrieved.\r | |
1401 | @param KeyboardLayoutLength On input, a pointer to the length of the\r | |
1402 | KeyboardLayout buffer. On output, the length of\r | |
1403 | the data placed into KeyboardLayout.\r | |
1404 | @param KeyboardLayout A pointer to a buffer containing the retrieved\r | |
1405 | keyboard layout.\r | |
1406 | \r | |
1407 | @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r | |
1408 | @retval EFI_NOT_FOUND The requested keyboard layout was not found.\r | |
1409 | @retval EFI_INVALID_PARAMETER The KeyboardLayout or KeyboardLayoutLength was\r | |
1410 | NULL.\r | |
1411 | \r | |
1412 | **/\r | |
1413 | EFI_STATUS\r | |
1414 | EFIAPI\r | |
1415 | HiiGetKeyboardLayout (\r | |
1416 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1417 | IN CONST EFI_GUID *KeyGuid,\r | |
1418 | IN OUT UINT16 *KeyboardLayoutLength,\r | |
1419 | OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout\r | |
ed66e1bc | 1420 | );\r |
ac644614 | 1421 | \r |
1422 | \r | |
1423 | /**\r | |
1424 | This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine\r | |
1425 | is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID\r | |
1426 | group type. This is so that agents which are sensitive to the current keyboard layout being changed\r | |
1427 | can be notified of this change.\r | |
1428 | \r | |
1429 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1430 | instance.\r | |
1431 | @param KeyGuid A pointer to the unique ID associated with a\r | |
1432 | given keyboard layout.\r | |
1433 | \r | |
1434 | @retval EFI_SUCCESS The current keyboard layout was successfully set.\r | |
1435 | @retval EFI_NOT_FOUND The referenced keyboard layout was not found, so\r | |
1436 | action was taken.\r | |
1437 | @retval EFI_INVALID_PARAMETER The KeyGuid was NULL.\r | |
1438 | \r | |
1439 | **/\r | |
1440 | EFI_STATUS\r | |
1441 | EFIAPI\r | |
1442 | HiiSetKeyboardLayout (\r | |
1443 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1444 | IN CONST EFI_GUID *KeyGuid\r | |
ed66e1bc | 1445 | );\r |
ac644614 | 1446 | \r |
1447 | \r | |
1448 | /**\r | |
1449 | Return the EFI handle associated with a package list.\r | |
1450 | \r | |
1451 | @param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r | |
1452 | instance.\r | |
1453 | @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired\r | |
1454 | package list in the HIIdatabase.\r | |
1455 | @param DriverHandle On return, contains the EFI_HANDLE which was\r | |
1456 | registered with the package list in\r | |
1457 | NewPackageList().\r | |
1458 | \r | |
1459 | @retval EFI_SUCCESS The DriverHandle was returned successfully.\r | |
1460 | @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid or\r | |
1461 | DriverHandle was NULL.\r | |
1462 | \r | |
1463 | **/\r | |
1464 | EFI_STATUS\r | |
1465 | EFIAPI\r | |
1466 | HiiGetPackageListHandle (\r | |
1467 | IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r | |
1468 | IN EFI_HII_HANDLE PackageListHandle,\r | |
1469 | OUT EFI_HANDLE *DriverHandle\r | |
ed66e1bc | 1470 | );\r |
ac644614 | 1471 | \r |
1472 | //\r | |
1473 | // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces\r | |
1474 | //\r | |
1475 | \r | |
1476 | \r | |
1477 | /**\r | |
1478 | This function allows a caller to extract the current configuration\r | |
1479 | for one or more named elements from one or more drivers.\r | |
1480 | \r | |
1481 | @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r | |
1482 | instance.\r | |
1483 | @param Request A null-terminated Unicode string in\r | |
1484 | <MultiConfigRequest> format.\r | |
1485 | @param Progress On return, points to a character in the Request\r | |
1486 | string. Points to the string's null terminator if\r | |
1487 | request was successful. Points to the most recent\r | |
1488 | & before the first failing name / value pair (or\r | |
1489 | the beginning of the string if the failure is in\r | |
1490 | the first name / value pair) if the request was\r | |
1491 | not successful.\r | |
1492 | @param Results Null-terminated Unicode string in\r | |
1493 | <MultiConfigAltResp> format which has all values\r | |
1494 | filled in for the names in the Request string.\r | |
1495 | String to be allocated by the called function.\r | |
1496 | \r | |
1497 | @retval EFI_SUCCESS The Results string is filled with the values\r | |
1498 | corresponding to all requested names.\r | |
1499 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r | |
1500 | results that must be stored awaiting possible\r | |
1501 | future protocols.\r | |
1502 | @retval EFI_NOT_FOUND Routing data doesn't match any known driver.\r | |
1503 | Progress set to the "G" in "GUID" of the\r | |
1504 | routing header that doesn't match. Note: There\r | |
1505 | is no requirement that all routing data\r | |
1506 | be validated before any configuration extraction.\r | |
1507 | @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Request\r | |
1508 | parameter would result in this type of error. The\r | |
1509 | Progress parameter is set to NULL.\r | |
1510 | @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set to most recent &\r | |
1511 | before the error or the beginning of the string.\r | |
1512 | @retval EFI_INVALID_PARAMETER Unknown name. Progress points to the & before the\r | |
1513 | name in question.\r | |
1514 | \r | |
1515 | **/\r | |
1516 | EFI_STATUS\r | |
1517 | EFIAPI\r | |
1518 | HiiConfigRoutingExtractConfig (\r | |
1519 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
1520 | IN CONST EFI_STRING Request,\r | |
1521 | OUT EFI_STRING *Progress,\r | |
1522 | OUT EFI_STRING *Results\r | |
ed66e1bc | 1523 | );\r |
ac644614 | 1524 | \r |
1525 | \r | |
1526 | /**\r | |
1527 | This function allows the caller to request the current configuration for the\r | |
1528 | entirety of the current HII database and returns the data in a null-terminated Unicode string.\r | |
1529 | \r | |
1530 | @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r | |
1531 | instance.\r | |
1532 | @param Results Null-terminated Unicode string in\r | |
1533 | <MultiConfigAltResp> format which has all values\r | |
1534 | filled in for the names in the Request string.\r | |
1535 | String to be allocated by the called function.\r | |
1536 | De-allocation is up to the caller.\r | |
1537 | \r | |
1538 | @retval EFI_SUCCESS The Results string is filled with the values\r | |
1539 | corresponding to all requested names.\r | |
1540 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r | |
1541 | results that must be stored awaiting possible\r | |
1542 | future protocols.\r | |
1543 | @retval EFI_INVALID_PARAMETER For example, passing in a NULL for the Results\r | |
1544 | parameter would result in this type of error.\r | |
1545 | \r | |
1546 | **/\r | |
1547 | EFI_STATUS\r | |
1548 | EFIAPI\r | |
1549 | HiiConfigRoutingExportConfig (\r | |
1550 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
1551 | OUT EFI_STRING *Results\r | |
ed66e1bc | 1552 | );\r |
ac644614 | 1553 | \r |
1554 | \r | |
1555 | /**\r | |
1556 | This function processes the results of processing forms and routes it to the\r | |
1557 | appropriate handlers or storage.\r | |
1558 | \r | |
1559 | @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r | |
1560 | instance.\r | |
1561 | @param Configuration A null-terminated Unicode string in\r | |
1562 | <MulltiConfigResp> format.\r | |
1563 | @param Progress A pointer to a string filled in with the offset\r | |
1564 | of the most recent & before the first failing\r | |
1565 | name / value pair (or the beginning of the string\r | |
1566 | if the failure is in the first name / value pair)\r | |
1567 | or the terminating NULL if all was successful.\r | |
1568 | \r | |
1569 | @retval EFI_SUCCESS The results have been distributed or are awaiting\r | |
1570 | distribution.\r | |
1571 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the parts of the\r | |
1572 | results that must be stored awaiting possible\r | |
1573 | future protocols.\r | |
1574 | @retval EFI_INVALID_PARAMETER Passing in a NULL for the Configuration parameter\r | |
1575 | would result in this type of error.\r | |
1576 | @retval EFI_NOT_FOUND Target for the specified routing data was not\r | |
1577 | found.\r | |
1578 | \r | |
1579 | **/\r | |
1580 | EFI_STATUS\r | |
1581 | EFIAPI\r | |
813acf3a | 1582 | HiiConfigRoutingRouteConfig (\r |
ac644614 | 1583 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r |
1584 | IN CONST EFI_STRING Configuration,\r | |
1585 | OUT EFI_STRING *Progress\r | |
ed66e1bc | 1586 | );\r |
ac644614 | 1587 | \r |
1588 | \r | |
1589 | \r | |
1590 | /**\r | |
1591 | This helper function is to be called by drivers to map configuration data stored\r | |
1592 | in byte array ("block") formats such as UEFI Variables into current configuration strings.\r | |
1593 | \r | |
1594 | @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r | |
1595 | instance.\r | |
1596 | @param ConfigRequest A null-terminated Unicode string in\r | |
1597 | <ConfigRequest> format.\r | |
1598 | @param Block Array of bytes defining the block's\r | |
1599 | configuration.\r | |
1600 | @param BlockSize Length in bytes of Block.\r | |
1601 | @param Config Filled-in configuration string. String allocated\r | |
1602 | by the function. Returned only if call is\r | |
1603 | successful.\r | |
1604 | @param Progress A pointer to a string filled in with the offset\r | |
1605 | of the most recent & before the first failing\r | |
1606 | name/value pair (or the beginning of the string\r | |
1607 | if the failure is in the first name / value pair)\r | |
1608 | or the terminating NULL if all was successful.\r | |
1609 | \r | |
1610 | @retval EFI_SUCCESS The request succeeded. Progress points to the\r | |
1611 | null terminator at the end of the ConfigRequest\r | |
1612 | string.\r | |
1613 | @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r | |
1614 | Progress points to the first character of\r | |
1615 | ConfigRequest.\r | |
1616 | @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigRequest or\r | |
1617 | Block parameter would result in this type of\r | |
1618 | error. Progress points to the first character of\r | |
1619 | ConfigRequest.\r | |
1620 | @retval EFI_NOT_FOUND Target for the specified routing data was not\r | |
1621 | found. Progress points to the "G" in "GUID" of\r | |
1622 | the errant routing data.\r | |
1623 | @retval EFI_DEVICE_ERROR Block not large enough. Progress undefined.\r | |
1624 | @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted string.\r | |
1625 | Block is left updated and Progress points at\r | |
1626 | the '&' preceding the first non-<BlockName>.\r | |
1627 | \r | |
1628 | **/\r | |
1629 | EFI_STATUS\r | |
1630 | EFIAPI\r | |
1631 | HiiBlockToConfig (\r | |
1632 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
1633 | IN CONST EFI_STRING ConfigRequest,\r | |
1634 | IN CONST UINT8 *Block,\r | |
1635 | IN CONST UINTN BlockSize,\r | |
1636 | OUT EFI_STRING *Config,\r | |
1637 | OUT EFI_STRING *Progress\r | |
ed66e1bc | 1638 | );\r |
ac644614 | 1639 | \r |
1640 | \r | |
1641 | /**\r | |
1642 | This helper function is to be called by drivers to map configuration strings\r | |
1643 | to configurations stored in byte array ("block") formats such as UEFI Variables.\r | |
1644 | \r | |
1645 | @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r | |
1646 | instance.\r | |
1647 | @param ConfigResp A null-terminated Unicode string in <ConfigResp>\r | |
1648 | format.\r | |
1649 | @param Block A possibly null array of bytes representing the\r | |
1650 | current block. Only bytes referenced in the\r | |
1651 | ConfigResp string in the block are modified. If\r | |
1652 | this parameter is null or if the *BlockSize\r | |
1653 | parameter is (on input) shorter than required by\r | |
1654 | the Configuration string, only the BlockSize\r | |
1655 | parameter is updated and an appropriate status\r | |
1656 | (see below) is returned.\r | |
1657 | @param BlockSize The length of the Block in units of UINT8. On\r | |
1658 | input, this is the size of the Block. On output,\r | |
1659 | if successful, contains the index of the last\r | |
1660 | modified byte in the Block.\r | |
1661 | @param Progress On return, points to an element of the ConfigResp\r | |
1662 | string filled in with the offset of the most\r | |
1663 | recent '&' before the first failing name / value\r | |
1664 | pair (or the beginning of the string if the\r | |
1665 | failure is in the first name / value pair) or\r | |
1666 | the terminating NULL if all was successful.\r | |
1667 | \r | |
1668 | @retval EFI_SUCCESS The request succeeded. Progress points to the\r | |
1669 | null terminator at the end of the ConfigResp\r | |
1670 | string.\r | |
1671 | @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate Config.\r | |
1672 | Progress points to the first character of\r | |
1673 | ConfigResp.\r | |
1674 | @retval EFI_INVALID_PARAMETER Passing in a NULL for the ConfigResp or\r | |
1675 | Block parameter would result in this type of\r | |
1676 | error. Progress points to the first character of\r | |
1677 | ConfigResp.\r | |
1678 | @retval EFI_NOT_FOUND Target for the specified routing data was not\r | |
1679 | found. Progress points to the "G" in "GUID" of\r | |
1680 | the errant routing data.\r | |
1681 | @retval EFI_INVALID_PARAMETER Encountered non <BlockName> formatted name /\r | |
1682 | value pair. Block is left updated and\r | |
1683 | Progress points at the '&' preceding the first\r | |
1684 | non-<BlockName>.\r | |
1685 | \r | |
1686 | **/\r | |
1687 | EFI_STATUS\r | |
1688 | EFIAPI\r | |
1689 | HiiConfigToBlock (\r | |
1690 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
1691 | IN CONST EFI_STRING ConfigResp,\r | |
1692 | IN OUT UINT8 *Block,\r | |
1693 | IN OUT UINTN *BlockSize,\r | |
1694 | OUT EFI_STRING *Progress\r | |
ed66e1bc | 1695 | );\r |
ac644614 | 1696 | \r |
1697 | \r | |
1698 | /**\r | |
1699 | This helper function is to be called by drivers to extract portions of\r | |
1700 | a larger configuration string.\r | |
1701 | \r | |
1702 | @param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL\r | |
1703 | instance.\r | |
1704 | @param Configuration A null-terminated Unicode string in\r | |
1705 | <MultiConfigAltResp> format.\r | |
1706 | @param Guid A pointer to the GUID value to search for in the\r | |
1707 | routing portion of the ConfigResp string when\r | |
1708 | retrieving the requested data. If Guid is NULL,\r | |
1709 | then all GUID values will be searched for.\r | |
1710 | @param Name A pointer to the NAME value to search for in the\r | |
1711 | routing portion of the ConfigResp string when\r | |
1712 | retrieving the requested data. If Name is NULL,\r | |
1713 | then all Name values will be searched for.\r | |
1714 | @param DevicePath A pointer to the PATH value to search for in the\r | |
1715 | routing portion of the ConfigResp string when\r | |
1716 | retrieving the requested data. If DevicePath is\r | |
1717 | NULL, then all DevicePath values will be\r | |
1718 | searched for.\r | |
1719 | @param AltCfgId A pointer to the ALTCFG value to search for in\r | |
1720 | the routing portion of the ConfigResp string\r | |
1721 | when retrieving the requested data. If this\r | |
1722 | parameter is NULL, then the current setting will\r | |
1723 | be retrieved.\r | |
1724 | @param AltCfgResp A pointer to a buffer which will be allocated by\r | |
1725 | the function which contains the retrieved string\r | |
1726 | as requested. This buffer is only allocated if\r | |
1727 | the call was successful.\r | |
1728 | \r | |
1729 | @retval EFI_SUCCESS The request succeeded. The requested data was\r | |
1730 | extracted and placed in the newly allocated\r | |
1731 | AltCfgResp buffer.\r | |
1732 | @retval EFI_OUT_OF_RESOURCES Not enough memory to allocate AltCfgResp.\r | |
1733 | @retval EFI_INVALID_PARAMETER Any parameter is invalid.\r | |
1734 | @retval EFI_NOT_FOUND Target for the specified routing data was not\r | |
1735 | found.\r | |
1736 | \r | |
1737 | **/\r | |
1738 | EFI_STATUS\r | |
1739 | EFIAPI\r | |
1740 | HiiGetAltCfg (\r | |
1741 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
1742 | IN CONST EFI_STRING Configuration,\r | |
1743 | IN CONST EFI_GUID *Guid,\r | |
1744 | IN CONST EFI_STRING Name,\r | |
1745 | IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
1746 | IN CONST UINT16 *AltCfgId,\r | |
1747 | OUT EFI_STRING *AltCfgResp\r | |
ed66e1bc | 1748 | );\r |
ac644614 | 1749 | \r |
f324bf4d | 1750 | \r |
1751 | /**\r | |
1752 | Compare whether two names of languages are identical.\r | |
1753 | \r | |
1754 | @param Language1 Name of language 1\r | |
1755 | @param Language2 Name of language 2\r | |
1756 | \r | |
1757 | @retval TRUE same\r | |
1758 | @retval FALSE not same\r | |
1759 | \r | |
1760 | **/\r | |
1761 | BOOLEAN\r | |
1762 | HiiCompareLanguage (\r | |
1763 | IN CHAR8 *Language1,\r | |
1764 | IN CHAR8 *Language2\r | |
1765 | )\r | |
1766 | ;\r | |
1767 | \r | |
ac644614 | 1768 | //\r |
1769 | // Global variables\r | |
1770 | //\r | |
1771 | extern EFI_EVENT gHiiKeyboardLayoutChanged;\r | |
ac644614 | 1772 | #endif\r |