]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/IfrSupportLib.h
1) StrGather (Build.exe) in compatible mode add a Framework Package Header to replace...
[mirror_edk2.git] / MdeModulePkg / Include / Library / IfrSupportLib.h
CommitLineData
4c76e9cc 1/** @file\r
2 This library contains functions to do IFR opcode creation and utility functions \r
3 to help module to interact with a UEFI Form Browser.\r
4\r
5 Copyright (c) 2007 - 2008, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _IFR_SUPPORT_LIBRARY_H_\r
17#define _IFR_SUPPORT_LIBRARY_H_\r
18\r
19\r
20#include <Protocol/HiiFont.h>\r
21#include <Protocol/HiiImage.h>\r
22#include <Protocol/HiiString.h>\r
23#include <Protocol/HiiDatabase.h>\r
24#include <Protocol/HiiConfigRouting.h>\r
25#include <Protocol/HiiConfigAccess.h>\r
26#include <Protocol/FormBrowser2.h>\r
27#include <Protocol/SimpleTextOut.h>\r
28\r
29#include <Guid/GlobalVariable.h>\r
30\r
31//\r
32// The architectural variable "Lang" and "LangCodes" are deprecated in UEFI\r
33// specification. While, UEFI specification also states that these deprecated\r
34// variables may be provided for backwards compatibility.\r
35\r
36#define EFI_LANGUAGE_VARIABLE L"Lang"\r
37#define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes"\r
38\r
39#define UEFI_LANGUAGE_VARIABLE L"PlatformLang"\r
40#define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"\r
41\r
42#define INVALID_VARSTORE_ID 0\r
43\r
44#define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)\r
45#define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)\r
46\r
47#pragma pack(1)\r
48typedef struct {\r
49 EFI_STRING_ID StringToken;\r
50 EFI_IFR_TYPE_VALUE Value;\r
51 UINT8 Flags;\r
52} IFR_OPTION;\r
53#pragma pack()\r
54\r
55typedef struct {\r
56 ///\r
57 /// Buffer size allocated for Data.\r
58 ///\r
59 UINT32 BufferSize;\r
60\r
61 ///\r
62 /// Offset in Data to append the newly created opcode binary.\r
63 /// It will be adjusted automatically in Create***OpCode(), and should be\r
64 /// initialized to 0 before invocation of a serial of Create***OpCode()\r
65 ///\r
66 UINT32 Offset;\r
67\r
68 ///\r
69 /// The destination buffer for created op-codes\r
70 ///\r
71 UINT8 *Data;\r
72} EFI_HII_UPDATE_DATA;\r
73\r
74\r
75/**\r
76 Create EFI_IFR_END_OP opcode.\r
77\r
78 If Data is NULL or Data->Data is NULL, then ASSERT.\r
79\r
80 @param Data Destination for the created opcode binary\r
81\r
82 @retval EFI_SUCCESS Opcode is created successfully.\r
83 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
84\r
85**/\r
86EFI_STATUS\r
87EFIAPI\r
88CreateEndOpCode (\r
89 IN OUT EFI_HII_UPDATE_DATA *Data\r
90 )\r
91;\r
92\r
93/**\r
94 Create EFI_IFR_DEFAULT_OP opcode.\r
95\r
96 If Data is NULL or Data->Data is NULL, then ASSERT.\r
97\r
98 @param Value Value for the default\r
99 @param Type Type for the default\r
100 @param Data Destination for the created opcode binary\r
101\r
102 @retval EFI_SUCCESS Opcode is created successfully.\r
103 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
104 @retval EFI_INVALID_PARAMETER The type is not valid.\r
105\r
106**/\r
107EFI_STATUS\r
108EFIAPI\r
109CreateDefaultOpCode (\r
110 IN EFI_IFR_TYPE_VALUE *Value,\r
111 IN UINT8 Type,\r
112 IN OUT EFI_HII_UPDATE_DATA *Data\r
113 )\r
114;\r
115\r
116/**\r
117 Create EFI_IFR_ACTION_OP opcode.\r
118\r
119 If Data is NULL or Data->Data is NULL, then ASSERT.\r
120\r
121 @param QuestionId Question ID\r
122 @param Prompt String ID for Prompt\r
123 @param Help String ID for Help\r
124 @param QuestionFlags Flags in Question Header\r
125 @param QuestionConfig String ID for configuration\r
126 @param Data Destination for the created opcode binary\r
127\r
128 @retval EFI_SUCCESS Opcode is created successfully.\r
129 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
130 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
131\r
132**/\r
133EFI_STATUS\r
134EFIAPI\r
135CreateActionOpCode (\r
136 IN EFI_QUESTION_ID QuestionId,\r
137 IN EFI_STRING_ID Prompt,\r
138 IN EFI_STRING_ID Help,\r
139 IN UINT8 QuestionFlags,\r
140 IN EFI_STRING_ID QuestionConfig,\r
141 IN OUT EFI_HII_UPDATE_DATA *Data\r
142 )\r
143;\r
144\r
145/**\r
146 Create EFI_IFR_SUBTITLE_OP opcode.\r
147\r
148 If Data is NULL or Data->Data is NULL, then ASSERT.\r
149\r
150 @param Prompt String ID for Prompt\r
151 @param Help String ID for Help\r
152 @param Flags Subtitle opcode flags\r
153 @param Scope Subtitle Scope bit\r
154 @param Data Destination for the created opcode binary\r
155\r
156 @retval EFI_SUCCESS Opcode is created successfully.\r
157 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
158 \r
159**/\r
160EFI_STATUS\r
161EFIAPI\r
162CreateSubTitleOpCode (\r
163 IN EFI_STRING_ID Prompt,\r
164 IN EFI_STRING_ID Help,\r
165 IN UINT8 Flags,\r
166 IN UINT8 Scope,\r
167 IN OUT EFI_HII_UPDATE_DATA *Data\r
168 )\r
169;\r
170\r
171/**\r
172 Create EFI_IFR_TEXT_OP opcode.\r
173\r
174 If Data is NULL or Data->Data is NULL, then ASSERT.\r
175\r
176 @param Prompt String ID for Prompt\r
177 @param Help String ID for Help\r
178 @param TextTwo String ID for text two\r
179 @param Data Destination for the created opcode binary\r
180\r
181 @retval EFI_SUCCESS Opcode is created successfully.\r
182 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
183\r
184**/\r
185EFI_STATUS\r
186EFIAPI\r
187CreateTextOpCode (\r
188 IN EFI_STRING_ID Prompt,\r
189 IN EFI_STRING_ID Help,\r
190 IN EFI_STRING_ID TextTwo,\r
191 IN OUT EFI_HII_UPDATE_DATA *Data\r
192 )\r
193;\r
194\r
195/**\r
196 Create EFI_IFR_REF_OP opcode.\r
197\r
198 If Data is NULL or Data->Data is NULL, then ASSERT.\r
199\r
200 @param FormId Destination Form ID\r
201 @param Prompt String ID for Prompt\r
202 @param Help String ID for Help\r
203 @param QuestionFlags Flags in Question Header\r
204 @param QuestionId Question ID\r
205 @param Data Destination for the created opcode binary\r
206\r
207 @retval EFI_SUCCESS Opcode is created successfully.\r
208 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
209 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
210\r
211**/\r
212EFI_STATUS\r
213EFIAPI\r
214CreateGotoOpCode (\r
215 IN EFI_FORM_ID FormId,\r
216 IN EFI_STRING_ID Prompt,\r
217 IN EFI_STRING_ID Help,\r
218 IN UINT8 QuestionFlags,\r
219 IN EFI_QUESTION_ID QuestionId,\r
220 IN OUT EFI_HII_UPDATE_DATA *Data\r
221 )\r
222;\r
223\r
224/**\r
225 Create EFI_IFR_ONE_OF_OPTION_OP opcode.\r
226\r
227 If Data is NULL or Data->Data is NULL, then ASSERT.\r
228\r
229 @param OptionCount The number of options.\r
230 @param OptionsList The list of Options.\r
231 @param Type The data type.\r
232 @param Data Destination for the created opcode binary\r
233\r
234 @retval EFI_SUCCESS Opcode is created successfully.\r
235 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
236 @retval EFI_INVALID_PARAMETER If OptionCount is not zero but OptionsList is NULL.\r
237\r
238**/\r
239EFI_STATUS\r
240EFIAPI\r
241CreateOneOfOptionOpCode (\r
242 IN UINTN OptionCount,\r
243 IN IFR_OPTION *OptionsList,\r
244 IN UINT8 Type,\r
245 IN OUT EFI_HII_UPDATE_DATA *Data\r
246 )\r
247;\r
248\r
249/**\r
250 Create EFI_IFR_ONE_OF_OP opcode.\r
251\r
252 If Data is NULL or Data->Data is NULL, then ASSERT.\r
253\r
254 @param QuestionId Question ID\r
255 @param VarStoreId Storage ID\r
256 @param VarOffset Offset in Storage\r
257 @param Prompt String ID for Prompt\r
258 @param Help String ID for Help\r
259 @param QuestionFlags Flags in Question Header\r
260 @param OneOfFlags Flags for oneof opcode\r
261 @param OptionsList List of options\r
262 @param OptionCount Number of options in option list\r
263 @param Data Destination for the created opcode binary\r
264\r
265 @retval EFI_SUCCESS Opcode is created successfully.\r
266 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
267 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
268\r
269**/\r
270EFI_STATUS\r
271EFIAPI\r
272CreateOneOfOpCode (\r
273 IN EFI_QUESTION_ID QuestionId,\r
274 IN EFI_VARSTORE_ID VarStoreId,\r
275 IN UINT16 VarOffset,\r
276 IN EFI_STRING_ID Prompt,\r
277 IN EFI_STRING_ID Help,\r
278 IN UINT8 QuestionFlags,\r
279 IN UINT8 OneOfFlags,\r
280 IN IFR_OPTION *OptionsList,\r
281 IN UINTN OptionCount,\r
282 IN OUT EFI_HII_UPDATE_DATA *Data\r
283 )\r
284;\r
285\r
286/**\r
287 Create EFI_IFR_ORDERED_LIST_OP opcode.\r
288\r
289 If Data is NULL or Data->Data is NULL, then ASSERT.\r
290\r
291 @param QuestionId Question ID\r
292 @param VarStoreId Storage ID\r
293 @param VarOffset Offset in Storage\r
294 @param Prompt String ID for Prompt\r
295 @param Help String ID for Help\r
296 @param QuestionFlags Flags in Question Header\r
297 @param OrderedListFlags Flags for ordered list opcode\r
298 @param DataType Type for option value\r
299 @param MaxContainers Maximum count for options in this ordered list\r
300 @param OptionsList List of options\r
301 @param OptionCount Number of options in option list\r
302 @param Data Destination for the created opcode binary\r
303\r
304 @retval EFI_SUCCESS Opcode is created successfully.\r
305 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
306 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
307\r
308**/\r
309EFI_STATUS\r
310EFIAPI\r
311CreateOrderedListOpCode (\r
312 IN EFI_QUESTION_ID QuestionId,\r
313 IN EFI_VARSTORE_ID VarStoreId,\r
314 IN UINT16 VarOffset,\r
315 IN EFI_STRING_ID Prompt,\r
316 IN EFI_STRING_ID Help,\r
317 IN UINT8 QuestionFlags,\r
318 IN UINT8 OrderedListFlags,\r
319 IN UINT8 DataType,\r
320 IN UINT8 MaxContainers,\r
321 IN IFR_OPTION *OptionsList,\r
322 IN UINTN OptionCount,\r
323 IN OUT EFI_HII_UPDATE_DATA *Data\r
324 )\r
325;\r
326\r
327/**\r
328 Create EFI_IFR_CHECKBOX_OP opcode.\r
329\r
330 If Data is NULL or Data->Data is NULL, then ASSERT.\r
331\r
332 @param QuestionId Question ID\r
333 @param VarStoreId Storage ID\r
334 @param VarOffset Offset in Storage\r
335 @param Prompt String ID for Prompt\r
336 @param Help String ID for Help\r
337 @param QuestionFlags Flags in Question Header\r
338 @param CheckBoxFlags Flags for checkbox opcode\r
339 @param Data Destination for the created opcode binary\r
340\r
341 @retval EFI_SUCCESS Opcode is created successfully.\r
342 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
343 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
344\r
345**/\r
346EFI_STATUS\r
347EFIAPI\r
348CreateCheckBoxOpCode (\r
349 IN EFI_QUESTION_ID QuestionId,\r
350 IN EFI_VARSTORE_ID VarStoreId,\r
351 IN UINT16 VarOffset,\r
352 IN EFI_STRING_ID Prompt,\r
353 IN EFI_STRING_ID Help,\r
354 IN UINT8 QuestionFlags,\r
355 IN UINT8 CheckBoxFlags,\r
356 IN OUT EFI_HII_UPDATE_DATA *Data\r
357 )\r
358;\r
359\r
360/**\r
361 Create EFI_IFR_NUMERIC_OP opcode.\r
362\r
363 If Data is NULL or Data->Data is NULL, then ASSERT.\r
364\r
365 @param QuestionId Question ID\r
366 @param VarStoreId Storage ID\r
367 @param VarOffset Offset in Storage\r
368 @param Prompt String ID for Prompt\r
369 @param Help String ID for Help\r
370 @param QuestionFlags Flags in Question Header\r
371 @param NumericFlags Flags for numeric opcode\r
372 @param Minimum Numeric minimum value\r
373 @param Maximum Numeric maximum value\r
374 @param Step Numeric step for edit\r
375 @param Default Numeric default value\r
376 @param Data Destination for the created opcode binary\r
377\r
378 @retval EFI_SUCCESS Opcode is created successfully.\r
379 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
380 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
381\r
382**/\r
383EFI_STATUS\r
384EFIAPI\r
385CreateNumericOpCode (\r
386 IN EFI_QUESTION_ID QuestionId,\r
387 IN EFI_VARSTORE_ID VarStoreId,\r
388 IN UINT16 VarOffset,\r
389 IN EFI_STRING_ID Prompt,\r
390 IN EFI_STRING_ID Help,\r
391 IN UINT8 QuestionFlags,\r
392 IN UINT8 NumericFlags,\r
393 IN UINT64 Minimum,\r
394 IN UINT64 Maximum,\r
395 IN UINT64 Step,\r
396 IN UINT64 Default,\r
397 IN OUT EFI_HII_UPDATE_DATA *Data\r
398 )\r
399;\r
400\r
401/**\r
402 Create EFI_IFR_STRING_OP opcode.\r
403\r
404 If Data is NULL or Data->Data is NULL, then ASSERT.\r
405\r
406 @param QuestionId Question ID\r
407 @param VarStoreId Storage ID\r
408 @param VarOffset Offset in Storage\r
409 @param Prompt String ID for Prompt\r
410 @param Help String ID for Help\r
411 @param QuestionFlags Flags in Question Header\r
412 @param StringFlags Flags for string opcode\r
413 @param MinSize String minimum length\r
414 @param MaxSize String maximum length\r
415 @param Data Destination for the created opcode binary\r
416\r
417 @retval EFI_SUCCESS Opcode is created successfully.\r
418 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r
419 @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.\r
420\r
421**/\r
422EFI_STATUS\r
423EFIAPI\r
424CreateStringOpCode (\r
425 IN EFI_QUESTION_ID QuestionId,\r
426 IN EFI_VARSTORE_ID VarStoreId,\r
427 IN UINT16 VarOffset,\r
428 IN EFI_STRING_ID Prompt,\r
429 IN EFI_STRING_ID Help,\r
430 IN UINT8 QuestionFlags,\r
431 IN UINT8 StringFlags,\r
432 IN UINT8 MinSize,\r
433 IN UINT8 MaxSize,\r
434 IN OUT EFI_HII_UPDATE_DATA *Data\r
435 )\r
436;\r
437/**\r
438 Construct <ConfigAltResp> for a buffer storage.\r
439\r
440 @param ConfigRequest The Config request string. If set to NULL, all the\r
441 configurable elements will be extracted from BlockNameArray.\r
442 @param ConfigAltResp The returned <ConfigAltResp>.\r
443 @param Progress On return, points to a character in the Request.\r
444 @param Guid GUID of the buffer storage.\r
445 @param Name Name of the buffer storage.\r
446 @param DriverHandle The DriverHandle which is used to invoke HiiDatabase\r
447 protocol interface NewPackageList().\r
448 @param BufferStorage Content of the buffer storage.\r
449 @param BufferStorageSize Length in bytes of the buffer storage.\r
450 @param BlockNameArray Array generated by VFR compiler.\r
451 @param NumberAltCfg Number of Default value array generated by VFR compiler.\r
452 The sequential input parameters will be number of\r
453 AltCfgId and DefaultValueArray pairs. When set to 0,\r
454 there will be no <AltResp>.\r
455\r
456 retval EFI_OUT_OF_RESOURCES Run out of memory resource.\r
457 retval EFI_INVALID_PARAMETER ConfigAltResp is NULL.\r
458 retval EFI_SUCCESS Operation successful.\r
459\r
460**/\r
461EFI_STATUS\r
462ConstructConfigAltResp (\r
463 IN EFI_STRING ConfigRequest, OPTIONAL\r
464 OUT EFI_STRING *Progress,\r
465 OUT EFI_STRING *ConfigAltResp,\r
466 IN EFI_GUID *Guid,\r
467 IN CHAR16 *Name,\r
468 IN EFI_HANDLE *DriverHandle,\r
469 IN VOID *BufferStorage,\r
470 IN UINTN BufferStorageSize,\r
471 IN VOID *BlockNameArray, OPTIONAL\r
472 IN UINTN NumberAltCfg,\r
473 ...\r
474//IN UINT16 AltCfgId,\r
475//IN VOID *DefaultValueArray,\r
476 )\r
477;\r
478\r
479/**\r
480 Converts the unicode character of the string from uppercase to lowercase.\r
481\r
482 @param Str String to be converted\r
483\r
484 \r
485**/\r
486VOID\r
487EFIAPI\r
488ToLower (\r
489 IN OUT CHAR16 *Str\r
490 )\r
491;\r
492\r
493/**\r
494 Converts binary buffer to a Unicode string. The byte buffer is in a reversed byte order \r
495 compared with the byte order defined in BufToHexString().\r
496\r
497 @param Str String for output\r
498 @param Buffer Binary buffer.\r
499 @param BufferSize Size of the buffer in bytes.\r
500\r
501 @retval EFI_SUCCESS The function completed successfully.\r
502 @retval EFI_OUT_OF_RESOURCES There is no enough available memory space.\r
503\r
504**/\r
505EFI_STATUS\r
506EFIAPI\r
507BufInReverseOrderToHexString (\r
508 IN OUT CHAR16 *Str,\r
509 IN UINT8 *Buffer,\r
510 IN UINTN BufferSize\r
511 )\r
512;\r
513\r
514/**\r
515 Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().\r
516\r
517 @param Buffer Pointer to buffer that receives the data.\r
518 @param BufferSize Length in bytes of the buffer to hold converted\r
519 data. If routine return with EFI_SUCCESS,\r
520 containing length of converted data. If routine\r
521 return with EFI_BUFFER_TOO_SMALL, containg length\r
522 of buffer desired.\r
523 @param Str String to be converted from.\r
524\r
525 @retval EFI_SUCCESS The function completed successfully.\r
526 @retval RETURN_BUFFER_TOO_SMALL The input BufferSize is too small to hold the output. BufferSize\r
527 will be updated to the size required for the converstion.\r
528\r
529**/\r
530EFI_STATUS\r
531EFIAPI\r
532HexStringToBufInReverseOrder (\r
533 IN OUT UINT8 *Buffer,\r
534 IN OUT UINTN *BufferSize,\r
535 IN CHAR16 *Str\r
536 )\r
537;\r
538\r
539/**\r
540 Convert binary representation Config string (e.g. "0041004200430044") to the\r
541 original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.\r
542 "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
543\r
544 @param UnicodeString Original Unicode string.\r
545 @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.\r
546 Includes tailing '\0' character.\r
547 On output:\r
548 containing length of Unicode string buffer when returning EFI_SUCCESS;\r
549 containg length of string buffer desired when returning EFI_BUFFER_TOO_SMALL.\r
550 @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+\r
551\r
552 @retval EFI_SUCCESS Operation completes successfully.\r
553 @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.\r
554\r
555**/\r
556EFI_STATUS\r
557EFIAPI\r
558ConfigStringToUnicode (\r
559 IN OUT CHAR16 *UnicodeString,\r
560 IN OUT UINTN *StrBufferLen,\r
561 IN CHAR16 *ConfigString\r
562 )\r
563;\r
564\r
565/**\r
566 Convert Unicode string to binary representation Config string, e.g.\r
567 "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.\r
568 "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
569\r
570 @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+\r
571 @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.\r
572 Includes tailing '\0' character.\r
573 On output:\r
574 If return EFI_SUCCESS, containing length of Unicode string buffer.\r
575 If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r
576 @param UnicodeString Original Unicode string.\r
577\r
578 @retval EFI_SUCCESS Operation completes successfully.\r
579 @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.\r
580\r
581**/\r
582EFI_STATUS\r
583EFIAPI\r
584UnicodeToConfigString (\r
585 IN OUT CHAR16 *ConfigString,\r
586 IN OUT UINTN *StrBufferLen,\r
587 IN CHAR16 *UnicodeString\r
588 )\r
589;\r
590\r
591/**\r
592 Construct <ConfigHdr> using routing information GUID/NAME/PATH.\r
593\r
594 @param ConfigHdr Pointer to the ConfigHdr string.\r
595 @param StrBufferLen On input: Length in bytes of buffer to hold the\r
596 ConfigHdr string. Includes tailing '\0' character.\r
597 On output: If return EFI_SUCCESS, containing\r
598 length of ConfigHdr string buffer. If return\r
599 EFI_BUFFER_TOO_SMALL, containg length of string\r
600 buffer desired.\r
601 @param Guid Routing information: GUID.\r
602 @param Name Routing information: NAME.\r
603 @param DriverHandle Driver handle which contains the routing\r
604 information: PATH.\r
605\r
606 @retval EFI_SUCCESS Operation completes successfully.\r
607 @retval EFI_BUFFER_TOO_SMALL The ConfigHdr string buffer is too small.\r
608\r
609**/\r
610EFI_STATUS\r
611EFIAPI\r
612ConstructConfigHdr (\r
613 IN OUT CHAR16 *ConfigHdr,\r
614 IN OUT UINTN *StrBufferLen,\r
615 IN CONST EFI_GUID *Guid,\r
616 IN CHAR16 *Name, OPTIONAL\r
617 IN EFI_HANDLE *DriverHandle\r
618 )\r
619\r
620;\r
621\r
622/**\r
623 Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.\r
624\r
625 @param ConfigString Either <ConfigRequest> or <ConfigResp>.\r
626 @param StorageGuid GUID of the storage.\r
627 @param StorageName Name of the stoarge.\r
628\r
629 @retval TRUE Routing information is correct in ConfigString.\r
630 @retval FALSE Routing information is incorrect in ConfigString.\r
631\r
632**/\r
633BOOLEAN\r
634IsConfigHdrMatch (\r
635 IN EFI_STRING ConfigString,\r
636 IN EFI_GUID *StorageGuid, OPTIONAL\r
637 IN CHAR16 *StorageName OPTIONAL\r
638 )\r
639;\r
640\r
641/**\r
642 Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.\r
643\r
644 @param String The string to be searched in.\r
645 @param Offset Offset in BlockName.\r
646 @param Width Width in BlockName.\r
647\r
648 @retval TRUE Block name found.\r
649 @retval FALSE Block name not found.\r
650\r
651**/\r
652BOOLEAN\r
653EFIAPI\r
654FindBlockName (\r
655 IN OUT CHAR16 *String,\r
656 IN UINTN Offset,\r
657 IN UINTN Width\r
658 )\r
659;\r
660\r
661/**\r
662 This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.\r
663\r
664 @param VariableGuid An optional field to indicate the target variable\r
665 GUID name to use.\r
666 @param VariableName An optional field to indicate the target\r
667 human-readable variable name.\r
668 @param BufferSize On input: Length in bytes of buffer to hold\r
669 retrived data. On output: If return\r
670 EFI_BUFFER_TOO_SMALL, containg length of buffer\r
671 desired.\r
672 @param Buffer Buffer to hold retrived data.\r
673\r
674 @retval EFI_SUCCESS Operation completes successfully.\r
675 @retval EFI_BUFFER_TOO_SMALL The intput buffer is too small.\r
676\r
677**/\r
678EFI_STATUS\r
679EFIAPI\r
680GetBrowserData (\r
681 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
682 IN CONST CHAR16 *VariableName, OPTIONAL\r
683 IN OUT UINTN *BufferSize,\r
684 IN OUT UINT8 *Buffer\r
685 )\r
686;\r
687\r
688/**\r
689 This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.\r
690\r
691 @param VariableGuid An optional field to indicate the target variable\r
692 GUID name to use.\r
693 @param VariableName An optional field to indicate the target\r
694 human-readable variable name.\r
695 @param BufferSize Length in bytes of buffer to hold retrived data.\r
696 @param Buffer Buffer to hold retrived data.\r
697 @param RequestElement An optional field to specify which part of the\r
698 buffer data will be send back to Browser. If NULL,\r
699 the whole buffer of data will be committed to\r
700 Browser. <RequestElement> ::=\r
701 &OFFSET=<Number>&WIDTH=<Number>*\r
702\r
703 @retval EFI_SUCCESS Operation completes successfully.\r
704 @retval Other Updating Browser uncommitted data failed.\r
705\r
706**/\r
707EFI_STATUS\r
708EFIAPI\r
709SetBrowserData (\r
710 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
711 IN CONST CHAR16 *VariableName, OPTIONAL\r
712 IN UINTN BufferSize,\r
713 IN CONST UINT8 *Buffer,\r
714 IN CONST CHAR16 *RequestElement OPTIONAL\r
715 )\r
716;\r
717\r
718/**\r
719 Draw a dialog and return the selected key.\r
720\r
721 @param NumberOfLines The number of lines for the dialog box\r
722 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..\r
723 @param String Pointer to the first string in the list\r
724 @param ... A series of (quantity == NumberOfLines - 1) text\r
725 strings which will be used to construct the dialog\r
726 box\r
727\r
728 @retval EFI_SUCCESS Displayed dialog and received user interaction\r
729 @retval EFI_INVALID_PARAMETER One of the parameters was invalid.\r
730\r
731**/\r
732EFI_STATUS\r
733EFIAPI\r
734IfrLibCreatePopUp (\r
735 IN UINTN NumberOfLines,\r
736 OUT EFI_INPUT_KEY *KeyValue,\r
737 IN CHAR16 *String,\r
738 ...\r
739 )\r
740;\r
741\r
742/**\r
743 Draw a dialog and return the selected key using Variable Argument List.\r
744\r
745 @param NumberOfLines The number of lines for the dialog box\r
746 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..\r
35d59af3 747 @param String The first String to be displayed in the Pop-Up.\r
4c76e9cc 748 @param Args VA_LIST marker for the variable argument list.\r
749 A series of (quantity == NumberOfLines - 1) text\r
750 strings which will be used to construct the dialog\r
751 box\r
752\r
753 @retval EFI_SUCCESS Displayed dialog and received user interaction\r
754 @retval EFI_INVALID_PARAMETER One of the parameters was invalid.\r
755\r
756**/\r
757EFI_STATUS\r
758EFIAPI\r
759IfrLibCreatePopUp2 (\r
760 IN UINTN NumberOfLines,\r
761 OUT EFI_INPUT_KEY *KeyValue,\r
35d59af3 762 IN CHAR16 *String,\r
4c76e9cc 763 IN VA_LIST Args\r
764 )\r
765;\r
766\r
767#endif\r