]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/HiiLib.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Library / HiiLib.h
CommitLineData
4c76e9cc 1/** @file\r
2 Public include file for the HII Library\r
3\r
d1102dba 4Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
4c76e9cc 6\r
7**/\r
8\r
9#ifndef __HII_LIB_H__\r
10#define __HII_LIB_H__\r
11\r
33ae1b2d 12////////////////////////////////////////////////////////\r
13////////////////////////////////////////////////////////\r
14// HiiLib Functions\r
15////////////////////////////////////////////////////////\r
16////////////////////////////////////////////////////////\r
4c76e9cc 17\r
18/**\r
cb7d01c0 19 Registers a list of packages in the HII Database and returns the HII Handle\r
20 associated with that registration. If an HII Handle has already been registered\r
aa2614b7 21 with the same PackageListGuid and DeviceHandle, then NULL is returned. If there\r
22 are not enough resources to perform the registration, then NULL is returned.\r
23 If an empty list of packages is passed in, then NULL is returned. If the size of\r
24 the list of package is 0, then NULL is returned.\r
cb7d01c0 25\r
d1102dba 26 The variable arguments are pointers that point to package headers defined\r
cb7d01c0 27 by UEFI VFR compiler and StringGather tool.\r
28\r
29 #pragma pack (push, 1)\r
30 typedef struct {\r
31 UINT32 BinaryLength;\r
32 EFI_HII_PACKAGE_HEADER PackageHeader;\r
33 } EDKII_AUTOGEN_PACKAGES_HEADER;\r
34 #pragma pack (pop)\r
d1102dba 35\r
cb7d01c0 36 @param[in] PackageListGuid The GUID of the package list.\r
d1102dba 37 @param[in] DeviceHandle If not NULL, the Device Handle on which\r
cb7d01c0 38 an instance of DEVICE_PATH_PROTOCOL is installed.\r
d1102dba 39 This Device Handle uniquely defines the device that\r
cb7d01c0 40 the added packages are associated with.\r
d1102dba 41 @param[in] ... The variable argument list that contains pointers\r
cb7d01c0 42 to packages terminated by a NULL.\r
43\r
64a80549 44 @retval NULL An HII Handle has already been registered in the HII Database with\r
9c6595dc 45 the same PackageListGuid and DeviceHandle.\r
cb7d01c0 46 @retval NULL The HII Handle could not be created.\r
47 @retval NULL An empty list of packages was passed in.\r
48 @retval NULL All packages are empty.\r
49 @retval Other The HII Handle associated with the newly registered package list.\r
4c76e9cc 50\r
51**/\r
cb7d01c0 52EFI_HII_HANDLE\r
4c76e9cc 53EFIAPI\r
cb7d01c0 54HiiAddPackages (\r
55 IN CONST EFI_GUID *PackageListGuid,\r
56 IN EFI_HANDLE DeviceHandle OPTIONAL,\r
4c76e9cc 57 ...\r
b9982883
LG
58 )\r
59;\r
4c76e9cc 60\r
61/**\r
cb7d01c0 62 Removes a package list from the HII database.\r
4c76e9cc 63\r
e9b67286 64 If HiiHandle is NULL, then ASSERT().\r
65 If HiiHandle is not a valid EFI_HII_HANDLE in the HII database, then ASSERT().\r
4c76e9cc 66\r
cb7d01c0 67 @param[in] HiiHandle The handle that was previously registered in the HII database\r
4c76e9cc 68\r
69**/\r
70VOID\r
71EFIAPI\r
cb7d01c0 72HiiRemovePackages (\r
4c76e9cc 73 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
74 )\r
75;\r
4c76e9cc 76\r
77/**\r
d1102dba 78 This function creates a new string in String Package or updates an existing\r
cb7d01c0 79 string in a String Package. If StringId is 0, then a new string is added to\r
80 a String Package. If StringId is not zero, then a string in String Package is\r
81 updated. If SupportedLanguages is NULL, then the string is added or updated\r
82 for all the languages that the String Package supports. If SupportedLanguages\r
d1102dba 83 is not NULL, then the string is added or updated for the set of languages\r
cb7d01c0 84 specified by SupportedLanguages.\r
d1102dba 85\r
cb7d01c0 86 If HiiHandle is NULL, then ASSERT().\r
87 If String is NULL, then ASSERT().\r
88\r
d1102dba 89 @param[in] HiiHandle A handle that was previously registered in the\r
cb7d01c0 90 HII Database.\r
d1102dba
LG
91 @param[in] StringId If zero, then a new string is created in the\r
92 String Package associated with HiiHandle. If\r
93 non-zero, then the string specified by StringId\r
94 is updated in the String Package associated\r
cb7d01c0 95 with HiiHandle.\r
d1102dba
LG
96 @param[in] String A pointer to the Null-terminated Unicode string\r
97 to add or update in the String Package associated\r
98 with HiiHandle.\r
99 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of\r
100 language codes. If this parameter is NULL, then\r
101 String is added or updated in the String Package\r
102 associated with HiiHandle for all the languages\r
103 that the String Package supports. If this\r
104 parameter is not NULL, then String is added\r
105 or updated in the String Package associated with\r
106 HiiHandle for the set of languages specified by\r
107 SupportedLanguages. The format of\r
108 SupportedLanguages must follow the language\r
e9b67286 109 format assumed in the HII Database.\r
cb7d01c0 110\r
111 @retval 0 The string could not be added or updated in the String Package.\r
112 @retval Other The EFI_STRING_ID of the newly added or updated string.\r
4c76e9cc 113\r
114**/\r
cb7d01c0 115EFI_STRING_ID\r
4c76e9cc 116EFIAPI\r
cb7d01c0 117HiiSetString (\r
118 IN EFI_HII_HANDLE HiiHandle,\r
119 IN EFI_STRING_ID StringId, OPTIONAL\r
120 IN CONST EFI_STRING String,\r
121 IN CONST CHAR8 *SupportedLanguages OPTIONAL\r
b9982883
LG
122 )\r
123;\r
4c76e9cc 124\r
125/**\r
cb7d01c0 126 Retrieves a string from a string package in a specific language. If the language\r
d1102dba
LG
127 is not specified, then a string from a string package in the current platform\r
128 language is retrieved. If the string cannot be retrieved using the specified\r
129 language or the current platform language, then the string is retrieved from\r
130 the string package in the first language the string package supports. The\r
131 returned string is allocated using AllocatePool(). The caller is responsible\r
cb7d01c0 132 for freeing the allocated buffer using FreePool().\r
d1102dba 133\r
cb7d01c0 134 If HiiHandle is NULL, then ASSERT().\r
e9b67286 135 If StringId is 0, then ASSERT().\r
4c76e9cc 136\r
cb7d01c0 137 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
d1102dba 138 @param[in] StringId The identifier of the string to retrieved from the string\r
cb7d01c0 139 package associated with HiiHandle.\r
d1102dba
LG
140 @param[in] Language The language of the string to retrieve. If this parameter\r
141 is NULL, then the current platform language is used. The\r
e9b67286 142 format of Language must follow the language format assumed in\r
cb7d01c0 143 the HII Database.\r
4c76e9cc 144\r
cb7d01c0 145 @retval NULL The string specified by StringId is not present in the string package.\r
146 @retval Other The string was returned.\r
4c76e9cc 147\r
148**/\r
cb7d01c0 149EFI_STRING\r
4c76e9cc 150EFIAPI\r
cb7d01c0 151HiiGetString (\r
152 IN EFI_HII_HANDLE HiiHandle,\r
153 IN EFI_STRING_ID StringId,\r
154 IN CONST CHAR8 *Language OPTIONAL\r
b9982883
LG
155 )\r
156;\r
4c76e9cc 157\r
158/**\r
d1102dba
LG
159 Retrieves a string from a string package named by GUID, in the specified language.\r
160 If the language is not specified, then a string from a string package in the\r
161 current platform language is retrieved. If the string cannot be retrieved\r
162 using the specified language or the current platform language, then the string\r
163 is retrieved from the string package in the first language the string package\r
164 supports. The returned string is allocated using AllocatePool(). The caller\r
cb7d01c0 165 is responsible for freeing the allocated buffer using FreePool().\r
d1102dba 166\r
cb7d01c0 167 If PackageListGuid is NULL, then ASSERT().\r
e9b67286 168 If StringId is 0, then ASSERT().\r
cb7d01c0 169\r
d1102dba 170 @param[in] PackageListGuid The GUID of a package list that was previously\r
cb7d01c0 171 registered in the HII Database.\r
d1102dba 172 @param[in] StringId The identifier of the string to retrieved from the\r
cb7d01c0 173 string package associated with PackageListGuid.\r
d1102dba
LG
174 @param[in] Language The language of the string to retrieve. If this\r
175 parameter is NULL, then the current platform\r
176 language is used. The format of Language must\r
e9b67286 177 follow the language format assumed in the HII Database.\r
cb7d01c0 178\r
179 @retval NULL The package list specified by PackageListGuid is not present in the\r
180 HII Database.\r
181 @retval NULL The string specified by StringId is not present in the string package.\r
182 @retval Other The string was returned.\r
4c76e9cc 183\r
184**/\r
cb7d01c0 185EFI_STRING\r
4c76e9cc 186EFIAPI\r
cb7d01c0 187HiiGetPackageString (\r
188 IN CONST EFI_GUID *PackageListGuid,\r
189 IN EFI_STRING_ID StringId,\r
190 IN CONST CHAR8 *Language OPTIONAL\r
b9982883
LG
191 )\r
192;\r
4c76e9cc 193\r
194/**\r
7992c0b0 195 Retrieves the array of all the HII Handles or the HII handles of a specific\r
196 package list GUID in the HII Database.\r
cb7d01c0 197 This array is terminated with a NULL HII Handle.\r
198 This function allocates the returned array using AllocatePool().\r
199 The caller is responsible for freeing the array with FreePool().\r
200\r
d1102dba 201 @param[in] PackageListGuid An optional parameter that is used to request\r
7992c0b0 202 HII Handles associated with a specific\r
e9b67286 203 Package List GUID. If this parameter is NULL,\r
cb7d01c0 204 then all the HII Handles in the HII Database\r
e9b67286 205 are returned. If this parameter is not NULL,\r
d1102dba 206 then zero or more HII Handles associated with\r
7992c0b0 207 PackageListGuid are returned.\r
cb7d01c0 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
8a458283
DB
221/**\r
222 This function allows a caller to extract the form set opcode form the Hii Handle.\r
d1102dba 223 The returned buffer is allocated using AllocatePool().The caller is responsible\r
8a458283
DB
224 for freeing the allocated buffer using FreePool().\r
225\r
226 @param Handle The HII handle.\r
86ac8fb2 227 @param Buffer On return, points to a pointer which point to the buffer that contain the formset opcode.\r
8a458283
DB
228 @param BufferSize On return, points to the length of the buffer.\r
229\r
230 @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated.\r
231 @retval EFI_NOT_FOUND Can't find the package data for the input Handle.\r
232 @retval EFI_INVALID_PARAMETER The input parameters are not correct.\r
86ac8fb2 233 @retval EFI_SUCCESS Get the formset opcode from the hii handle successfully.\r
8a458283
DB
234\r
235**/\r
236EFI_STATUS\r
237EFIAPI\r
238HiiGetFormSetFromHiiHandle(\r
239 IN EFI_HII_HANDLE Handle,\r
240 OUT EFI_IFR_FORM_SET **Buffer,\r
241 OUT UINTN *BufferSize\r
242 );\r
243\r
4c76e9cc 244/**\r
d1102dba
LG
245 Retrieves a pointer to a Null-terminated ASCII string containing the list\r
246 of languages that an HII handle in the HII Database supports. The returned\r
cb7d01c0 247 string is allocated using AllocatePool(). The caller is responsible for freeing\r
248 the returned string using FreePool(). The format of the returned string follows\r
e9b67286 249 the language format assumed in the HII Database.\r
d1102dba 250\r
cb7d01c0 251 If HiiHandle is NULL, then ASSERT().\r
4c76e9cc 252\r
cb7d01c0 253 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
4c76e9cc 254\r
cb7d01c0 255 @retval NULL HiiHandle is not registered in the HII database\r
86ac8fb2 256 @retval NULL There are not enough resources available to retrieve the supported\r
cb7d01c0 257 languages.\r
86ac8fb2 258 @retval NULL The list of supported languages could not be retrieved.\r
cb7d01c0 259 @retval Other A pointer to the Null-terminated ASCII string of supported languages.\r
4c76e9cc 260\r
261**/\r
cb7d01c0 262CHAR8 *\r
4c76e9cc 263EFIAPI\r
cb7d01c0 264HiiGetSupportedLanguages (\r
4c76e9cc 265 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
266 )\r
267;\r
4c76e9cc 268\r
7e3bcccb 269/**\r
d1102dba 270 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing\r
7e3bcccb 271 information that includes a GUID, an optional Unicode string name, and a device\r
d1102dba 272 path. The string returned is allocated with AllocatePool(). The caller is\r
7e3bcccb 273 responsible for freeing the allocated string with FreePool().\r
d1102dba 274\r
7e3bcccb
LG
275 The format of a <ConfigHdr> is as follows:\r
276\r
277 GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize<Null>\r
278\r
64a80549 279 @param[in] Guid The pointer to an EFI_GUID that is the routing information\r
d1102dba 280 GUID. Each of the 16 bytes in Guid is converted to\r
86ac8fb2 281 a 2 Unicode character hexadecimal string. This is\r
7e3bcccb 282 an optional parameter that may be NULL.\r
d1102dba
LG
283 @param[in] Name The pointer to a Null-terminated Unicode string that is\r
284 the routing information NAME. This is an optional\r
285 parameter that may be NULL. Each 16-bit Unicode\r
286 character in Name is converted to a 4 character Unicode\r
86ac8fb2 287 hexadecimal string.\r
64a80549 288 @param[in] DriverHandle The driver handle that supports a Device Path Protocol\r
7e3bcccb
LG
289 that is the routing information PATH. Each byte of\r
290 the Device Path associated with DriverHandle is converted\r
86ac8fb2 291 to a two (Unicode) character hexadecimal string.\r
7e3bcccb
LG
292\r
293 @retval NULL DriverHandle does not support the Device Path Protocol.\r
294 @retval NULL DriverHandle does not support the Device Path Protocol.\r
295 @retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string\r
296\r
297**/\r
298EFI_STRING\r
299EFIAPI\r
300HiiConstructConfigHdr (\r
301 IN CONST EFI_GUID *Guid, OPTIONAL\r
302 IN CONST CHAR16 *Name, OPTIONAL\r
303 IN EFI_HANDLE DriverHandle\r
304 );\r
305\r
84f9a9ec 306/**\r
84f9a9ec 307 Reset the default value specified by DefaultId to the driver\r
d1102dba 308 configuration specified by the Request string.\r
76c24251
LG
309\r
310 NULL request string support depends on the ExportConfig interface of\r
84f9a9ec 311 HiiConfigRouting protocol in UEFI specification.\r
d1102dba
LG
312\r
313 @param Request A null-terminated Unicode string in\r
76c24251 314 <MultiConfigRequest> format. It can be NULL.\r
64a80549 315 If it is NULL, all configurations for the\r
76c24251
LG
316 entirety of the current HII database will be reset.\r
317 @param DefaultId Specifies the type of defaults to retrieve.\r
d1102dba 318\r
86ac8fb2 319 @retval TRUE The default value was set successfully.\r
e9b67286 320 @retval FALSE The default value was not found.\r
84f9a9ec
LG
321**/\r
322BOOLEAN\r
d1102dba
LG
323EFIAPI\r
324HiiSetToDefaults (\r
e40b7d5d
LG
325 IN CONST EFI_STRING Request, OPTIONAL\r
326 IN UINT16 DefaultId\r
84f9a9ec
LG
327 );\r
328\r
329/**\r
e9b67286 330 Validate the current configuration by parsing the IFR opcode in HII form.\r
84f9a9ec 331\r
4e069e8b 332 NULL request string support depends on the ExportConfig interface of\r
e9b67286 333 HiiConfigRouting protocol in the UEFI specification.\r
d1102dba
LG
334\r
335 @param Request A null-terminated Unicode string in\r
76c24251 336 <MultiConfigRequest> format. It can be NULL.\r
e9b67286 337 If it is NULL, all current configurations for the\r
76c24251 338 entirety of the current HII database will be validated.\r
d1102dba 339\r
9035e118 340 @retval TRUE The current configuration is valid.\r
64a80549 341 @retval FALSE The current configuration is invalid.\r
84f9a9ec
LG
342**/\r
343BOOLEAN\r
d1102dba 344EFIAPI\r
84f9a9ec 345HiiValidateSettings (\r
e40b7d5d 346 IN CONST EFI_STRING Request OPTIONAL\r
84f9a9ec
LG
347 );\r
348\r
7e3bcccb
LG
349/**\r
350 Determines if the routing data specified by GUID and NAME match a <ConfigHdr>.\r
351\r
352 If ConfigHdr is NULL, then ASSERT().\r
353\r
354 @param[in] ConfigHdr Either <ConfigRequest> or <ConfigResp>.\r
64a80549 355 @param[in] Guid The GUID of the storage.\r
356 @param[in] Name The NAME of the storage.\r
7e3bcccb
LG
357\r
358 @retval TRUE Routing information matches <ConfigHdr>.\r
359 @retval FALSE Routing information does not match <ConfigHdr>.\r
360\r
361**/\r
362BOOLEAN\r
363EFIAPI\r
364HiiIsConfigHdrMatch (\r
365 IN CONST EFI_STRING ConfigHdr,\r
366 IN CONST EFI_GUID *Guid, OPTIONAL\r
367 IN CONST CHAR16 *Name OPTIONAL\r
368 );\r
369\r
370/**\r
e9b67286 371 Retrieves uncommitted data from the Form Browser and converts it to a binary\r
1d451ff9 372 buffer.\r
7e3bcccb 373\r
d1102dba 374 @param[in] VariableGuid The pointer to an EFI_GUID structure. This is an optional\r
7e3bcccb 375 parameter that may be NULL.\r
d1102dba 376 @param[in] VariableName The pointer to a Null-terminated Unicode string. This\r
84213069 377 is an optional parameter that may be NULL.\r
d1102dba 378 @param[in] BufferSize The length in bytes of buffer to hold retrieved data.\r
64a80549 379 @param[out] Buffer The buffer of data to be updated.\r
7e3bcccb 380\r
1d451ff9
LG
381 @retval FALSE The uncommitted data could not be retrieved.\r
382 @retval TRUE The uncommitted data was retrieved.\r
7e3bcccb
LG
383\r
384**/\r
1d451ff9 385BOOLEAN\r
7e3bcccb
LG
386EFIAPI\r
387HiiGetBrowserData (\r
388 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
389 IN CONST CHAR16 *VariableName, OPTIONAL\r
84213069
LG
390 IN UINTN BufferSize,\r
391 OUT UINT8 *Buffer\r
7e3bcccb
LG
392 );\r
393\r
394/**\r
395 Updates uncommitted data in the Form Browser.\r
396\r
397 If Buffer is NULL, then ASSERT().\r
398\r
64a80549 399 @param[in] VariableGuid The pointer to an EFI_GUID structure. This is an optional\r
7e3bcccb 400 parameter that may be NULL.\r
64a80549 401 @param[in] VariableName The pointer to a Null-terminated Unicode string. This\r
84213069 402 is an optional parameter that may be NULL.\r
64a80549 403 @param[in] BufferSize The length, in bytes, of Buffer.\r
404 @param[in] Buffer The buffer of data to commit.\r
7e3bcccb
LG
405 @param[in] RequestElement An optional field to specify which part of the\r
406 buffer data will be send back to Browser. If NULL,\r
407 the whole buffer of data will be committed to\r
d1102dba 408 Browser.\r
7e3bcccb
LG
409 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*\r
410\r
411 @retval FALSE The uncommitted data could not be updated.\r
412 @retval TRUE The uncommitted data was updated.\r
413\r
414**/\r
415BOOLEAN\r
416EFIAPI\r
417HiiSetBrowserData (\r
418 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
419 IN CONST CHAR16 *VariableName, OPTIONAL\r
420 IN UINTN BufferSize,\r
421 IN CONST UINT8 *Buffer,\r
422 IN CONST CHAR16 *RequestElement OPTIONAL\r
423 );\r
424\r
425/////////////////////////////////////////\r
426/////////////////////////////////////////\r
427/// IFR Functions\r
428/////////////////////////////////////////\r
429/////////////////////////////////////////\r
430\r
431/**\r
432 Returns a UINT64 value that contains bitfields for Hour, Minute, and Second.\r
d1102dba
LG
433 The lower 8-bits of Hour are placed in bits 0..7. The lower 8-bits of Minute\r
434 are placed in bits 8..15, and the lower 8-bits of Second are placed in bits\r
435 16..23. This format was selected because it can be easily translated to\r
7e3bcccb
LG
436 an EFI_HII_TIME structure in an EFI_IFR_TYPE_VALUE union.\r
437\r
438 @param Hour The hour value to be encoded.\r
e9b67286 439 @param Minute The minute value to be encoded.\r
7e3bcccb
LG
440 @param Second The second value to be encoded.\r
441\r
442 @return A 64-bit containing Hour, Minute, and Second.\r
443**/\r
444#define EFI_HII_TIME_UINT64(Hour, Minute, Second) \\r
445 (UINT64)((Hour & 0xff) | ((Minute & 0xff) << 8) | ((Second & 0xff) << 16))\r
446\r
447/**\r
84213069 448 Returns a UINT64 value that contains bit fields for Year, Month, and Day.\r
d1102dba
LG
449 The lower 16-bits of Year are placed in bits 0..15. The lower 8-bits of Month\r
450 are placed in bits 16..23, and the lower 8-bits of Day are placed in bits\r
451 24..31. This format was selected because it can be easily translated to\r
7e3bcccb
LG
452 an EFI_HII_DATE structure in an EFI_IFR_TYPE_VALUE union.\r
453\r
454 @param Year The year value to be encoded.\r
455 @param Month The month value to be encoded.\r
456 @param Day The day value to be encoded.\r
457\r
458 @return A 64-bit containing Year, Month, and Day.\r
459**/\r
460#define EFI_HII_DATE_UINT64(Year, Month, Day) \\r
461 (UINT64)((Year & 0xffff) | ((Month & 0xff) << 16) | ((Day & 0xff) << 24))\r
462\r
463/**\r
d1102dba 464 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with\r
7e3bcccb
LG
465 HiiFreeOpCodeHandle().\r
466\r
467 @retval NULL There are not enough resources to allocate a new OpCode Handle.\r
468 @retval Other A new OpCode handle.\r
469\r
470**/\r
471VOID *\r
472EFIAPI\r
473HiiAllocateOpCodeHandle (\r
474 VOID\r
475 );\r
476\r
477/**\r
84213069 478 Frees an OpCode Handle that was previously allocated with HiiAllocateOpCodeHandle().\r
7e3bcccb
LG
479 When an OpCode Handle is freed, all of the opcodes associated with the OpCode\r
480 Handle are also freed.\r
481\r
482 If OpCodeHandle is NULL, then ASSERT().\r
483\r
64a80549 484 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
84213069 485\r
7e3bcccb
LG
486**/\r
487VOID\r
488EFIAPI\r
489HiiFreeOpCodeHandle (\r
490 VOID *OpCodeHandle\r
491 );\r
492\r
278663ab
LG
493/**\r
494 Append raw opcodes to an OpCodeHandle.\r
495\r
496 If OpCodeHandle is NULL, then ASSERT().\r
497 If RawBuffer is NULL, then ASSERT();\r
498\r
64a80549 499 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
500 @param[in] RawBuffer The buffer of opcodes to append.\r
278663ab
LG
501 @param[in] RawBufferSize The size, in bytes, of Buffer.\r
502\r
503 @retval NULL There is not enough space left in Buffer to add the opcode.\r
504 @retval Other A pointer to the appended opcodes.\r
505\r
506**/\r
507UINT8 *\r
508EFIAPI\r
509HiiCreateRawOpCodes (\r
510 IN VOID *OpCodeHandle,\r
511 IN UINT8 *RawBuffer,\r
512 IN UINTN RawBufferSize\r
513 );\r
514\r
7e3bcccb
LG
515/**\r
516 Create EFI_IFR_END_OP opcode.\r
517\r
518 If OpCodeHandle is NULL, then ASSERT().\r
519\r
520 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
521\r
522 @retval NULL There is not enough space left in Buffer to add the opcode.\r
523 @retval Other A pointer to the created opcode.\r
524\r
525**/\r
526UINT8 *\r
527EFIAPI\r
528HiiCreateEndOpCode (\r
529 IN VOID *OpCodeHandle\r
530 );\r
531\r
532/**\r
533 Create EFI_IFR_ONE_OF_OPTION_OP opcode.\r
534\r
535 If OpCodeHandle is NULL, then ASSERT().\r
536 If Type is invalid, then ASSERT().\r
537 If Flags is invalid, then ASSERT().\r
538\r
64a80549 539 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
540 @param[in] StringId StringId for the option.\r
541 @param[in] Flags The flags for the option.\r
542 @param[in] Type The type for the option.\r
543 @param[in] Value The value for the option.\r
7e3bcccb
LG
544\r
545 @retval NULL There is not enough space left in Buffer to add the opcode.\r
546 @retval Other A pointer to the created opcode.\r
547\r
548**/\r
549UINT8 *\r
550EFIAPI\r
551HiiCreateOneOfOptionOpCode (\r
552 IN VOID *OpCodeHandle,\r
553 IN UINT16 StringId,\r
554 IN UINT8 Flags,\r
555 IN UINT8 Type,\r
556 IN UINT64 Value\r
557 );\r
558\r
559/**\r
560 Create EFI_IFR_DEFAULT_OP opcode.\r
561\r
562 If OpCodeHandle is NULL, then ASSERT().\r
563 If Type is invalid, then ASSERT().\r
564\r
64a80549 565 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
566 @param[in] DefaultId The DefaultId for the default.\r
567 @param[in] Type The type for the default.\r
568 @param[in] Value The value for the default.\r
7e3bcccb
LG
569\r
570 @retval NULL There is not enough space left in Buffer to add the opcode.\r
571 @retval Other A pointer to the created opcode.\r
572\r
573**/\r
574UINT8 *\r
575EFIAPI\r
576HiiCreateDefaultOpCode (\r
577 IN VOID *OpCodeHandle,\r
578 IN UINT16 DefaultId,\r
579 IN UINT8 Type,\r
580 IN UINT64 Value\r
581 );\r
582\r
583/**\r
584 Create EFI_IFR_GUID opcode.\r
585\r
586 If OpCodeHandle is NULL, then ASSERT().\r
587 If Guid is NULL, then ASSERT().\r
588 If OpCodeSize < sizeof (EFI_IFR_GUID), then ASSERT().\r
589\r
64a80549 590 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
591 @param[in] Guid The pointer to EFI_GUID of this guided opcode.\r
d1102dba 592 @param[in] GuidOpCode The pointer to an EFI_IFR_GUID opcode. This is an\r
7e3bcccb 593 optional parameter that may be NULL. If this\r
d1102dba 594 parameter is NULL, then the GUID extension\r
7e3bcccb 595 region of the created opcode is filled with zeros.\r
d1102dba
LG
596 If this parameter is not NULL, then the GUID\r
597 extension region of GuidData will be copied to\r
7e3bcccb 598 the GUID extension region of the created opcode.\r
d1102dba 599 @param[in] OpCodeSize The size, in bytes, of created opcode. This value\r
7e3bcccb
LG
600 must be >= sizeof(EFI_IFR_GUID).\r
601\r
602 @retval NULL There is not enough space left in Buffer to add the opcode.\r
603 @retval Other A pointer to the created opcode.\r
604\r
605**/\r
606UINT8 *\r
607EFIAPI\r
608HiiCreateGuidOpCode (\r
609 IN VOID *OpCodeHandle,\r
610 IN CONST EFI_GUID *Guid,\r
611 IN CONST VOID *GuidOpCode, OPTIONAL\r
612 IN UINTN OpCodeSize\r
613 );\r
614\r
615/**\r
616 Create EFI_IFR_ACTION_OP opcode.\r
617\r
618 If OpCodeHandle is NULL, then ASSERT().\r
619 If any reserved bits are set in QuestionFlags, then ASSERT().\r
620\r
64a80549 621 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
622 @param[in] QuestionId The Question ID.\r
623 @param[in] Prompt The String ID for Prompt.\r
624 @param[in] Help The String ID for Help.\r
625 @param[in] QuestionFlags The flags in the Question Header.\r
626 @param[in] QuestionConfig The String ID for the configuration.\r
7e3bcccb
LG
627\r
628 @retval NULL There is not enough space left in Buffer to add the opcode.\r
629 @retval Other A pointer to the created opcode.\r
630\r
631**/\r
632UINT8 *\r
633EFIAPI\r
634HiiCreateActionOpCode (\r
635 IN VOID *OpCodeHandle,\r
636 IN EFI_QUESTION_ID QuestionId,\r
637 IN EFI_STRING_ID Prompt,\r
638 IN EFI_STRING_ID Help,\r
639 IN UINT8 QuestionFlags,\r
640 IN EFI_STRING_ID QuestionConfig\r
641 );\r
642\r
643/**\r
644 Create EFI_IFR_SUBTITLE_OP opcode.\r
645\r
646 If OpCodeHandle is NULL, then ASSERT().\r
647 If any reserved bits are set in Flags, then ASSERT().\r
648 If Scope > 1, then ASSERT().\r
649\r
64a80549 650 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
651 @param[in] Prompt The string ID for Prompt.\r
652 @param[in] Help The string ID for Help.\r
653 @param[in] Flags The subtitle opcode flags.\r
84213069 654 @param[in] Scope 1 if this opcode is the beginning of a new scope.\r
7e3bcccb
LG
655 0 if this opcode is within the current scope.\r
656\r
657 @retval NULL There is not enough space left in Buffer to add the opcode.\r
658 @retval Other A pointer to the created opcode.\r
659\r
660**/\r
661UINT8 *\r
662EFIAPI\r
663HiiCreateSubTitleOpCode (\r
664 IN VOID *OpCodeHandle,\r
665 IN EFI_STRING_ID Prompt,\r
666 IN EFI_STRING_ID Help,\r
667 IN UINT8 Flags,\r
668 IN UINT8 Scope\r
669 );\r
670\r
671/**\r
672 Create EFI_IFR_REF_OP opcode.\r
673\r
674 If OpCodeHandle is NULL, then ASSERT().\r
675 If any reserved bits are set in QuestionFlags, then ASSERT().\r
676\r
64a80549 677 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
678 @param[in] FormId The Destination Form ID.\r
679 @param[in] Prompt The string ID for Prompt.\r
680 @param[in] Help The string ID for Help.\r
681 @param[in] QuestionFlags The flags in Question Header\r
682 @param[in] QuestionId Question ID.\r
7e3bcccb
LG
683\r
684 @retval NULL There is not enough space left in Buffer to add the opcode.\r
685 @retval Other A pointer to the created opcode.\r
686\r
687**/\r
688UINT8 *\r
689EFIAPI\r
690HiiCreateGotoOpCode (\r
691 IN VOID *OpCodeHandle,\r
692 IN EFI_FORM_ID FormId,\r
693 IN EFI_STRING_ID Prompt,\r
694 IN EFI_STRING_ID Help,\r
695 IN UINT8 QuestionFlags,\r
696 IN EFI_QUESTION_ID QuestionId\r
697 );\r
698\r
e8654a1a
LG
699/**\r
700 Create EFI_IFR_REF_OP, EFI_IFR_REF2_OP, EFI_IFR_REF3_OP and EFI_IFR_REF4_OP opcode.\r
701\r
d1102dba 702 When RefDevicePath is not zero, EFI_IFR_REF4 opcode will be created.\r
e8654a1a
LG
703 When RefDevicePath is zero and RefFormSetId is not NULL, EFI_IFR_REF3 opcode will be created.\r
704 When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is not zero, EFI_IFR_REF2 opcode will be created.\r
705 When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is zero, EFI_IFR_REF opcode will be created.\r
706\r
707 If OpCodeHandle is NULL, then ASSERT().\r
708 If any reserved bits are set in QuestionFlags, then ASSERT().\r
709\r
710 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
711 @param[in] RefFormId The Destination Form ID.\r
712 @param[in] Prompt The string ID for Prompt.\r
713 @param[in] Help The string ID for Help.\r
714 @param[in] QuestionFlags The flags in Question Header\r
715 @param[in] QuestionId Question ID.\r
d1102dba 716 @param[in] RefQuestionId The question on the form to which this link is referring.\r
e8654a1a 717 If its value is zero, then the link refers to the top of the form.\r
d1102dba 718 @param[in] RefFormSetId The form set to which this link is referring. If its value is NULL, and RefDevicePath is\r
e8654a1a 719 zero, then the link is to the current form set.\r
d1102dba 720 @param[in] RefDevicePath The string identifier that specifies the string containing the text representation of\r
e8654a1a
LG
721 the device path to which the form set containing the form specified by FormId.\r
722 If its value is zero, then the link refers to the current page.\r
723\r
724 @retval NULL There is not enough space left in Buffer to add the opcode.\r
725 @retval Other A pointer to the created opcode.\r
726\r
727**/\r
728UINT8 *\r
729EFIAPI\r
730HiiCreateGotoExOpCode (\r
731 IN VOID *OpCodeHandle,\r
732 IN EFI_FORM_ID RefFormId,\r
733 IN EFI_STRING_ID Prompt,\r
734 IN EFI_STRING_ID Help,\r
735 IN UINT8 QuestionFlags,\r
736 IN EFI_QUESTION_ID QuestionId,\r
737 IN EFI_QUESTION_ID RefQuestionId,\r
738 IN EFI_GUID *RefFormSetId, OPTIONAL\r
739 IN EFI_STRING_ID RefDevicePath\r
740 );\r
741\r
7e3bcccb
LG
742/**\r
743 Create EFI_IFR_CHECKBOX_OP opcode.\r
744\r
745 If OpCodeHandle is NULL, then ASSERT().\r
746 If any reserved bits are set in QuestionFlags, then ASSERT().\r
747 If any reserved bits are set in CheckBoxFlags, then ASSERT().\r
748\r
64a80549 749 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
750 @param[in] QuestionId The question ID.\r
751 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
752 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
753 for this name/value pair.\r
64a80549 754 @param[in] Prompt The string ID for Prompt.\r
755 @param[in] Help The string ID for Help.\r
756 @param[in] QuestionFlags The flags in Question Header.\r
757 @param[in] CheckBoxFlags The flags for checkbox opcode.\r
758 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
759 is an optional parameter that may be NULL.\r
760\r
761 @retval NULL There is not enough space left in Buffer to add the opcode.\r
762 @retval Other A pointer to the created opcode.\r
763\r
764**/\r
765UINT8 *\r
766EFIAPI\r
767HiiCreateCheckBoxOpCode (\r
768 IN VOID *OpCodeHandle,\r
769 IN EFI_QUESTION_ID QuestionId,\r
770 IN EFI_VARSTORE_ID VarStoreId,\r
771 IN UINT16 VarOffset,\r
772 IN EFI_STRING_ID Prompt,\r
773 IN EFI_STRING_ID Help,\r
774 IN UINT8 QuestionFlags,\r
775 IN UINT8 CheckBoxFlags,\r
776 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
777 );\r
778\r
779/**\r
780 Create EFI_IFR_NUMERIC_OP opcode.\r
781\r
782 If OpCodeHandle is NULL, then ASSERT().\r
783 If any reserved bits are set in QuestionFlags, then ASSERT().\r
784 If any reserved bits are set in NumericFlags, then ASSERT().\r
785\r
64a80549 786 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
787 @param[in] QuestionId The question ID.\r
788 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
789 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
790 for this name/value pair.\r
64a80549 791 @param[in] Prompt The string ID for Prompt.\r
792 @param[in] Help The string ID for Help.\r
793 @param[in] QuestionFlags The flags in Question Header.\r
794 @param[in] NumericFlags The flags for a numeric opcode.\r
795 @param[in] Minimum The numeric minimum value.\r
796 @param[in] Maximum The numeric maximum value.\r
797 @param[in] Step The numeric step for edit.\r
798 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
799 is an optional parameter that may be NULL.\r
800\r
801 @retval NULL There is not enough space left in Buffer to add the opcode.\r
802 @retval Other A pointer to the created opcode.\r
803\r
804**/\r
805UINT8 *\r
806EFIAPI\r
807HiiCreateNumericOpCode (\r
808 IN VOID *OpCodeHandle,\r
809 IN EFI_QUESTION_ID QuestionId,\r
810 IN EFI_VARSTORE_ID VarStoreId,\r
811 IN UINT16 VarOffset,\r
812 IN EFI_STRING_ID Prompt,\r
813 IN EFI_STRING_ID Help,\r
814 IN UINT8 QuestionFlags,\r
815 IN UINT8 NumericFlags,\r
816 IN UINT64 Minimum,\r
817 IN UINT64 Maximum,\r
818 IN UINT64 Step,\r
819 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
820 );\r
821\r
822/**\r
823 Create EFI_IFR_STRING_OP opcode.\r
824\r
825 If OpCodeHandle is NULL, then ASSERT().\r
826 If any reserved bits are set in QuestionFlags, then ASSERT().\r
827 If any reserved bits are set in StringFlags, then ASSERT().\r
828\r
64a80549 829 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
830 @param[in] QuestionId The question ID.\r
831 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
832 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
833 for this name/value pair.\r
64a80549 834 @param[in] Prompt The string ID for Prompt.\r
835 @param[in] Help The string ID for Help.\r
836 @param[in] QuestionFlags The flags in Question Header.\r
837 @param[in] StringFlags The flags for a string opcode.\r
838 @param[in] MinSize The string minimum length.\r
839 @param[in] MaxSize The string maximum length.\r
840 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
841 is an optional parameter that may be NULL.\r
842\r
843 @retval NULL There is not enough space left in Buffer to add the opcode.\r
844 @retval Other A pointer to the created opcode.\r
845\r
846**/\r
847UINT8 *\r
848EFIAPI\r
849HiiCreateStringOpCode (\r
850 IN VOID *OpCodeHandle,\r
851 IN EFI_QUESTION_ID QuestionId,\r
852 IN EFI_VARSTORE_ID VarStoreId,\r
853 IN UINT16 VarOffset,\r
854 IN EFI_STRING_ID Prompt,\r
855 IN EFI_STRING_ID Help,\r
856 IN UINT8 QuestionFlags,\r
857 IN UINT8 StringFlags,\r
858 IN UINT8 MinSize,\r
859 IN UINT8 MaxSize,\r
860 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
861 );\r
862\r
863/**\r
864 Create EFI_IFR_ONE_OF_OP opcode.\r
865\r
866 If OpCodeHandle is NULL, then ASSERT().\r
867 If any reserved bits are set in QuestionFlags, then ASSERT().\r
868 If any reserved bits are set in OneOfFlags, then ASSERT().\r
869\r
64a80549 870 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
871 @param[in] QuestionId The question ID.\r
872 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
873 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
874 for this name/value pair.\r
64a80549 875 @param[in] Prompt The string ID for Prompt.\r
876 @param[in] Help The string ID for Help.\r
877 @param[in] QuestionFlags The flags in Question Header.\r
878 @param[in] OneOfFlags The flags for a oneof opcode.\r
879 @param[in] OptionsOpCodeHandle The handle for a buffer of ONE_OF_OPTION opcodes.\r
880 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
881 is an optional parameter that may be NULL.\r
882\r
883 @retval NULL There is not enough space left in Buffer to add the opcode.\r
884 @retval Other A pointer to the created opcode.\r
885\r
886**/\r
887UINT8 *\r
888EFIAPI\r
889HiiCreateOneOfOpCode (\r
890 IN VOID *OpCodeHandle,\r
891 IN EFI_QUESTION_ID QuestionId,\r
892 IN EFI_VARSTORE_ID VarStoreId,\r
893 IN UINT16 VarOffset,\r
894 IN EFI_STRING_ID Prompt,\r
895 IN EFI_STRING_ID Help,\r
896 IN UINT8 QuestionFlags,\r
897 IN UINT8 OneOfFlags,\r
898 IN VOID *OptionsOpCodeHandle,\r
899 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
900 );\r
901\r
902/**\r
903 Create EFI_IFR_ORDERED_LIST_OP opcode.\r
904\r
905 If OpCodeHandle is NULL, then ASSERT().\r
906 If any reserved bits are set in QuestionFlags, then ASSERT().\r
907 If any reserved bits are set in OrderedListFlags, then ASSERT().\r
908\r
64a80549 909 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
910 @param[in] QuestionId The question ID.\r
911 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
912 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
913 for this name/value pair.\r
64a80549 914 @param[in] Prompt The string ID for Prompt.\r
915 @param[in] Help The string ID for Help.\r
916 @param[in] QuestionFlags The flags in Question Header.\r
917 @param[in] OrderedListFlags The flags for an ordered list opcode.\r
918 @param[in] DataType The type for option value.\r
7e3bcccb 919 @param[in] MaxContainers Maximum count for options in this ordered list\r
64a80549 920 @param[in] OptionsOpCodeHandle The handle for a buffer of ONE_OF_OPTION opcodes.\r
7e3bcccb
LG
921 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
922 is an optional parameter that may be NULL.\r
923\r
924 @retval NULL There is not enough space left in Buffer to add the opcode.\r
925 @retval Other A pointer to the created opcode.\r
926\r
927**/\r
928UINT8 *\r
929EFIAPI\r
930HiiCreateOrderedListOpCode (\r
931 IN VOID *OpCodeHandle,\r
932 IN EFI_QUESTION_ID QuestionId,\r
933 IN EFI_VARSTORE_ID VarStoreId,\r
934 IN UINT16 VarOffset,\r
935 IN EFI_STRING_ID Prompt,\r
936 IN EFI_STRING_ID Help,\r
937 IN UINT8 QuestionFlags,\r
938 IN UINT8 OrderedListFlags,\r
939 IN UINT8 DataType,\r
940 IN UINT8 MaxContainers,\r
941 IN VOID *OptionsOpCodeHandle,\r
942 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
943 );\r
944\r
e22812c7
LG
945/**\r
946 Create EFI_IFR_TEXT_OP opcode.\r
947\r
948 If OpCodeHandle is NULL, then ASSERT().\r
949\r
950 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
951 @param[in] Prompt String ID for Prompt.\r
952 @param[in] Help String ID for Help.\r
953 @param[in] TextTwo String ID for TextTwo.\r
954\r
955 @retval NULL There is not enough space left in Buffer to add the opcode.\r
956 @retval Other A pointer to the created opcode.\r
957\r
958**/\r
959UINT8 *\r
960EFIAPI\r
961HiiCreateTextOpCode (\r
962 IN VOID *OpCodeHandle,\r
963 IN EFI_STRING_ID Prompt,\r
964 IN EFI_STRING_ID Help,\r
965 IN EFI_STRING_ID TextTwo\r
966 );\r
967\r
968/**\r
969 Create EFI_IFR_DATE_OP opcode.\r
970\r
971 If OpCodeHandle is NULL, then ASSERT().\r
972 If any reserved bits are set in QuestionFlags, then ASSERT().\r
973 If any reserved bits are set in DateFlags, then ASSERT().\r
974\r
975 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
976 @param[in] QuestionId Question ID\r
977 @param[in] VarStoreId Storage ID, optional. If DateFlags is not\r
978 QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
09acdc0b
ED
979 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
980 for this name/value pair, optional. If DateFlags is not\r
e22812c7
LG
981 QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
982 @param[in] Prompt String ID for Prompt\r
983 @param[in] Help String ID for Help\r
984 @param[in] QuestionFlags Flags in Question Header\r
985 @param[in] DateFlags Flags for date opcode\r
986 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
987 is an optional parameter that may be NULL.\r
988\r
989 @retval NULL There is not enough space left in Buffer to add the opcode.\r
990 @retval Other A pointer to the created opcode.\r
991\r
992**/\r
993UINT8 *\r
994EFIAPI\r
995HiiCreateDateOpCode (\r
996 IN VOID *OpCodeHandle,\r
997 IN EFI_QUESTION_ID QuestionId,\r
998 IN EFI_VARSTORE_ID VarStoreId, OPTIONAL\r
999 IN UINT16 VarOffset, OPTIONAL\r
1000 IN EFI_STRING_ID Prompt,\r
1001 IN EFI_STRING_ID Help,\r
1002 IN UINT8 QuestionFlags,\r
1003 IN UINT8 DateFlags,\r
1004 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1005 );\r
1006\r
1007/**\r
1008 Create EFI_IFR_TIME_OP opcode.\r
1009\r
1010 If OpCodeHandle is NULL, then ASSERT().\r
1011 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1012 If any reserved bits are set in TimeFlags, then ASSERT().\r
1013\r
1014 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1015 @param[in] QuestionId Question ID\r
1016 @param[in] VarStoreId Storage ID, optional. If TimeFlags is not\r
1017 QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
09acdc0b
ED
1018 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
1019 for this name/value pair, optional. If TimeFlags is not\r
e22812c7
LG
1020 QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
1021 @param[in] Prompt String ID for Prompt\r
1022 @param[in] Help String ID for Help\r
1023 @param[in] QuestionFlags Flags in Question Header\r
1024 @param[in] TimeFlags Flags for time opcode\r
1025 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1026 is an optional parameter that may be NULL.\r
1027\r
1028 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1029 @retval Other A pointer to the created opcode.\r
1030\r
1031**/\r
1032UINT8 *\r
1033EFIAPI\r
1034HiiCreateTimeOpCode (\r
1035 IN VOID *OpCodeHandle,\r
1036 IN EFI_QUESTION_ID QuestionId,\r
1037 IN EFI_VARSTORE_ID VarStoreId, OPTIONAL\r
1038 IN UINT16 VarOffset, OPTIONAL\r
1039 IN EFI_STRING_ID Prompt,\r
1040 IN EFI_STRING_ID Help,\r
1041 IN UINT8 QuestionFlags,\r
1042 IN UINT8 TimeFlags,\r
1043 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1044 );\r
1045\r
7e3bcccb 1046/**\r
d1102dba 1047 This function updates a form that has previously been registered with the HII\r
7e3bcccb 1048 Database. This function will perform at most one update operation.\r
d1102dba
LG
1049\r
1050 The form to update is specified by Handle, FormSetGuid, and FormId. Binary\r
1051 comparisons of IFR opcodes are performed from the beginning of the form being\r
1052 updated until an IFR opcode is found that exactly matches the first IFR opcode\r
84213069 1053 specified by StartOpCodeHandle. The following rules are used to determine if\r
e9b67286 1054 an insert, replace, or delete operation is performed:\r
d1102dba
LG
1055\r
1056 1) If no matches are found, then NULL is returned.\r
7e3bcccb 1057 2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes\r
d1102dba 1058 from StartOpCodeHandle except the first opcode are inserted immediately after\r
84213069 1059 the matching IFR opcode in the form to be updated.\r
d1102dba
LG
1060 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made\r
1061 from the matching IFR opcode until an IFR opcode exactly matches the first\r
7e3bcccb
LG
1062 IFR opcode specified by EndOpCodeHandle. If no match is found for the first\r
1063 IFR opcode specified by EndOpCodeHandle, then NULL is returned. If a match\r
d1102dba 1064 is found, then all of the IFR opcodes between the start match and the end\r
7e3bcccb 1065 match are deleted from the form being updated and all of the IFR opcodes\r
d1102dba 1066 from StartOpCodeHandle except the first opcode are inserted immediately after\r
7e3bcccb 1067 the matching start IFR opcode. If StartOpCcodeHandle only contains one\r
84213069 1068 IFR instruction, then the result of this operation will delete all of the IFR\r
7e3bcccb
LG
1069 opcodes between the start end matches.\r
1070\r
1071 If HiiHandle is NULL, then ASSERT().\r
1072 If StartOpCodeHandle is NULL, then ASSERT().\r
1073\r
1074 @param[in] HiiHandle The HII Handle of the form to update.\r
1075 @param[in] FormSetGuid The Formset GUID of the form to update. This\r
1076 is an optional parameter that may be NULL.\r
1077 If it is NULL, all FormSet will be updated.\r
1078 @param[in] FormId The ID of the form to update.\r
d1102dba 1079 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR\r
7e3bcccb 1080 opcodes to be inserted or replaced in the form.\r
d1102dba
LG
1081 The first IFR instruction in StartOpCodeHandle\r
1082 is used to find matching IFR opcode in the\r
1083 form.\r
7e3bcccb
LG
1084 @param[in] EndOpCodeHandle An OpCcode Handle that contains the IFR opcode\r
1085 that marks the end of a replace operation in\r
1086 the form. This is an optional parameter that\r
e9b67286 1087 may be NULL. If it is NULL, then the IFR\r
d1102dba 1088 opcodes specified by StartOpCodeHandle are\r
7e3bcccb 1089 inserted into the form.\r
d1102dba 1090\r
e9b67286 1091 @retval EFI_OUT_OF_RESOURCES Not enough memory resources are allocated.\r
1092 @retval EFI_NOT_FOUND The following cases will return EFI_NOT_FOUND:\r
d1102dba 1093 1) The form specified by HiiHandle, FormSetGuid,\r
7e3bcccb
LG
1094 and FormId could not be found in the HII Database.\r
1095 2) No IFR opcodes in the target form match the first\r
1096 IFR opcode in StartOpCodeHandle.\r
d1102dba
LG
1097 3) EndOpCOde is not NULL, and no IFR opcodes in the\r
1098 target form following a matching start opcode match\r
7e3bcccb
LG
1099 the first IFR opcode in EndOpCodeHandle.\r
1100 @retval EFI_SUCCESS The matched form is updated by StartOpcode.\r
1101\r
1102**/\r
1103EFI_STATUS\r
1104EFIAPI\r
1105HiiUpdateForm (\r
1106 IN EFI_HII_HANDLE HiiHandle,\r
1107 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1108 IN EFI_FORM_ID FormId,\r
84213069
LG
1109 IN VOID *StartOpCodeHandle,\r
1110 IN VOID *EndOpCodeHandle OPTIONAL\r
7e3bcccb
LG
1111 );\r
1112\r
4c76e9cc 1113#endif\r