]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrLibrary.h
Maintainers.txt: Remove EdkCompatibilityPkg information
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / EfiIfrSupportLib / IfrLibrary.h
CommitLineData
3eb9473e 1/*++\r
2\r
4ea9375a
HT
3Copyright (c) 2004 - 2005, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 IfrLibrary.h\r
15\r
16Abstract:\r
17 The file contain all library function for Ifr Operations.\r
18\r
19--*/\r
20\r
21#ifndef _IFRLIBRARY_H\r
22#define _IFRLIBRARY_H\r
23\r
24#include "Tiano.h"\r
25#include "EfiDriverLib.h"\r
26\r
27#include EFI_PROTOCOL_DEFINITION (Hii)\r
28#include EFI_GUID_DEFINITION (GlobalVariable)\r
29\r
30#define DEFAULT_FORM_BUFFER_SIZE 0xFFFF\r
31#define DEFAULT_STRING_BUFFER_SIZE 0xFFFF\r
32\r
33#pragma pack(1)\r
34typedef struct {\r
35 CHAR16 *OptionString; // Passed in string to generate a token for in a truly dynamic form creation\r
36 STRING_REF StringToken; // This is used when creating a single op-code without generating a StringToken (have one already)\r
37 UINT16 Value;\r
38 UINT8 Flags;\r
39 UINT16 Key;\r
40} IFR_OPTION;\r
41#pragma pack()\r
42\r
43EFI_STATUS\r
44GetCurrentLanguage (\r
45 OUT CHAR16 *Lang\r
46 )\r
47/*++\r
48\r
49Routine Description:\r
50\r
51 Determine what is the current language setting\r
52 \r
53Arguments:\r
54\r
55 Lang - Pointer of system language\r
56 \r
57Returns: \r
58 \r
59 Status code\r
60\r
61--*/\r
62;\r
63\r
76a21f7c 64#ifdef SUPPORT_DEPRECATED_IFRSUPPORTLIB_API\r
3eb9473e 65EFI_STATUS\r
66AddString (\r
67 IN VOID *StringBuffer,\r
68 IN CHAR16 *Language,\r
69 IN CHAR16 *String,\r
70 IN OUT STRING_REF *StringToken\r
71 )\r
72/*++\r
73\r
74Routine Description:\r
75\r
76 Add a string to the incoming buffer and return the token and offset data\r
77 \r
78Arguments:\r
79\r
80 StringBuffer - The incoming buffer\r
81 \r
82 Language - Currrent language\r
83 \r
84 String - The string to be added\r
85 \r
86 StringToken - The index where the string placed\r
87 \r
88Returns: \r
89\r
90 EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
91 \r
92 EFI_SUCCESS - String successfully added to the incoming buffer\r
93\r
94--*/\r
95;\r
96\r
97EFI_STATUS\r
98AddOpCode (\r
99 IN VOID *FormBuffer,\r
100 IN OUT VOID *OpCodeData\r
101 )\r
102/*++\r
103\r
104Routine Description:\r
105\r
106 Add op-code data to the FormBuffer\r
107 \r
108Arguments:\r
109\r
110 FormBuffer - Form buffer to be inserted to\r
111 \r
112 OpCodeData - Op-code data to be inserted\r
113 \r
114Returns: \r
115\r
116 EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
117 \r
118 EFI_SUCCESS - Op-code data successfully inserted\r
119\r
120--*/\r
121;\r
122\r
123EFI_STATUS\r
124CreateFormSet (\r
125 IN CHAR16 *FormSetTitle,\r
126 IN EFI_GUID *Guid,\r
127 IN UINT8 Class,\r
128 IN UINT8 SubClass,\r
129 IN OUT VOID **FormBuffer,\r
130 IN OUT VOID **StringBuffer\r
131 )\r
132/*++\r
133\r
134Routine Description:\r
135\r
136 Create a formset\r
137 \r
138Arguments:\r
139\r
140 FormSetTitle - Title of formset\r
141 \r
142 Guid - Guid of formset\r
143 \r
144 Class - Class of formset\r
145 \r
146 SubClass - Sub class of formset\r
147 \r
148 FormBuffer - Pointer of the formset created\r
149 \r
150 StringBuffer - Pointer of FormSetTitile string created\r
151 \r
152Returns: \r
153\r
154 EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
155 \r
156 EFI_SUCCESS - Formset successfully created\r
157\r
158--*/\r
159;\r
160\r
161EFI_STATUS\r
162CreateForm (\r
163 IN CHAR16 *FormTitle,\r
164 IN UINT16 FormId,\r
165 IN OUT VOID *FormBuffer,\r
166 IN OUT VOID *StringBuffer\r
167 )\r
168/*++\r
169\r
170Routine Description:\r
171\r
172 Create a form\r
173 \r
174Arguments:\r
175\r
176 FormTitle - Title of the form\r
177 \r
178 FormId - Id of the form\r
179 \r
180 FormBuffer - Pointer of the form created\r
181 \r
182 StringBuffer - Pointer of FormTitil string created\r
183 \r
184Returns: \r
185\r
186 EFI_SUCCESS - Form successfully created\r
187\r
188--*/\r
189;\r
190\r
191EFI_STATUS\r
192CreateSubTitle (\r
193 IN CHAR16 *SubTitle,\r
194 IN OUT VOID *FormBuffer,\r
195 IN OUT VOID *StringBuffer\r
196 )\r
197/*++\r
198\r
199Routine Description:\r
200\r
201 Create a SubTitle\r
202 \r
203Arguments:\r
204\r
205 SubTitle - Sub title to be created\r
206 \r
207 FormBuffer - Where this subtitle to add to\r
208 \r
209 StringBuffer - String buffer created for subtitle\r
210 \r
211Returns: \r
212\r
213 EFI_SUCCESS - Subtitle successfully created\r
214\r
215--*/\r
216;\r
217\r
218EFI_STATUS\r
219CreateText (\r
220 IN CHAR16 *String,\r
221 IN CHAR16 *String2,\r
222 IN CHAR16 *String3,\r
223 IN UINT8 Flags,\r
224 IN UINT16 Key,\r
225 IN OUT VOID *FormBuffer,\r
226 IN OUT VOID *StringBuffer\r
227 )\r
228/*++\r
229\r
230Routine Description:\r
231\r
232 Create a line of text\r
233 \r
234Arguments:\r
235\r
236 String - First string of the text\r
237 \r
238 String2 - Second string of the text\r
239 \r
240 String3 - Help string of the text\r
241 \r
242 Flags - Flag of the text\r
243 \r
244 Key - Key of the text\r
245 \r
246 FormBuffer - The form where this text adds to\r
247 \r
248 StringBuffer - String buffer created for String, String2 and String3\r
249 \r
250Returns: \r
251\r
252 EFI_SUCCESS - Text successfully created\r
253\r
254--*/\r
255;\r
256\r
257EFI_STATUS\r
258CreateGoto (\r
259 IN UINT16 FormId,\r
260 IN CHAR16 *Prompt,\r
261 IN OUT VOID *FormBuffer,\r
262 IN OUT VOID *StringBuffer\r
263 )\r
264/*++\r
265\r
266Routine Description:\r
267\r
268 Create a hyperlink\r
269 \r
270Arguments:\r
271\r
272 FormId - Form ID of the hyperlink\r
273 \r
274 Prompt - Prompt of the hyperlink\r
275 \r
276 FormBuffer - The form where this hyperlink adds to\r
277 \r
278 StringBuffer - String buffer created for Prompt\r
279 \r
280Returns: \r
281\r
282 EFI_SUCCESS - Hyperlink successfully created\r
283\r
284--*/\r
285;\r
286\r
287EFI_STATUS\r
288CreateOneOf (\r
289 IN UINT16 QuestionId,\r
290 IN UINT8 DataWidth,\r
291 IN CHAR16 *Prompt,\r
292 IN CHAR16 *Help,\r
293 IN IFR_OPTION *OptionsList,\r
294 IN UINTN OptionCount,\r
295 IN OUT VOID *FormBuffer,\r
296 IN OUT VOID *StringBuffer\r
297 )\r
298/*++\r
299\r
300Routine Description:\r
301\r
302 Create a one-of question with a set of options to choose from. The\r
303 OptionsList is a pointer to a null-terminated list of option descriptions.\r
304 \r
305Arguments:\r
306\r
307 QuestionId - Question ID of the one-of box\r
308 \r
309 DataWidth - DataWidth of the one-of box\r
310 \r
311 Prompt - Prompt of the one-of box\r
312 \r
313 Help - Help of the one-of box\r
314 \r
315 OptionsList - Each string in it is an option of the one-of box\r
316 \r
317 OptionCount - Option string count\r
318 \r
319 FormBuffer - The form where this one-of box adds to\r
320 \r
321 StringBuffer - String buffer created for Prompt, Help and Option strings\r
322 \r
323Returns: \r
324\r
325 EFI_DEVICE_ERROR - DataWidth > 2\r
326\r
327 EFI_SUCCESS - One-Of box successfully created.\r
328\r
329--*/\r
330;\r
331\r
332EFI_STATUS\r
333CreateOrderedList (\r
334 IN UINT16 QuestionId,\r
335 IN UINT8 MaxEntries,\r
336 IN CHAR16 *Prompt,\r
337 IN CHAR16 *Help,\r
338 IN IFR_OPTION *OptionsList,\r
339 IN UINTN OptionCount,\r
340 IN OUT VOID *FormBuffer,\r
341 IN OUT VOID *StringBuffer\r
342 )\r
343/*++\r
344\r
345Routine Description:\r
346\r
347 Create a one-of question with a set of options to choose from. The\r
348 OptionsList is a pointer to a null-terminated list of option descriptions.\r
349 \r
350Arguments:\r
351\r
352 QuestionId - Question ID of the ordered list\r
353 \r
354 MaxEntries - MaxEntries of the ordered list\r
355 \r
356 Prompt - Prompt of the ordered list\r
357 \r
358 Help - Help of the ordered list\r
359 \r
360 OptionsList - Each string in it is an option of the ordered list\r
361 \r
362 OptionCount - Option string count\r
363 \r
364 FormBuffer - The form where this ordered list adds to\r
365 \r
366 StringBuffer - String buffer created for Prompt, Help and Option strings\r
367 \r
368Returns: \r
369\r
370 EFI_SUCCESS - Ordered list successfully created.\r
371\r
372--*/\r
373;\r
374\r
375EFI_STATUS\r
376CreateCheckBox (\r
377 IN UINT16 QuestionId,\r
378 IN UINT8 DataWidth,\r
379 IN CHAR16 *Prompt,\r
380 IN CHAR16 *Help,\r
381 IN UINT8 Flags,\r
382 IN OUT VOID *FormBuffer,\r
383 IN OUT VOID *StringBuffer\r
384 )\r
385/*++\r
386\r
387Routine Description:\r
388\r
389 Create a checkbox\r
390 \r
391Arguments:\r
392\r
393 QuestionId - Question ID of the check box\r
394 \r
395 DataWidth - DataWidth of the check box\r
396 \r
397 Prompt - Prompt of the check box\r
398 \r
399 Help - Help of the check box\r
400 \r
401 Flags - Flags of the check box\r
402 \r
403 FormBuffer - The form where this check box adds to\r
404 \r
405 StringBuffer - String buffer created for Prompt and Help.\r
406 \r
407Returns: \r
408\r
409 EFI_DEVICE_ERROR - DataWidth > 1\r
410\r
411 EFI_SUCCESS - Check box successfully created\r
412\r
413--*/\r
414;\r
415\r
416EFI_STATUS\r
417CreateNumeric (\r
418 IN UINT16 QuestionId,\r
419 IN UINT8 DataWidth,\r
420 IN CHAR16 *Prompt,\r
421 IN CHAR16 *Help,\r
422 IN UINT16 Minimum,\r
423 IN UINT16 Maximum,\r
424 IN UINT16 Step,\r
425 IN UINT16 Default,\r
426 IN UINT8 Flags,\r
427 IN UINT16 Key,\r
428 IN OUT VOID *FormBuffer,\r
429 IN OUT VOID *StringBuffer\r
430 )\r
431/*++\r
432\r
433Routine Description:\r
434\r
435 Create a numeric\r
436 \r
437Arguments:\r
438\r
439 QuestionId - Question ID of the numeric\r
440 \r
441 DataWidth - DataWidth of the numeric\r
442 \r
443 Prompt - Prompt of the numeric\r
444 \r
445 Help - Help of the numeric\r
446 \r
447 Minimum - Minumun boundary of the numeric\r
448 \r
449 Maximum - Maximum boundary of the numeric\r
450 \r
451 Step - Step of the numeric\r
452 \r
453 Default - Default value\r
454 \r
455 Flags - Flags of the numeric\r
456 \r
457 Key - Key of the numeric\r
458 \r
459 FormBuffer - The form where this numeric adds to\r
460 \r
461 StringBuffer - String buffer created for Prompt and Help.\r
462 \r
463Returns: \r
464\r
465 EFI_DEVICE_ERROR - DataWidth > 2\r
466 \r
467 EFI_SUCCESS - Numeric is successfully created\r
468\r
469--*/\r
470;\r
471\r
472EFI_STATUS\r
473CreateString (\r
474 IN UINT16 QuestionId,\r
475 IN UINT8 DataWidth,\r
476 IN CHAR16 *Prompt,\r
477 IN CHAR16 *Help,\r
478 IN UINT8 MinSize,\r
479 IN UINT8 MaxSize,\r
480 IN UINT8 Flags,\r
481 IN UINT16 Key,\r
482 IN OUT VOID *FormBuffer,\r
483 IN OUT VOID *StringBuffer\r
484 )\r
485/*++\r
486\r
487Routine Description:\r
488\r
489 Create a string\r
490 \r
491Arguments:\r
492\r
493 QuestionId - Question ID of the string\r
494 \r
495 DataWidth - DataWidth of the string\r
496 \r
497 Prompt - Prompt of the string\r
498 \r
499 Help - Help of the string\r
500 \r
501 MinSize - Min size boundary of the string\r
502 \r
503 MaxSize - Max size boundary of the string\r
504 \r
505 Flags - Flags of the string\r
506 \r
507 Key - Key of the string\r
508 \r
509 FormBuffer - The form where this string adds to\r
510 \r
511 StringBuffer - String buffer created for Prompt and Help.\r
512 \r
513Returns: \r
514\r
515 EFI_SUCCESS - String successfully created.\r
516\r
517--*/\r
518;\r
76a21f7c 519#endif\r
3eb9473e 520\r
521EFI_STATUS\r
522ExtractDataFromHiiHandle (\r
523 IN EFI_HII_HANDLE HiiHandle,\r
524 IN OUT UINT16 *ImageLength,\r
525 OUT UINT8 *DefaultImage,\r
526 OUT EFI_GUID *Guid\r
527 )\r
528/*++\r
529\r
530Routine Description:\r
531\r
532 Extract information pertaining to the HiiHandle\r
533 \r
534Arguments:\r
535\r
536 HiiHandle - Hii handle\r
537 \r
538 ImageLength - For input, length of DefaultImage;\r
539 For output, length of actually required\r
540 \r
541 DefaultImage - Image buffer prepared by caller\r
542 \r
543 Guid - Guid information about the form\r
544 \r
545Returns: \r
546\r
547 EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
548 \r
549 EFI_BUFFER_TOO_SMALL - DefualtImage has no enough ImageLength\r
550 \r
551 EFI_SUCCESS - Successfully extract data from Hii database.\r
552 \r
553 \r
554--*/\r
555;\r
556\r
557EFI_HII_HANDLE\r
558FindHiiHandle (\r
559 IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL\r
560 IN EFI_GUID *Guid\r
561 )\r
562/*++\r
563\r
564Routine Description:\r
565 Finds HII handle for given pack GUID previously registered with the HII.\r
566\r
567Arguments:\r
568 HiiProtocol - pointer to pointer to HII protocol interface. \r
569 If NULL, the interface will be found but not returned.\r
570 If it points to NULL, the interface will be found and \r
571 written back to the pointer that is pointed to.\r
572 Guid - The GUID of the pack that registered with the HII.\r
573\r
574Returns:\r
575 Handle to the HII pack previously registered by the memory driver.\r
576\r
577--*/\r
578;\r
579\r
580EFI_STATUS\r
581CreateSubTitleOpCode (\r
582 IN STRING_REF StringToken,\r
583 IN OUT VOID *FormBuffer\r
584 )\r
585/*++\r
586\r
587Routine Description:\r
588\r
589 Create a SubTitle opcode independent of string creation\r
590 This is used primarily by users who need to create just one particular valid op-code and the string\r
591 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
592 location to pre-defined forms in HII)\r
593 \r
594Arguments:\r
595\r
596 StringToken - StringToken of the subtitle\r
597 \r
598 FormBuffer - Output of subtitle as a form\r
599 \r
600Returns: \r
601\r
602 EFI_SUCCESS - Subtitle created to be a form\r
603\r
604--*/\r
605;\r
606\r
607EFI_STATUS\r
608CreateTextOpCode (\r
609 IN STRING_REF StringToken,\r
610 IN STRING_REF StringTokenTwo,\r
611 IN STRING_REF StringTokenThree,\r
612 IN UINT8 Flags,\r
613 IN UINT16 Key,\r
614 IN OUT VOID *FormBuffer\r
615 )\r
616/*++\r
617\r
618Routine Description:\r
619\r
620 Create a Text opcode independent of string creation\r
621 This is used primarily by users who need to create just one particular valid op-code and the string\r
622 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
623 location to pre-defined forms in HII)\r
624 \r
625Arguments:\r
626\r
627 StringToken - First string token of the text\r
628 \r
629 StringTokenTwo - Second string token of the text\r
630 \r
631 StringTokenThree - Help string token of the text\r
632 \r
633 Flags - Flag of the text\r
634 \r
635 Key - Key of the text\r
636 \r
637 FormBuffer - Output of text as a form\r
638 \r
639Returns: \r
640\r
641 EFI_SUCCESS - Text created to be a form\r
642\r
643--*/\r
644;\r
645\r
646EFI_STATUS\r
647CreateGotoOpCode (\r
648 IN UINT16 FormId,\r
649 IN STRING_REF StringToken,\r
650 IN STRING_REF StringTokenTwo,\r
651 IN UINT8 Flags,\r
652 IN UINT16 Key,\r
653 IN OUT VOID *FormBuffer\r
654 )\r
655/*++\r
656\r
657Routine Description:\r
658\r
659 Create a hyperlink opcode independent of string creation\r
660 This is used primarily by users who need to create just one particular valid op-code and the string\r
661 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
662 location to pre-defined forms in HII)\r
663 \r
664Arguments:\r
665\r
666 FormId - Form ID of the hyperlink\r
667 \r
668 StringToken - Prompt string token of the hyperlink\r
669 \r
670 StringTokenTwo - Help string token of the hyperlink\r
671 \r
672 Flags - Flags of the hyperlink\r
673 \r
674 Key - Key of the hyperlink\r
675 \r
676 FormBuffer - Output of hyperlink as a form\r
677 \r
678Returns: \r
679\r
680 EFI_SUCCESS - Hyperlink created to be a form\r
681\r
682--*/\r
683;\r
684\r
685EFI_STATUS\r
686CreateOneOfOpCode (\r
687 IN UINT16 QuestionId,\r
688 IN UINT8 DataWidth,\r
689 IN STRING_REF PromptToken,\r
690 IN STRING_REF HelpToken,\r
691 IN IFR_OPTION *OptionsList,\r
692 IN UINTN OptionCount,\r
693 IN OUT VOID *FormBuffer\r
694 )\r
695/*++\r
696\r
697Routine Description:\r
698\r
699 Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
700 This is used primarily by users who need to create just one particular valid op-code and the string\r
701 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
702 location to pre-defined forms in HII)\r
703\r
704 OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken\r
705 has been filled in since this routine will not generate StringToken values.\r
706 \r
707Arguments:\r
708\r
709 QuestionId - Question ID of the one-of box\r
710 \r
711 DataWidth - DataWidth of the one-of box\r
712 \r
713 PromptToken - Prompt string token of the one-of box\r
714 \r
715 HelpToken - Help string token of the one-of box\r
716 \r
717 OptionsList - Each string in it is an option of the one-of box\r
718 \r
719 OptionCount - Option string count\r
720 \r
721 FormBuffer - Output of One-Of box as a form\r
722 \r
723Returns: \r
724\r
725 EFI_SUCCESS - One-Of box created to be a form\r
726 \r
727 EFI_DEVICE_ERROR - DataWidth > 2\r
728\r
729--*/\r
730;\r
731\r
732EFI_STATUS\r
733CreateOrderedListOpCode (\r
734 IN UINT16 QuestionId,\r
735 IN UINT8 MaxEntries,\r
736 IN STRING_REF PromptToken,\r
737 IN STRING_REF HelpToken,\r
738 IN IFR_OPTION *OptionsList,\r
739 IN UINTN OptionCount,\r
740 IN OUT VOID *FormBuffer\r
741 )\r
742/*++\r
743\r
744Routine Description:\r
745\r
746 Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
747 This is used primarily by users who need to create just one particular valid op-code and the string\r
748 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
749 location to pre-defined forms in HII)\r
750\r
751 OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken\r
752 has been filled in since this routine will not generate StringToken values.\r
753 \r
754Arguments:\r
755\r
756 QuestionId - Question ID of the ordered list\r
757 \r
758 MaxEntries - MaxEntries of the ordered list\r
759 \r
760 PromptToken - Prompt string token of the ordered list\r
761 \r
762 HelpToken - Help string token of the ordered list\r
763 \r
764 OptionsList - Each string in it is an option of the ordered list\r
765 \r
766 OptionCount - Option string count\r
767 \r
768 FormBuffer - Output of ordered list as a form\r
769 \r
770Returns: \r
771\r
772 EFI_SUCCESS - Ordered list created to be a form\r
773\r
774--*/\r
775;\r
776\r
777EFI_STATUS\r
778CreateCheckBoxOpCode (\r
779 IN UINT16 QuestionId,\r
780 IN UINT8 DataWidth,\r
781 IN STRING_REF PromptToken,\r
782 IN STRING_REF HelpToken,\r
783 IN UINT8 Flags,\r
784 IN UINT16 Key,\r
785 IN OUT VOID *FormBuffer\r
786 )\r
787/*++\r
788\r
789Routine Description:\r
790\r
791 Create a checkbox opcode independent of string creation\r
792 This is used primarily by users who need to create just one particular valid op-code and the string\r
793 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
794 location to pre-defined forms in HII)\r
795 \r
796Arguments:\r
797\r
798 QuestionId - Question ID of the check box\r
799 \r
800 DataWidth - DataWidth of the check box\r
801 \r
802 PromptToken - Prompt string token of the check box\r
803 \r
804 HelpToken - Help string token of the check box\r
805 \r
806 Flags - Flags of the check box\r
807 \r
808 Key - Key of the check box\r
809 \r
810 FormBuffer - Output of the check box as a form\r
811 \r
812Returns: \r
813\r
814 EFI_SUCCESS - Checkbox created to be a form\r
815 \r
816 EFI_DEVICE_ERROR - DataWidth > 1\r
817\r
818--*/\r
819;\r
820\r
821EFI_STATUS\r
822CreateNumericOpCode (\r
823 IN UINT16 QuestionId,\r
824 IN UINT8 DataWidth,\r
825 IN STRING_REF PromptToken,\r
826 IN STRING_REF HelpToken,\r
827 IN UINT16 Minimum,\r
828 IN UINT16 Maximum,\r
829 IN UINT16 Step,\r
830 IN UINT16 Default,\r
831 IN UINT8 Flags,\r
832 IN UINT16 Key,\r
833 IN OUT VOID *FormBuffer\r
834 )\r
835/*++\r
836\r
837Routine Description:\r
838\r
839 Create a numeric opcode independent of string creation\r
840 This is used primarily by users who need to create just one particular valid op-code and the string\r
841 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
842 location to pre-defined forms in HII)\r
843 \r
844Arguments:\r
845\r
846 QuestionId - Question ID of the numeric\r
847 \r
848 DataWidth - DataWidth of the numeric\r
849 \r
850 PromptToken - Prompt string token of the numeric\r
851 \r
852 HelpToken - Help string token of the numeric\r
853 \r
854 Minimum - Minumun boundary of the numeric\r
855 \r
856 Maximum - Maximum boundary of the numeric\r
857 \r
858 Step - Step of the numeric\r
859 \r
860 Default - Default value of the numeric\r
861 \r
862 Flags - Flags of the numeric\r
863 \r
864 Key - Key of the numeric\r
865 \r
866 FormBuffer - Output of the numeric as a form\r
867 \r
868Returns: \r
869\r
870 EFI_SUCCESS - The numeric created to be a form.\r
871 \r
872 EFI_DEVICE_ERROR - DataWidth > 2\r
873\r
874--*/\r
875;\r
876\r
877EFI_STATUS\r
878CreateStringOpCode (\r
879 IN UINT16 QuestionId,\r
880 IN UINT8 DataWidth,\r
881 IN STRING_REF PromptToken,\r
882 IN STRING_REF HelpToken,\r
883 IN UINT8 MinSize,\r
884 IN UINT8 MaxSize,\r
885 IN UINT8 Flags,\r
886 IN UINT16 Key,\r
887 IN OUT VOID *FormBuffer\r
888 )\r
889/*++\r
890\r
891Routine Description:\r
892\r
893 Create a numeric opcode independent of string creation\r
894 This is used primarily by users who need to create just one particular valid op-code and the string\r
895 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
896 location to pre-defined forms in HII)\r
897 \r
898Arguments:\r
899\r
900 QuestionId - Question ID of the string\r
901 \r
902 DataWidth - DataWidth of the string\r
903 \r
904 PromptToken - Prompt token of the string\r
905 \r
906 HelpToken - Help token of the string\r
907 \r
908 MinSize - Min size boundary of the string\r
909 \r
910 MaxSize - Max size boundary of the string\r
911 \r
912 Flags - Flags of the string\r
913 \r
914 Key - Key of the string\r
915 \r
916 FormBuffer - Output of the string as a form\r
917 \r
918Returns: \r
919\r
920 EFI_SUCCESS - String created to be a form.\r
921\r
922--*/\r
923;\r
924\r
76a21f7c 925#ifdef SUPPORT_DEPRECATED_IFRSUPPORTLIB_API\r
3eb9473e 926EFI_STATUS\r
927ValidateDataFromHiiHandle (\r
928 IN EFI_HII_HANDLE HiiHandle,\r
929 OUT BOOLEAN *Results\r
930 )\r
931/*++\r
932\r
933Routine Description:\r
934\r
935 Validate that the data associated with the HiiHandle in NVRAM is within\r
936 the reasonable parameters for that FormSet. Values for strings and passwords\r
937 are not verified due to their not having the equivalent of valid range settings.\r
938 \r
939Arguments:\r
940\r
941 HiiHandle - Handle of the HII database entry to query\r
942\r
943 Results - If return Status is EFI_SUCCESS, Results provides valid data\r
944 TRUE = NVRAM Data is within parameters\r
945 FALSE = NVRAM Data is NOT within parameters\r
946 \r
947Returns: \r
948\r
949 EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
950 \r
951 EFI_SUCCESS - Data successfully validated\r
952--*/\r
953;\r
76a21f7c 954#endif\r
3eb9473e 955\r
956EFI_STATUS\r
957CreateBannerOpCode (\r
958 IN UINT16 Title,\r
959 IN UINT16 LineNumber,\r
960 IN UINT8 Alignment,\r
961 IN OUT VOID *FormBuffer\r
962 )\r
963/*++\r
964\r
965Routine Description:\r
966\r
967 Create a banner opcode. This is primarily used by the FrontPage implementation from BDS.\r
968 \r
969Arguments:\r
970\r
971 Title - Title of the banner\r
972 \r
973 LineNumber - LineNumber of the banner\r
974 \r
975 Alignment - Alignment of the banner\r
976 \r
977 FormBuffer - Output of banner as a form\r
978 \r
979Returns: \r
980\r
981 EFI_SUCCESS - Banner created to be a form.\r
982\r
983--*/\r
984;\r
985\r
986EFI_HII_PACKAGES *\r
987PreparePackages (\r
988 IN UINTN NumberOfPackages,\r
989 IN EFI_GUID *GuidId,\r
990 ...\r
991 )\r
992/*++\r
993\r
994Routine Description:\r
995 \r
996 Assemble EFI_HII_PACKAGES according to the passed in packages.\r
997 \r
998Arguments:\r
999 \r
1000 NumberOfPackages - Number of packages.\r
1001 GuidId - Package GUID.\r
1002 \r
1003Returns: \r
1004 \r
1005 Pointer of EFI_HII_PACKAGES.\r
1006 \r
1007--*/\r
1008;\r
1009\r
1010VOID\r
1011EfiLibHiiVariablePackGetMap (\r
1012 IN EFI_HII_VARIABLE_PACK *Pack, \r
1013 OUT CHAR16 **Name, OPTIONAL\r
1014 OUT EFI_GUID **Guid, OPTIONAL\r
1015 OUT UINT16 *Id, OPTIONAL\r
1016 OUT VOID **Var, OPTIONAL\r
1017 OUT UINTN *Size OPTIONAL\r
1018 ) \r
1019/*++\r
1020\r
1021Routine Description:\r
1022\r
1023 Extracts a variable form a Pack.\r
1024\r
1025Arguments:\r
1026\r
1027 Pack - List of variables\r
1028 Name - Name of the variable/map\r
1029 Guid - GUID of the variable/map\r
1030 Var - Pointer to the variable/map\r
1031 Size - Size of the variable/map in bytes\r
1032\r
1033Returns: \r
1034\r
1035 VOID.\r
1036\r
1037--*/\r
1038;\r
1039\r
1040UINTN\r
1041EfiLibHiiVariablePackListGetMapCnt (\r
1042 IN EFI_HII_VARIABLE_PACK_LIST *List\r
1043 )\r
1044/*++\r
1045\r
1046Routine Description:\r
1047\r
1048 Finds a count of the variables/maps in the List.\r
1049\r
1050Arguments:\r
1051\r
1052 List - List of variables\r
1053\r
1054Returns: \r
1055\r
1056 Number of Map in the variable pack list.\r
1057\r
1058--*/\r
1059;\r
1060\r
1061typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (\r
1062 IN CHAR16 *Name,\r
1063 IN EFI_GUID *Guid,\r
1064 IN UINT16 Id,\r
1065 IN VOID *Var,\r
1066 IN UINTN Size\r
1067 ) \r
1068/*++\r
1069\r
1070Routine Description:\r
1071\r
1072 type definition for the callback to be \r
1073 used with EfiLibHiiVariablePackListForEachVar().\r
1074\r
1075Arguments:\r
1076\r
1077 Id - Variable/Map ID\r
1078 Name - Name of the variable/map\r
1079 Guid - GUID of the variable/map\r
1080 Var - Pointer to the variable/map\r
1081 Size - Size of the variable/map in bytes\r
1082\r
1083Returns: \r
1084\r
1085 VOID\r
1086\r
1087--*/\r
1088;\r
1089\r
1090VOID\r
1091EfiLibHiiVariablePackListForEachVar (\r
1092 IN EFI_HII_VARIABLE_PACK_LIST *List,\r
1093 IN EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK *Callback\r
1094 )\r
1095/*++\r
1096\r
1097Routine Description:\r
1098\r
1099 Will iterate all variable/maps as appearing \r
1100 in List and for each, it will call the Callback.\r
1101\r
1102Arguments:\r
1103\r
1104 List - List of variables\r
1105 Callback - Routine to be called for each iterated variable.\r
1106\r
1107Returns: \r
1108\r
1109 VOID\r
1110\r
1111--*/\r
1112;\r
1113\r
1114EFI_STATUS\r
1115EfiLibHiiVariablePackListGetMapByIdx (\r
1116 IN UINTN Idx, \r
1117 IN EFI_HII_VARIABLE_PACK_LIST *List, \r
1118 OUT CHAR16 **Name, OPTIONAL\r
1119 OUT EFI_GUID **Guid, OPTIONAL\r
1120 OUT UINT16 *Id, OPTIONAL\r
1121 OUT VOID **Var,\r
1122 OUT UINTN *Size\r
1123 ) \r
1124/*++\r
1125\r
1126Routine Description:\r
1127\r
1128 Finds a variable form List given \r
1129 the order number as appears in the List.\r
1130\r
1131Arguments:\r
1132\r
1133 Idx - The index of the variable/map to retrieve\r
1134 List - List of variables\r
1135 Name - Name of the variable/map\r
1136 Guid - GUID of the variable/map\r
1137 Var - Pointer to the variable/map\r
1138 Size - Size of the variable/map in bytes\r
1139\r
1140Returns:\r
1141\r
1142 EFI_SUCCESS - Variable is found, OUT parameters are valid\r
1143 EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
1144\r
1145--*/\r
1146;\r
1147\r
1148EFI_STATUS\r
1149EfiLibHiiVariablePackListGetMapById (\r
1150 IN UINT16 Id, \r
1151 IN EFI_HII_VARIABLE_PACK_LIST *List,\r
1152 OUT CHAR16 **Name, OPTIONAL\r
1153 OUT EFI_GUID **Guid, OPTIONAL\r
1154 OUT VOID **Var,\r
1155 OUT UINTN *Size\r
1156 ) \r
1157/*++\r
1158\r
1159Routine Description:\r
1160\r
1161 Finds a variable form List given the \r
1162 order number as appears in the List.\r
1163\r
1164Arguments:\r
1165\r
1166 Id - The ID of the variable/map to retrieve\r
1167 List - List of variables\r
1168 Name - Name of the variable/map\r
1169 Guid - GUID of the variable/map\r
1170 Var - Pointer to the variable/map\r
1171 Size - Size of the variable/map in bytes\r
1172\r
1173Returns:\r
1174\r
1175 EFI_SUCCESS - Variable is found, OUT parameters are valid\r
1176 EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
1177\r
1178--*/\r
1179;\r
1180\r
1181EFI_STATUS\r
1182EfiLibHiiVariablePackListGetMap (\r
1183 IN EFI_HII_VARIABLE_PACK_LIST *List,\r
1184 IN CHAR16 *Name,\r
1185 IN EFI_GUID *Guid,\r
1186 OUT UINT16 *Id,\r
1187 OUT VOID **Var, \r
1188 OUT UINTN *Size\r
1189 ) \r
1190/*++\r
1191\r
1192Routine Description:\r
1193\r
1194 Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
1195\r
1196Arguments:\r
1197\r
1198 List - List of variables\r
1199 Name - Name of the variable/map to be found\r
1200 Guid - GUID of the variable/map to be found\r
1201 Var - Pointer to the variable/map found\r
1202 Size - Size of the variable/map in bytes found\r
1203\r
1204Returns:\r
1205\r
1206 EFI_SUCCESS - variable is found, OUT parameters are valid\r
1207 EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
1208\r
1209--*/\r
1210;\r
1211\r
1212EFI_STATUS\r
1213EfiLibHiiVariableRetrieveFromNv (\r
1214 IN CHAR16 *Name,\r
1215 IN EFI_GUID *Guid,\r
1216 IN UINTN Size,\r
1217 OUT VOID **Var\r
1218 )\r
1219/*++\r
1220\r
1221Routine Description:\r
1222 Finds out if a variable of specific Name/Guid/Size exists in NV. \r
1223 If it does, it will retrieve it into the Var. \r
1224\r
1225Arguments:\r
1226 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
1227 Var - Variable will be retrieved into buffer pointed by this pointer.\r
1228 If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
1229Returns:\r
1230 EFI_SUCCESS - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
1231 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.\r
1232 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
1233\r
1234--*/\r
1235;\r
1236\r
1237////\r
1238//// Variable override support.\r
1239////\r
1240\r
1241EFI_STATUS\r
1242EfiLibHiiVariableOverrideIfSuffix (\r
1243 IN CHAR16 *Suffix,\r
1244 IN CHAR16 *Name,\r
1245 IN EFI_GUID *Guid,\r
1246 IN UINTN Size,\r
1247 OUT VOID *Var\r
1248 ) \r
1249/*++\r
1250\r
1251Routine Description:\r
1252 Overrrides the variable with NV data if found.\r
1253 But it only does it if the Name ends with specified Suffix.\r
1254 For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
1255 the Suffix matches the end of Name, so the variable will be loaded from NV\r
1256 provided the variable exists and the GUID and Size matches.\r
1257\r
1258Arguments:\r
1259 Suffix - Suffix the Name should end with.\r
1260 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
1261 Var - Variable will be retrieved into this buffer.\r
1262 Caller is responsible for providing storage of exactly Size size in bytes.\r
1263Returns:\r
1264 EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.\r
1265 EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
1266 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.\r
1267 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
1268\r
1269--*/\r
1270;\r
1271\r
1272EFI_STATUS\r
1273EfiLibHiiVariableOverrideBySuffix (\r
1274 IN CHAR16 *Suffix,\r
1275 IN CHAR16 *Name,\r
1276 IN EFI_GUID *Guid,\r
1277 IN UINTN Size,\r
1278 OUT VOID *Var\r
1279 ) \r
1280/*++\r
1281\r
1282Routine Description:\r
1283 Overrrides the variable with NV data if found.\r
1284 But it only does it if the NV contains the same variable with Name is appended with Suffix. \r
1285 For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
1286 the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
1287 will be loaded from NV provided the variable exists and the GUID and Size matches.\r
1288\r
1289Arguments:\r
1290 Suffix - Suffix the variable will be appended with.\r
1291 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
1292 Var - Variable will be retrieved into this buffer.\r
1293 Caller is responsible for providing storage of exactly Size size in bytes.\r
1294\r
1295Returns:\r
1296 EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.\r
1297 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.\r
1298 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
1299\r
1300--*/\r
1301;\r
1302\r
1303#endif\r