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