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