]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/HiiLib.h
HII Library Class interface refine.
[mirror_edk2.git] / MdeModulePkg / Include / Library / HiiLib.h
CommitLineData
4c76e9cc 1/** @file\r
2 Public include file for the HII Library\r
3\r
4 Copyright (c) 2007 - 2008, Intel Corporation \r
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
13**/\r
14\r
15#ifndef __HII_LIB_H__\r
16#define __HII_LIB_H__\r
17\r
18\r
19/**\r
cb7d01c0 20 Registers a list of packages in the HII Database and returns the HII Handle\r
21 associated with that registration. If an HII Handle has already been registered\r
22 with the same PackageListGuid, then NULL is returned. If there are not enough \r
23 resources to perform the registration, then NULL is returned. If an empty list \r
24 of packages is passed in, then NULL is returned. If the size of the list of \r
25 package is 0, then NULL is returned.\r
26\r
27 The variable arguments are pointers which point to package header that defined \r
28 by UEFI VFR compiler and StringGather tool.\r
29\r
30 #pragma pack (push, 1)\r
31 typedef struct {\r
32 UINT32 BinaryLength;\r
33 EFI_HII_PACKAGE_HEADER PackageHeader;\r
34 } EDKII_AUTOGEN_PACKAGES_HEADER;\r
35 #pragma pack (pop)\r
36 \r
37 @param[in] PackageListGuid The GUID of the package list.\r
38 @param[in] DeviceHandle If not NULL, the Device Handle on which \r
39 an instance of DEVICE_PATH_PROTOCOL is installed.\r
40 This Device Handle uniquely defines the device that \r
41 the added packages are associated with.\r
42 @param[in] ... The variable argument list that contains pointers \r
43 to packages terminated by a NULL.\r
44\r
45 @retval NULL A HII Handle has already been registered in the HII Database with\r
46 the same PackageListGuid.\r
47 @retval NULL The HII Handle could not be created.\r
48 @retval NULL An empty list of packages was passed in.\r
49 @retval NULL All packages are empty.\r
50 @retval Other The HII Handle associated with the newly registered package list.\r
4c76e9cc 51\r
52**/\r
cb7d01c0 53EFI_HII_HANDLE\r
4c76e9cc 54EFIAPI\r
cb7d01c0 55HiiAddPackages (\r
56 IN CONST EFI_GUID *PackageListGuid,\r
57 IN EFI_HANDLE DeviceHandle OPTIONAL,\r
4c76e9cc 58 ...\r
b9982883
LG
59 )\r
60;\r
4c76e9cc 61\r
62/**\r
cb7d01c0 63 Removes a package list from the HII database.\r
4c76e9cc 64\r
65 If HiiHandle is NULL, then ASSERT.\r
cb7d01c0 66 If HiiHandle is not a valid EFI_HII_HANDLE in the HII database, then ASSERT.\r
4c76e9cc 67\r
cb7d01c0 68 @param[in] HiiHandle The handle that was previously registered in the HII database\r
4c76e9cc 69\r
70**/\r
71VOID\r
72EFIAPI\r
cb7d01c0 73HiiRemovePackages (\r
4c76e9cc 74 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
75 )\r
76;\r
4c76e9cc 77\r
78/**\r
cb7d01c0 79 This function create a new string in String Package or updates an existing \r
80 string in a String Package. If StringId is 0, then a new string is added to\r
81 a String Package. If StringId is not zero, then a string in String Package is\r
82 updated. If SupportedLanguages is NULL, then the string is added or updated\r
83 for all the languages that the String Package supports. If SupportedLanguages\r
84 is not NULL, then the string is added or updated for the set of languages \r
85 specified by SupportedLanguages.\r
86 \r
87 If HiiHandle is NULL, then ASSERT().\r
88 If String is NULL, then ASSERT().\r
89\r
90 @param[in] HiiHandle A handle that was previously registered in the \r
91 HII Database.\r
92 @param[in] StringId If zero, then a new string is created in the \r
93 String Package associated with HiiHandle. If \r
94 non-zero, then the string specified by StringId \r
95 is updated in the String Package associated \r
96 with HiiHandle. \r
97 @param[in] String A pointer to the Null-terminated Unicode string \r
98 to add or update in the String Package associated \r
99 with HiiHandle.\r
100 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of \r
101 language codes. If this parameter is NULL, then \r
102 String is added or updated in the String Package \r
103 associated with HiiHandle for all the languages \r
104 that the String Package supports. If this \r
105 parameter is not NULL, then then String is added \r
106 or updated in the String Package associated with \r
107 HiiHandle for the set oflanguages specified by \r
108 SupportedLanguages. The format of \r
109 SupportedLanguages must follow the language \r
110 format assumed the HII Database.\r
111\r
112 @retval 0 The string could not be added or updated in the String Package.\r
113 @retval Other The EFI_STRING_ID of the newly added or updated string.\r
4c76e9cc 114\r
115**/\r
cb7d01c0 116EFI_STRING_ID\r
4c76e9cc 117EFIAPI\r
cb7d01c0 118HiiSetString (\r
119 IN EFI_HII_HANDLE HiiHandle,\r
120 IN EFI_STRING_ID StringId, OPTIONAL\r
121 IN CONST EFI_STRING String,\r
122 IN CONST CHAR8 *SupportedLanguages OPTIONAL\r
b9982883
LG
123 )\r
124;\r
4c76e9cc 125\r
126/**\r
cb7d01c0 127 Retrieves a string from a string package in a specific language. If the language\r
128 is not specified, then a string from a string package in the current platform \r
129 language is retrieved. If the string can not be retrieved using the specified \r
130 language or the current platform language, then the string is retrieved from \r
131 the string package in the first language the string package supports. The \r
132 returned string is allocated using AllocatePool(). The caller is responsible \r
133 for freeing the allocated buffer using FreePool().\r
134 \r
135 If HiiHandle is NULL, then ASSERT().\r
136 If StringId is 0, then ASSET.\r
4c76e9cc 137\r
cb7d01c0 138 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
139 @param[in] StringId The identifier of the string to retrieved from the string \r
140 package associated with HiiHandle.\r
141 @param[in] Language The language of the string to retrieve. If this parameter \r
142 is NULL, then the current platform language is used. The \r
143 format of Language must follow the language format assumed \r
144 the HII Database.\r
4c76e9cc 145\r
cb7d01c0 146 @retval NULL The string specified by StringId is not present in the string package.\r
147 @retval Other The string was returned.\r
4c76e9cc 148\r
149**/\r
cb7d01c0 150EFI_STRING\r
4c76e9cc 151EFIAPI\r
cb7d01c0 152HiiGetString (\r
153 IN EFI_HII_HANDLE HiiHandle,\r
154 IN EFI_STRING_ID StringId,\r
155 IN CONST CHAR8 *Language OPTIONAL\r
b9982883
LG
156 )\r
157;\r
4c76e9cc 158\r
159/**\r
cb7d01c0 160 Retrieves a string from a string package names by GUID in a specific language. \r
161 If the language is not specified, then a string from a string package in the \r
162 current platform language is retrieved. If the string can not be retrieved \r
163 using the specified language or the current platform language, then the string \r
164 is retrieved from the string package in the first language the string package \r
165 supports. The returned string is allocated using AllocatePool(). The caller \r
166 is responsible for freeing the allocated buffer using FreePool().\r
167 \r
168 If PackageListGuid is NULL, then ASSERT().\r
169 If StringId is 0, then ASSERT.\r
170\r
171 @param[in] PackageListGuid The GUID of a package list that was previously \r
172 registered in the HII Database.\r
173 @param[in] StringId The identifier of the string to retrieved from the \r
174 string package associated with PackageListGuid.\r
175 @param[in] Language The language of the string to retrieve. If this \r
176 parameter is NULL, then the current platform \r
177 language is used. The format of Language must \r
178 follow the language format assumed the HII Database.\r
179\r
180 @retval NULL The package list specified by PackageListGuid is not present in the\r
181 HII Database.\r
182 @retval NULL The string specified by StringId is not present in the string package.\r
183 @retval Other The string was returned.\r
4c76e9cc 184\r
185**/\r
cb7d01c0 186EFI_STRING\r
4c76e9cc 187EFIAPI\r
cb7d01c0 188HiiGetPackageString (\r
189 IN CONST EFI_GUID *PackageListGuid,\r
190 IN EFI_STRING_ID StringId,\r
191 IN CONST CHAR8 *Language OPTIONAL\r
b9982883
LG
192 )\r
193;\r
4c76e9cc 194\r
195/**\r
cb7d01c0 196 Retrieves the array of all the HII Handles or the HII handle of a specific\r
197 package list in the HII Database.\r
198 This array is terminated with a NULL HII Handle.\r
199 This function allocates the returned array using AllocatePool().\r
200 The caller is responsible for freeing the array with FreePool().\r
201\r
202 @param[in] PackageListGuid An optional parameter that is used to request \r
203 an HII Handle that is associatd with a specific\r
204 Package List GUID. If this parameter is NULL\r
205 then all the HII Handles in the HII Database\r
206 are returned. If this parameter is not NULL\r
207 then at most 1 HII Handle is returned.\r
208\r
209 @retval NULL No HII handles were found in the HII database\r
210 @retval NULL The array of HII Handles could not be retrieved\r
211 @retval Other A pointer to the NULL terminated array of HII Handles\r
4c76e9cc 212\r
213**/\r
cb7d01c0 214EFI_HII_HANDLE *\r
4c76e9cc 215EFIAPI\r
cb7d01c0 216HiiGetHiiHandles (\r
217 IN CONST EFI_GUID *PackageListGuid OPTIONAL\r
b9982883
LG
218 )\r
219;\r
4c76e9cc 220\r
4c76e9cc 221/**\r
222 Get next language from language code list (with separator ';').\r
223\r
224 If LangCode is NULL, then ASSERT.\r
225 If Lang is NULL, then ASSERT.\r
226\r
227 @param LangCode On input: point to first language in the list. On\r
228 output: point to next language in the list, or\r
229 NULL if no more language in the list.\r
230 @param Lang The first language in the list.\r
231\r
232**/\r
233VOID\r
234EFIAPI\r
235HiiLibGetNextLanguage (\r
236 IN OUT CHAR8 **LangCode,\r
237 OUT CHAR8 *Lang\r
b9982883
LG
238 )\r
239;\r
4c76e9cc 240\r
241/**\r
cb7d01c0 242 Retrieves a pointer to the a Null-terminated ASCII string containing the list \r
243 of languages that an HII handle in the HII Database supports. The returned \r
244 string is allocated using AllocatePool(). The caller is responsible for freeing\r
245 the returned string using FreePool(). The format of the returned string follows\r
246 the language format assumed the HII Database.\r
4c76e9cc 247 \r
cb7d01c0 248 If HiiHandle is NULL, then ASSERT().\r
4c76e9cc 249\r
cb7d01c0 250 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
4c76e9cc 251\r
cb7d01c0 252 @retval NULL HiiHandle is not registered in the HII database\r
253 @retval NULL There are not enough resources available to retrieve the suported \r
254 languages.\r
255 @retval NULL The list of suported languages could not be retrieved.\r
256 @retval Other A pointer to the Null-terminated ASCII string of supported languages.\r
4c76e9cc 257\r
258**/\r
cb7d01c0 259CHAR8 *\r
4c76e9cc 260EFIAPI\r
cb7d01c0 261HiiGetSupportedLanguages (\r
4c76e9cc 262 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
263 )\r
264;\r
4c76e9cc 265\r
4c76e9cc 266/**\r
267 Convert language code from RFC3066 to ISO639-2.\r
268\r
269 LanguageRfc3066 contain a single RFC 3066 code such as\r
270 "en-US" or "fr-FR".\r
271\r
272 The LanguageRfc3066 must be a buffer large enough\r
273 for ISO_639_2_ENTRY_SIZE characters.\r
274\r
275 If LanguageRfc3066 is NULL, then ASSERT.\r
276 If LanguageIso639 is NULL, then ASSERT.\r
277\r
278 @param LanguageRfc3066 RFC3066 language code.\r
279 @param LanguageIso639 ISO639-2 language code.\r
280\r
281 @retval EFI_SUCCESS Language code converted.\r
282 @retval EFI_NOT_FOUND Language code not found.\r
283\r
284**/\r
285EFI_STATUS\r
286EFIAPI\r
287ConvertRfc3066LanguageToIso639Language (\r
288 IN CHAR8 *LanguageRfc3066,\r
289 OUT CHAR8 *LanguageIso639\r
b9982883
LG
290 )\r
291;\r
4c76e9cc 292\r
293/**\r
ea7cd3ec 294 Convert language code from ISO639-2 to RFC3066 and return the converted language.\r
295 Caller is responsible for freeing the allocated buffer.\r
4c76e9cc 296\r
297 LanguageIso639 contain a single ISO639-2 code such as\r
298 "eng" or "fra".\r
299\r
4c76e9cc 300 If LanguageIso639 is NULL, then ASSERT.\r
301 If LanguageRfc3066 is NULL, then ASSERT.\r
302\r
303 @param LanguageIso639 ISO639-2 language code.\r
4c76e9cc 304\r
ea7cd3ec 305 @return the allocated buffer or NULL, if the language is not found.\r
4c76e9cc 306\r
307**/\r
ea7cd3ec 308CHAR8*\r
4c76e9cc 309EFIAPI\r
310ConvertIso639LanguageToRfc3066Language (\r
ea7cd3ec 311 IN CONST CHAR8 *LanguageIso639\r
b9982883
LG
312 )\r
313;\r
4c76e9cc 314\r
315/**\r
316 Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will\r
317 be converted to "engfra".\r
318\r
319 If SupportedLanguages is NULL, then ASSERT.\r
320\r
321 @param SupportedLanguages The RFC3066 language list.\r
322\r
323 @return The ISO639-2 language list.\r
324\r
325**/\r
326CHAR8 *\r
327EFIAPI\r
328Rfc3066ToIso639 (\r
329 CHAR8 *SupportedLanguages\r
b9982883
LG
330 )\r
331;\r
4c76e9cc 332\r
7e3bcccb
LG
333\r
334////////////////////////////////////////////////////////\r
335////////////////////////////////////////////////////////\r
336// HiiLib Functions\r
337////////////////////////////////////////////////////////\r
338////////////////////////////////////////////////////////\r
339\r
340/**\r
341 Registers a list of packages in the HII Database and returns the HII Handle\r
342 associated with that registration. If an HII Handle has already been registered\r
343 with the same PackageListGuid, then NULL is returned. If there are not enough \r
344 resources to perform the registration, then NULL is returned. If an empty list \r
345 of packages is passed in, then NULL is returned. If the size of the list of \r
346 package is 0, then NULL is returned.\r
347\r
348 @param[in] PackageListGuid An optional parameter that is used to identify \r
349 the GUID of the package list. If this parameter \r
350 is NULL, then gEfiCallerIdGuid is used.\r
351 @param[in] DeviceHandle Optional. If not NULL, the Device Handle on which \r
352 an instance of DEVICE_PATH_PROTOCOL is installed.\r
353 This Device Handle uniquely defines the device that \r
354 the added packages are associated with.\r
355 @param[in] ... The variable argument list that contains pointers \r
356 to packages terminated by a NULL.\r
357\r
358 @retval NULL A HII Handle has already been registered in the HII Database with\r
359 the same PackageListGuid.\r
360 @retval NULL The HII Handle could not be created.\r
361 @retval Other The HII Handle associated with the newly registered package list.\r
362\r
363**/\r
364EFI_HII_HANDLE\r
365EFIAPI\r
366HiiAddPackages (\r
367 IN CONST EFI_GUID *PackageListGuid, OPTIONAL\r
368 IN EFI_HANDLE DeviceHandle, OPTIONAL\r
369 ...\r
370 );\r
371\r
372/**\r
373 Removes a package list from the HII Database.\r
374\r
375 If HiiHandle is NULL, then ASSERT().\r
376 If HiiHandle is not a valid EFI_HII_HANDLE in the HII Database, then ASSERT().\r
377\r
378 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
379\r
380**/\r
381VOID\r
382EFIAPI\r
383HiiRemovePackages (\r
384 IN EFI_HII_HANDLE HiiHandle\r
385 );\r
386\r
387/**\r
388 Retrieves the array of all the HII Handles in the HII Database.\r
389 This array is terminated with a NULL HII Handle.\r
390 This function allocates the returned array using AllocatePool().\r
391 The caller is responsible for freeing the array with FreePool().\r
392\r
393 @param[in] PackageListGuid An optional parameter that is used to request \r
394 an HII Handle that is associatd with a specific\r
395 Package List GUID. If this parameter is NULL\r
396 then all the HII Handles in the HII Database\r
397 are returned. If this parameter is not NULL\r
398 then at most 1 HII Handle is returned.\r
399\r
400 @retval NULL There are no HII handles in the HII database\r
401 @retval NULL The array of HII Handles could not be retrieved\r
402 @retval Other A pointer to the NULL terminated array of HII Handles\r
403\r
404**/\r
405EFI_HII_HANDLE *\r
406EFIAPI\r
407HiiGetHiiHandles (\r
408 IN CONST EFI_GUID *PackageListGuid OPTIONAL\r
409 );\r
410\r
411/**\r
412 Retrieves a pointer to the a Null-terminated ASCII string containing the list \r
413 of languages that an HII handle in the HII Database supports. The returned \r
414 string is allocated using AllocatePool(). The caller is responsible for freeing\r
415 the returned string using FreePool(). The format of the returned string follows\r
416 the language format assumed the HII Database.\r
417 \r
418 If HiiHandle is NULL, then ASSERT().\r
419\r
420 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
421\r
422 @retval NULL HiiHandle is not registered in the HII database\r
423 @retval NULL There are not enough resources available to retrieve the suported \r
424 languages.\r
425 @retval NULL The list of suported languages could not be retrieved.\r
426 @retval Other A pointer to the Null-terminated ASCII string of supported languages.\r
427\r
428**/\r
429CHAR8 *\r
430EFIAPI\r
431HiiGetSupportedLanguages (\r
432 IN EFI_HII_HANDLE HiiHandle\r
433 );\r
434\r
435/**\r
436 Retrieves a string from a string package in a specific language. If the language\r
437 is not specified, then a string from a string package in the current platform \r
438 language is retrieved. If the string can not be retrieved using the specified \r
439 language or the current platform language, then the string is retrieved from \r
440 the string package in the first language the string package supports. The \r
441 returned string is allocated using AllocatePool(). The caller is responsible \r
442 for freeing the allocated buffer using FreePool().\r
443 \r
444 If HiiHandle is NULL, then ASSERT().\r
445 If StringId is 0, then ASSET.\r
446\r
447 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
448 @param[in] StringId The identifier of the string to retrieved from the string \r
449 package associated with HiiHandle.\r
450 @param[in] Language The language of the string to retrieve. If this parameter \r
451 is NULL, then the current platform language is used. The \r
452 format of Language must follow the language format assumed \r
453 the HII Database.\r
454\r
455 @retval NULL The string specified by StringId is not present in the string package.\r
456 @retval Other The string was returned.\r
457\r
458**/\r
459EFI_STRING\r
460EFIAPI\r
461HiiGetString (\r
462 IN EFI_HII_HANDLE HiiHandle,\r
463 IN EFI_STRING_ID StringId,\r
464 IN CONST CHAR8 *Language OPTIONAL\r
465 );\r
466\r
467/**\r
468 Retrieves a string from a string package names by GUID in a specific language. \r
469 If the language is not specified, then a string from a string package in the \r
470 current platform language is retrieved. If the string can not be retrieved \r
471 using the specified language or the current platform language, then the string \r
472 is retrieved from the string package in the first language the string package \r
473 supports. The returned string is allocated using AllocatePool(). The caller \r
474 is responsible for freeing the allocated buffer using FreePool().\r
475 \r
476 If PackageListGuid is NULL, then ASSERT().\r
477 If StringId is 0, then ASSET.\r
478\r
479 @param[in] PackageListGuid The GUID of a package list that was previously \r
480 registered in the HII Database.\r
481 @param[in] StringId The identifier of the string to retrieved from the \r
482 string package associated with PackageListGuid.\r
483 @param[in] Language The language of the string to retrieve. If this \r
484 parameter is NULL, then the current platform \r
485 language is used. The format of Language must \r
486 follow the language format assumed the HII Database.\r
487\r
488 @retval NULL The package list specified by PackageListGuid is not present in the\r
489 HII Database.\r
490 @retval NULL The string specified by StringId is not present in the string package.\r
491 @retval Other The string was returned.\r
492\r
493**/\r
494EFI_STRING\r
495EFIAPI\r
496HiiGetPackageString (\r
497 IN CONST EFI_GUID *PackageListGuid,\r
498 IN EFI_STRING_ID StringId,\r
499 IN CONST CHAR8 *Language OPTIONAL\r
500 );\r
501\r
502/**\r
503 This function create a new string in String Package or updates an existing \r
504 string in a String Package. If StringId is 0, then a new string is added to\r
505 a String Package. If StringId is not zero, then a string in String Package is\r
506 updated. If SupportedLanguages is NULL, then the string is added or updated\r
507 for all the languages that the String Package supports. If SupportedLanguages\r
508 is not NULL, then the string is added or updated for the set of languages \r
509 specified by SupportedLanguages.\r
510 \r
511 If HiiHandle is NULL, then ASSERT().\r
512 If String is NULL, then ASSERT().\r
513\r
514 @param[in] HiiHandle A handle that was previously registered in the \r
515 HII Database.\r
516 @param[in] StringId If zero, then a new string is created in the \r
517 String Package associated with HiiHandle. If \r
518 non-zero, then the string specified by StringId \r
519 is updated in the String Package associated \r
520 with HiiHandle. \r
521 @param[in] String A pointer to the Null-terminated Unicode string \r
522 to add or update in the String Package associated \r
523 with HiiHandle.\r
524 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of \r
525 language codes. If this parameter is NULL, then \r
526 String is added or updated in the String Package \r
527 associated with HiiHandle for all the languages \r
528 that the String Package supports. If this \r
529 parameter is not NULL, then then String is added \r
530 or updated in the String Package associated with \r
531 HiiHandle for the set oflanguages specified by \r
532 SupportedLanguages. The format of \r
533 SupportedLanguages must follow the language \r
534 format assumed the HII Database.\r
535\r
536 @retval 0 The string could not be added or updated in the String Package.\r
537 @retval Other The EFI_STRING_ID of the newly added or updated string.\r
538\r
539**/\r
540EFI_STRING_ID\r
541EFIAPI\r
542HiiSetString (\r
543 IN EFI_HII_HANDLE HiiHandle,\r
544 IN EFI_STRING_ID StringId, OPTIONAL\r
545 IN CONST EFI_STRING String,\r
546 IN CONST CHAR8 *SupportedLanguages OPTIONAL\r
547 );\r
548\r
549/**\r
550 Validates the config data associated with an HII handle in the HII Database.\r
551 \r
552 If HiiHandle is NULL, then ASSERT().\r
553\r
554 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
555\r
556 @retval TRUE The config data associated with HiiHandle passes all validation\r
557 checks.\r
558 @retval FALSE The config data associated with HiiHandle failed one or more \r
559 validation checks.\r
560\r
561**/\r
562BOOLEAN\r
563EFIAPI\r
564HiiValidateDataFromHiiHandle (\r
565 IN EFI_HII_HANDLE HiiHandle\r
566 );\r
567\r
568/**\r
569 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing \r
570 information that includes a GUID, an optional Unicode string name, and a device\r
571 path. The string returned is allocated with AllocatePool(). The caller is \r
572 responsible for freeing the allocated string with FreePool().\r
573 \r
574 The format of a <ConfigHdr> is as follows:\r
575\r
576 GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize<Null>\r
577\r
578 @param[in] Guid Pointer to an EFI_GUID that is the routing information\r
579 GUID. Each of the 16 bytes in Guid is converted to \r
580 a 2 Unicode character hexidecimal string. This is \r
581 an optional parameter that may be NULL.\r
582 @param[in] Name Pointer to a Null-terminated Unicode string that is \r
583 the routing information NAME. This is an optional \r
584 parameter that may be NULL. Each 16-bit Unicode \r
585 character in Name is converted to a 4 character Unicode \r
586 hexidecimal string. \r
587 @param[in] DriverHandle The driver handle which supports a Device Path Protocol\r
588 that is the routing information PATH. Each byte of\r
589 the Device Path associated with DriverHandle is converted\r
590 to a 2 Unicode character hexidecimal string.\r
591\r
592 @retval NULL DriverHandle does not support the Device Path Protocol.\r
593 @retval NULL DriverHandle does not support the Device Path Protocol.\r
594 @retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string\r
595\r
596**/\r
597EFI_STRING\r
598EFIAPI\r
599HiiConstructConfigHdr (\r
600 IN CONST EFI_GUID *Guid, OPTIONAL\r
601 IN CONST CHAR16 *Name, OPTIONAL\r
602 IN EFI_HANDLE DriverHandle\r
603 );\r
604\r
605/**\r
606 Allocates and returns a Null-terminated Unicode <ConfigAltResp> string.\r
607\r
608 If Guid is NULL, then ASSERT().\r
609 If Name is NULL, then ASSERT().\r
610 If BlockNameArray is NULL, then ASSERT().\r
611\r
612 @param[in] Guid GUID of the buffer storage.\r
613 @param[in] Name Name of the buffer storage.\r
614 @param[in] DriverHandle The DriverHandle that support a Device Path\r
615 Protocol. \r
616 @param[in] BufferStorage Content of the buffer storage.\r
617 @param[in] BufferStorageSize Length in bytes of the buffer storage.\r
618 @param[in] BlockNameArray Array generated by VFR compiler. This array\r
619 contains a UINT32 value that is the length\r
620 of BlockNameArray in bytes, followed by pairs\r
621 of 16-bit values that are the offset and length\r
622 values used to contruct a <ConfigRequest> string.\r
623 @param[in] ... A variable argument list that contains pairs of 16-bit\r
624 ALTCFG identifiers and pointers to DefaultValueArrays.\r
625 The variable argument list is terminated by a NULL \r
626 DefaultValueArray pointer. A DefaultValueArray \r
627 contains a UINT32 value that is the length, in bytes,\r
628 of the DefaultValueArray. The UINT32 length value \r
629 is followed by a series of records that contain\r
630 a 16-bit WIDTH value followed by a byte array with \r
631 WIDTH entries. The records must be parsed from\r
632 beginning to end until the UINT32 length limit\r
633 is reached. \r
634\r
635 @retval NULL There are not enough resources to process the request.\r
636 @retval NULL A <ConfigResp> could not be retrieved from the Config \r
637 Routing Protocol.\r
638 @retval Other A pointer to the Null-terminate Unicode <ConfigAltResp>\r
639 string.\r
640\r
641**/\r
642EFI_STRING\r
643EFIAPI\r
644HiiConstructConfigAltResp (\r
645 IN CONST EFI_GUID *Guid,\r
646 IN CONST CHAR16 *Name,\r
647 IN EFI_HANDLE DriverHandle,\r
648 IN CONST VOID *BufferStorage,\r
649 IN UINTN BufferStorageSize,\r
650 IN CONST VOID *BlockNameArray, \r
651 ...\r
652 );\r
653\r
654/**\r
655 Determines if the routing data specified by GUID and NAME match a <ConfigHdr>.\r
656\r
657 If ConfigHdr is NULL, then ASSERT().\r
658\r
659 @param[in] ConfigHdr Either <ConfigRequest> or <ConfigResp>.\r
660 @param[in] Guid GUID of the storage.\r
661 @param[in] Name NAME of the storage.\r
662\r
663 @retval TRUE Routing information matches <ConfigHdr>.\r
664 @retval FALSE Routing information does not match <ConfigHdr>.\r
665\r
666**/\r
667BOOLEAN\r
668EFIAPI\r
669HiiIsConfigHdrMatch (\r
670 IN CONST EFI_STRING ConfigHdr,\r
671 IN CONST EFI_GUID *Guid, OPTIONAL\r
672 IN CONST CHAR16 *Name OPTIONAL\r
673 );\r
674\r
675/**\r
676 Retrieves uncommited data from the Form Browser and converts it to a binary\r
677 buffer. The returned buffer is allocated using AllocatePool(). The caller\r
678 is responsible for freeing the returned buffer using FreePool().\r
679\r
680 @param[in] VariableName Pointer to a Null-terminated Unicode string. This \r
681 is an optional parameter that may be NULL.\r
682 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional \r
683 parameter that may be NULL.\r
684 @param[in] BufferSize Length in bytes of buffer to hold retrived data. \r
685\r
686 @retval NULL The uncommitted data could not be retrieved.\r
687 @retval Other A pointer to a buffer containing the uncommitted data.\r
688\r
689**/\r
690UINT8 *\r
691EFIAPI\r
692HiiGetBrowserData (\r
693 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
694 IN CONST CHAR16 *VariableName, OPTIONAL\r
695 IN UINTN BlockSize\r
696 );\r
697\r
698/**\r
699 Updates uncommitted data in the Form Browser.\r
700\r
701 If Buffer is NULL, then ASSERT().\r
702\r
703 @param[in] VariableName Pointer to a Null-terminated Unicode string. This\r
704 is an optional parameter that may be NULL.\r
705 @param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional\r
706 parameter that may be NULL.\r
707 @param[in] BufferSize Length, in bytes, of Buffer.\r
708 @param[in] Buffer Buffer of data to commit.\r
709 @param[in] RequestElement An optional field to specify which part of the\r
710 buffer data will be send back to Browser. If NULL,\r
711 the whole buffer of data will be committed to\r
712 Browser. \r
713 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*\r
714\r
715 @retval FALSE The uncommitted data could not be updated.\r
716 @retval TRUE The uncommitted data was updated.\r
717\r
718**/\r
719BOOLEAN\r
720EFIAPI\r
721HiiSetBrowserData (\r
722 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
723 IN CONST CHAR16 *VariableName, OPTIONAL\r
724 IN UINTN BufferSize,\r
725 IN CONST UINT8 *Buffer,\r
726 IN CONST CHAR16 *RequestElement OPTIONAL\r
727 );\r
728\r
729/////////////////////////////////////////\r
730/////////////////////////////////////////\r
731/// IFR Functions\r
732/////////////////////////////////////////\r
733/////////////////////////////////////////\r
734\r
735/**\r
736 Returns a UINT64 value that contains bitfields for Hour, Minute, and Second.\r
737 The lower 8-bits of Hour are placed in bits 0..7. The lower 8-bits of Minute \r
738 are placed in bits 8..15, and the lower 8-bits of Second are placed in bits \r
739 16..23. This format is selected because it can be easily translated to \r
740 an EFI_HII_TIME structure in an EFI_IFR_TYPE_VALUE union.\r
741\r
742 @param Hour The hour value to be encoded.\r
743 @param Minute The miniute value to be encoded.\r
744 @param Second The second value to be encoded.\r
745\r
746 @return A 64-bit containing Hour, Minute, and Second.\r
747**/\r
748#define EFI_HII_TIME_UINT64(Hour, Minute, Second) \\r
749 (UINT64)((Hour & 0xff) | ((Minute & 0xff) << 8) | ((Second & 0xff) << 16))\r
750\r
751/**\r
752 Returns a UINT64 value that contains bitfields for Year, Month, and Day.\r
753 The lower 16-bits of Year are placed in bits 0..15. The lower 8-bits of Month \r
754 are placed in bits 16..23, and the lower 8-bits of Day are placed in bits \r
755 24..31. This format is selected because it can be easily translated to \r
756 an EFI_HII_DATE structure in an EFI_IFR_TYPE_VALUE union.\r
757\r
758 @param Year The year value to be encoded.\r
759 @param Month The month value to be encoded.\r
760 @param Day The day value to be encoded.\r
761\r
762 @return A 64-bit containing Year, Month, and Day.\r
763**/\r
764#define EFI_HII_DATE_UINT64(Year, Month, Day) \\r
765 (UINT64)((Year & 0xffff) | ((Month & 0xff) << 16) | ((Day & 0xff) << 24))\r
766\r
767/**\r
768 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with \r
769 HiiFreeOpCodeHandle().\r
770\r
771 @retval NULL There are not enough resources to allocate a new OpCode Handle.\r
772 @retval Other A new OpCode handle.\r
773\r
774**/\r
775VOID *\r
776EFIAPI\r
777HiiAllocateOpCodeHandle (\r
778 VOID\r
779 );\r
780\r
781/**\r
782 Frees an OpCode Handle that was peviously allocated with HiiAllocateOpCodeHandle().\r
783 When an OpCode Handle is freed, all of the opcodes associated with the OpCode\r
784 Handle are also freed.\r
785\r
786 If OpCodeHandle is NULL, then ASSERT().\r
787\r
788**/\r
789VOID\r
790EFIAPI\r
791HiiFreeOpCodeHandle (\r
792 VOID *OpCodeHandle\r
793 );\r
794\r
795/**\r
796 Create EFI_IFR_END_OP opcode.\r
797\r
798 If OpCodeHandle is NULL, then ASSERT().\r
799\r
800 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
801\r
802 @retval NULL There is not enough space left in Buffer to add the opcode.\r
803 @retval Other A pointer to the created opcode.\r
804\r
805**/\r
806UINT8 *\r
807EFIAPI\r
808HiiCreateEndOpCode (\r
809 IN VOID *OpCodeHandle\r
810 );\r
811\r
812/**\r
813 Create EFI_IFR_ONE_OF_OPTION_OP opcode.\r
814\r
815 If OpCodeHandle is NULL, then ASSERT().\r
816 If Type is invalid, then ASSERT().\r
817 If Flags is invalid, then ASSERT().\r
818\r
819 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
820 @param[in] StringId StringId for the option\r
821 @param[in] Flags Flags for the option\r
822 @param[in] Type Type for the option\r
823 @param[in] Value Value for the option\r
824\r
825 @retval NULL There is not enough space left in Buffer to add the opcode.\r
826 @retval Other A pointer to the created opcode.\r
827\r
828**/\r
829UINT8 *\r
830EFIAPI\r
831HiiCreateOneOfOptionOpCode (\r
832 IN VOID *OpCodeHandle,\r
833 IN UINT16 StringId,\r
834 IN UINT8 Flags,\r
835 IN UINT8 Type,\r
836 IN UINT64 Value\r
837 );\r
838\r
839/**\r
840 Create EFI_IFR_DEFAULT_OP opcode.\r
841\r
842 If OpCodeHandle is NULL, then ASSERT().\r
843 If Type is invalid, then ASSERT().\r
844\r
845 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
846 @param[in] DefaultId DefaultId for the default\r
847 @param[in] Type Type for the default\r
848 @param[in] Value Value for the default\r
849\r
850 @retval NULL There is not enough space left in Buffer to add the opcode.\r
851 @retval Other A pointer to the created opcode.\r
852\r
853**/\r
854UINT8 *\r
855EFIAPI\r
856HiiCreateDefaultOpCode (\r
857 IN VOID *OpCodeHandle,\r
858 IN UINT16 DefaultId,\r
859 IN UINT8 Type,\r
860 IN UINT64 Value\r
861 );\r
862\r
863/**\r
864 Create EFI_IFR_GUID opcode.\r
865\r
866 If OpCodeHandle is NULL, then ASSERT().\r
867 If Guid is NULL, then ASSERT().\r
868 If OpCodeSize < sizeof (EFI_IFR_GUID), then ASSERT().\r
869\r
870 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
871 @param[in] Guid Pointer to EFI_GUID of this guided opcode.\r
872 @param[in] GuidOpCode Pointer to an EFI_IFR_GUID opcode. This is an \r
873 optional parameter that may be NULL. If this\r
874 parameter is NULL, then the GUID extension \r
875 region of the created opcode is filled with zeros.\r
876 If this parameter is not NULL, then the GUID \r
877 extension region of GuidData will be copied to \r
878 the GUID extension region of the created opcode.\r
879 @param[in] OpCodeSize The size, in bytes, of created opcode. This value \r
880 must be >= sizeof(EFI_IFR_GUID).\r
881\r
882 @retval NULL There is not enough space left in Buffer to add the opcode.\r
883 @retval Other A pointer to the created opcode.\r
884\r
885**/\r
886UINT8 *\r
887EFIAPI\r
888HiiCreateGuidOpCode (\r
889 IN VOID *OpCodeHandle,\r
890 IN CONST EFI_GUID *Guid,\r
891 IN CONST VOID *GuidOpCode, OPTIONAL\r
892 IN UINTN OpCodeSize\r
893 );\r
894\r
895/**\r
896 Create EFI_IFR_ACTION_OP opcode.\r
897\r
898 If OpCodeHandle is NULL, then ASSERT().\r
899 If any reserved bits are set in QuestionFlags, then ASSERT().\r
900\r
901 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
902 @param[in] QuestionId Question ID\r
903 @param[in] Prompt String ID for Prompt\r
904 @param[in] Help String ID for Help\r
905 @param[in] QuestionFlags Flags in Question Header\r
906 @param[in] QuestionConfig String ID for configuration\r
907\r
908 @retval NULL There is not enough space left in Buffer to add the opcode.\r
909 @retval Other A pointer to the created opcode.\r
910\r
911**/\r
912UINT8 *\r
913EFIAPI\r
914HiiCreateActionOpCode (\r
915 IN VOID *OpCodeHandle,\r
916 IN EFI_QUESTION_ID QuestionId,\r
917 IN EFI_STRING_ID Prompt,\r
918 IN EFI_STRING_ID Help,\r
919 IN UINT8 QuestionFlags,\r
920 IN EFI_STRING_ID QuestionConfig\r
921 );\r
922\r
923/**\r
924 Create EFI_IFR_SUBTITLE_OP opcode.\r
925\r
926 If OpCodeHandle is NULL, then ASSERT().\r
927 If any reserved bits are set in Flags, then ASSERT().\r
928 If Scope > 1, then ASSERT().\r
929\r
930 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
931 @param[in] Prompt String ID for Prompt\r
932 @param[in] Help String ID for Help\r
933 @param[in] Flags Subtitle opcode flags\r
934 @param[in] Scope 1 if this opcpde is the beginning of a new scope.\r
935 0 if this opcode is within the current scope.\r
936\r
937 @retval NULL There is not enough space left in Buffer to add the opcode.\r
938 @retval Other A pointer to the created opcode.\r
939\r
940**/\r
941UINT8 *\r
942EFIAPI\r
943HiiCreateSubTitleOpCode (\r
944 IN VOID *OpCodeHandle,\r
945 IN EFI_STRING_ID Prompt,\r
946 IN EFI_STRING_ID Help,\r
947 IN UINT8 Flags,\r
948 IN UINT8 Scope\r
949 );\r
950\r
951/**\r
952 Create EFI_IFR_REF_OP opcode.\r
953\r
954 If OpCodeHandle is NULL, then ASSERT().\r
955 If any reserved bits are set in QuestionFlags, then ASSERT().\r
956\r
957 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
958 @param[in] FormId Destination Form ID\r
959 @param[in] Prompt String ID for Prompt\r
960 @param[in] Help String ID for Help\r
961 @param[in] QuestionFlags Flags in Question Header\r
962 @param[in] QuestionId Question ID\r
963\r
964 @retval NULL There is not enough space left in Buffer to add the opcode.\r
965 @retval Other A pointer to the created opcode.\r
966\r
967**/\r
968UINT8 *\r
969EFIAPI\r
970HiiCreateGotoOpCode (\r
971 IN VOID *OpCodeHandle,\r
972 IN EFI_FORM_ID FormId,\r
973 IN EFI_STRING_ID Prompt,\r
974 IN EFI_STRING_ID Help,\r
975 IN UINT8 QuestionFlags,\r
976 IN EFI_QUESTION_ID QuestionId\r
977 );\r
978\r
979/**\r
980 Create EFI_IFR_CHECKBOX_OP opcode.\r
981\r
982 If OpCodeHandle is NULL, then ASSERT().\r
983 If any reserved bits are set in QuestionFlags, then ASSERT().\r
984 If any reserved bits are set in CheckBoxFlags, then ASSERT().\r
985\r
986 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
987 @param[in] QuestionId Question ID\r
988 @param[in] VarStoreId Storage ID\r
989 @param[in] VarOffset Offset in Storage\r
990 @param[in] Prompt String ID for Prompt\r
991 @param[in] Help String ID for Help\r
992 @param[in] QuestionFlags Flags in Question Header\r
993 @param[in] CheckBoxFlags Flags for checkbox opcode\r
994 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
995 is an optional parameter that may be NULL.\r
996\r
997 @retval NULL There is not enough space left in Buffer to add the opcode.\r
998 @retval Other A pointer to the created opcode.\r
999\r
1000**/\r
1001UINT8 *\r
1002EFIAPI\r
1003HiiCreateCheckBoxOpCode (\r
1004 IN VOID *OpCodeHandle,\r
1005 IN EFI_QUESTION_ID QuestionId,\r
1006 IN EFI_VARSTORE_ID VarStoreId,\r
1007 IN UINT16 VarOffset,\r
1008 IN EFI_STRING_ID Prompt,\r
1009 IN EFI_STRING_ID Help,\r
1010 IN UINT8 QuestionFlags,\r
1011 IN UINT8 CheckBoxFlags,\r
1012 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1013 );\r
1014\r
1015/**\r
1016 Create EFI_IFR_NUMERIC_OP opcode.\r
1017\r
1018 If OpCodeHandle is NULL, then ASSERT().\r
1019 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1020 If any reserved bits are set in NumericFlags, then ASSERT().\r
1021\r
1022 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1023 @param[in] QuestionId Question ID\r
1024 @param[in] VarStoreId Storage ID\r
1025 @param[in] VarOffset Offset in Storage\r
1026 @param[in] Prompt String ID for Prompt\r
1027 @param[in] Help String ID for Help\r
1028 @param[in] QuestionFlags Flags in Question Header\r
1029 @param[in] NumericFlags Flags for numeric opcode\r
1030 @param[in] Minimum Numeric minimum value\r
1031 @param[in] Maximum Numeric maximum value\r
1032 @param[in] Step Numeric step for edit\r
1033 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1034 is an optional parameter that may be NULL.\r
1035\r
1036 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1037 @retval Other A pointer to the created opcode.\r
1038\r
1039**/\r
1040UINT8 *\r
1041EFIAPI\r
1042HiiCreateNumericOpCode (\r
1043 IN VOID *OpCodeHandle,\r
1044 IN EFI_QUESTION_ID QuestionId,\r
1045 IN EFI_VARSTORE_ID VarStoreId,\r
1046 IN UINT16 VarOffset,\r
1047 IN EFI_STRING_ID Prompt,\r
1048 IN EFI_STRING_ID Help,\r
1049 IN UINT8 QuestionFlags,\r
1050 IN UINT8 NumericFlags,\r
1051 IN UINT64 Minimum,\r
1052 IN UINT64 Maximum,\r
1053 IN UINT64 Step,\r
1054 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1055 );\r
1056\r
1057/**\r
1058 Create EFI_IFR_STRING_OP opcode.\r
1059\r
1060 If OpCodeHandle is NULL, then ASSERT().\r
1061 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1062 If any reserved bits are set in StringFlags, then ASSERT().\r
1063\r
1064 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1065 @param[in] QuestionId Question ID\r
1066 @param[in] VarStoreId Storage ID\r
1067 @param[in] VarOffset Offset in Storage\r
1068 @param[in] Prompt String ID for Prompt\r
1069 @param[in] Help String ID for Help\r
1070 @param[in] QuestionFlags Flags in Question Header\r
1071 @param[in] StringFlags Flags for string opcode\r
1072 @param[in] MinSize String minimum length\r
1073 @param[in] MaxSize String maximum length\r
1074 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1075 is an optional parameter that may be NULL.\r
1076\r
1077 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1078 @retval Other A pointer to the created opcode.\r
1079\r
1080**/\r
1081UINT8 *\r
1082EFIAPI\r
1083HiiCreateStringOpCode (\r
1084 IN VOID *OpCodeHandle,\r
1085 IN EFI_QUESTION_ID QuestionId,\r
1086 IN EFI_VARSTORE_ID VarStoreId,\r
1087 IN UINT16 VarOffset,\r
1088 IN EFI_STRING_ID Prompt,\r
1089 IN EFI_STRING_ID Help,\r
1090 IN UINT8 QuestionFlags,\r
1091 IN UINT8 StringFlags,\r
1092 IN UINT8 MinSize,\r
1093 IN UINT8 MaxSize,\r
1094 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1095 );\r
1096\r
1097/**\r
1098 Create EFI_IFR_ONE_OF_OP opcode.\r
1099\r
1100 If OpCodeHandle is NULL, then ASSERT().\r
1101 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1102 If any reserved bits are set in OneOfFlags, then ASSERT().\r
1103\r
1104 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1105 @param[in] QuestionId Question ID\r
1106 @param[in] VarStoreId Storage ID\r
1107 @param[in] VarOffset Offset in Storage\r
1108 @param[in] Prompt String ID for Prompt\r
1109 @param[in] Help String ID for Help\r
1110 @param[in] QuestionFlags Flags in Question Header\r
1111 @param[in] OneOfFlags Flags for oneof opcode\r
1112 @param[in] OptionsOpCodeHandle Handle for a buffer of ONE_OF_OPTION opcodes.\r
1113 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1114 is an optional parameter that may be NULL.\r
1115\r
1116 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1117 @retval Other A pointer to the created opcode.\r
1118\r
1119**/\r
1120UINT8 *\r
1121EFIAPI\r
1122HiiCreateOneOfOpCode (\r
1123 IN VOID *OpCodeHandle,\r
1124 IN EFI_QUESTION_ID QuestionId,\r
1125 IN EFI_VARSTORE_ID VarStoreId,\r
1126 IN UINT16 VarOffset,\r
1127 IN EFI_STRING_ID Prompt,\r
1128 IN EFI_STRING_ID Help,\r
1129 IN UINT8 QuestionFlags,\r
1130 IN UINT8 OneOfFlags,\r
1131 IN VOID *OptionsOpCodeHandle,\r
1132 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1133 );\r
1134\r
1135/**\r
1136 Create EFI_IFR_ORDERED_LIST_OP opcode.\r
1137\r
1138 If OpCodeHandle is NULL, then ASSERT().\r
1139 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1140 If any reserved bits are set in OrderedListFlags, then ASSERT().\r
1141\r
1142 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1143 @param[in] QuestionId Question ID\r
1144 @param[in] VarStoreId Storage ID\r
1145 @param[in] VarOffset Offset in Storage\r
1146 @param[in] Prompt String ID for Prompt\r
1147 @param[in] Help String ID for Help\r
1148 @param[in] QuestionFlags Flags in Question Header\r
1149 @param[in] OrderedListFlags Flags for ordered list opcode\r
1150 @param[in] DataType Type for option value\r
1151 @param[in] MaxContainers Maximum count for options in this ordered list\r
1152 @param[in] OptionsOpCodeHandle Handle for a buffer of ONE_OF_OPTION opcodes.\r
1153 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1154 is an optional parameter that may be NULL.\r
1155\r
1156 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1157 @retval Other A pointer to the created opcode.\r
1158\r
1159**/\r
1160UINT8 *\r
1161EFIAPI\r
1162HiiCreateOrderedListOpCode (\r
1163 IN VOID *OpCodeHandle,\r
1164 IN EFI_QUESTION_ID QuestionId,\r
1165 IN EFI_VARSTORE_ID VarStoreId,\r
1166 IN UINT16 VarOffset,\r
1167 IN EFI_STRING_ID Prompt,\r
1168 IN EFI_STRING_ID Help,\r
1169 IN UINT8 QuestionFlags,\r
1170 IN UINT8 OrderedListFlags,\r
1171 IN UINT8 DataType,\r
1172 IN UINT8 MaxContainers,\r
1173 IN VOID *OptionsOpCodeHandle,\r
1174 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1175 );\r
1176\r
1177/**\r
1178 This function updates a form that has previously been registered with the HII \r
1179 Database. This function will perform at most one update operation.\r
1180 \r
1181 The form to update is specified by Handle, FormSetGuid, and FormId. Binary \r
1182 comparisons of IFR opcodes are performed from the beginning of the form being \r
1183 updated until an IFR opcode is found that exactly matches the first IFR opcode \r
1184 specifed by StartOpCodeHandle. The following rules are used to determine if\r
1185 an insert, replace, or delete operation is performed.\r
1186 \r
1187 1) If no matches are found, then NULL is returned. \r
1188 2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes\r
1189 from StartOpcodeHandle except the first opcode are inserted immediately after \r
1190 the matching IFR opcode in the form beng updated.\r
1191 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made \r
1192 from the matching IFR opcode until an IFR opcode exatly matches the first \r
1193 IFR opcode specified by EndOpCodeHandle. If no match is found for the first\r
1194 IFR opcode specified by EndOpCodeHandle, then NULL is returned. If a match\r
1195 is found, then all of the IFR opcodes between the start match and the end \r
1196 match are deleted from the form being updated and all of the IFR opcodes\r
1197 from StartOpcodeHandle except the first opcode are inserted immediately after \r
1198 the matching start IFR opcode. If StartOpCcodeHandle only contains one\r
1199 IFR instruction, then the result of ths operation will delete all of the IFR\r
1200 opcodes between the start end matches.\r
1201\r
1202 If HiiHandle is NULL, then ASSERT().\r
1203 If StartOpCodeHandle is NULL, then ASSERT().\r
1204\r
1205 @param[in] HiiHandle The HII Handle of the form to update.\r
1206 @param[in] FormSetGuid The Formset GUID of the form to update. This\r
1207 is an optional parameter that may be NULL.\r
1208 If it is NULL, all FormSet will be updated.\r
1209 @param[in] FormId The ID of the form to update.\r
1210 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR \r
1211 opcodes to be inserted or replaced in the form.\r
1212 The first IFR instruction in StartOpCodeHandle \r
1213 is used to find matching IFR opcode in the \r
1214 form. \r
1215 @param[in] EndOpCodeHandle An OpCcode Handle that contains the IFR opcode\r
1216 that marks the end of a replace operation in\r
1217 the form. This is an optional parameter that\r
1218 may be NULL. If it is NULL, then an the IFR\r
1219 opcodes specified by StartOpCodeHandle are \r
1220 inserted into the form.\r
1221 \r
1222 @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated.\r
1223 @retval EFI_NOT_FOUND The following cases will return EFI_NOT_FOUND.\r
1224 1) The form specified by HiiHandle, FormSetGuid, \r
1225 and FormId could not be found in the HII Database.\r
1226 2) No IFR opcodes in the target form match the first\r
1227 IFR opcode in StartOpCodeHandle.\r
1228 3) EndOpCOde is not NULL, and no IFR opcodes in the \r
1229 target form following a matching start opcode match \r
1230 the first IFR opcode in EndOpCodeHandle.\r
1231 @retval EFI_SUCCESS The matched form is updated by StartOpcode.\r
1232\r
1233**/\r
1234EFI_STATUS\r
1235EFIAPI\r
1236HiiUpdateForm (\r
1237 IN EFI_HII_HANDLE HiiHandle,\r
1238 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1239 IN EFI_FORM_ID FormId,\r
1240 IN VOID *StartOpcodeHandle,\r
1241 IN VOID *EndOpcodeHandle OPTIONAL\r
1242 );\r
1243\r
1244/**\r
1245 Configure the buffer accrording to ConfigBody strings in the format of\r
1246 <Length:4 bytes>, <Offset: 2 bytes>, <Width:2 bytes>, <Data:n bytes>.\r
1247 This ConfigBody strings is generated by EDKII UEFI VfrCompiler for the default\r
1248 values in a Form Set. The name of the ConfigBody strings is VfrMyIfrNVDataDefault0000\r
1249 constructed following this rule: \r
1250 "Vfr" + varstore.name + "Default" + defaultstore.attributes.\r
1251 Check the generated C file in Output for details.\r
1252\r
1253 @param Buffer the start address of buffer.\r
1254 @param BufferSize the size of buffer.\r
1255 @param Number the number of the ConfigBody strings.\r
1256 @param ... the ConfigBody strings\r
1257\r
1258 @retval EFI_BUFFER_TOO_SMALL the BufferSize is too small to operate.\r
1259 @retval EFI_INVALID_PARAMETER Buffer is NULL or BufferSize is 0.\r
1260 @retval EFI_SUCCESS Operation successful.\r
1261\r
1262**/\r
1263EFI_STATUS\r
1264EFIAPI\r
3c7449e4 1265HiiIfrLibExtractDefault(\r
7e3bcccb
LG
1266 IN VOID *Buffer,\r
1267 IN UINTN *BufferSize,\r
1268 UINTN Number,\r
1269 ...\r
1270 );\r
1271\r
4c76e9cc 1272#endif\r