2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #include <Protocol/SimpleTextOut.h>
23 #include <Protocol/SimpleTextIn.h>
24 #include <Protocol/FormBrowser2.h>
25 #include <Protocol/DevicePath.h>
26 #include <Protocol/UnicodeCollation.h>
27 #include <Protocol/HiiConfigAccess.h>
28 #include <Protocol/HiiConfigRouting.h>
29 #include <Protocol/HiiDatabase.h>
30 #include <Protocol/HiiString.h>
32 #include <Guid/MdeModuleHii.h>
34 #include <Library/PrintLib.h>
35 #include <Library/DebugLib.h>
36 #include <Library/BaseMemoryLib.h>
37 #include <Library/UefiRuntimeServicesTableLib.h>
38 #include <Library/UefiDriverEntryPoint.h>
39 #include <Library/UefiBootServicesTableLib.h>
40 #include <Library/BaseLib.h>
41 #include <Library/MemoryAllocationLib.h>
42 #include <Library/HiiLib.h>
43 #include <Library/PcdLib.h>
44 #include <Library/DevicePathLib.h>
49 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
52 extern UINT8 SetupBrowserStrings
[];
57 #define BANNER_HEIGHT 6
58 #define BANNER_COLUMNS 3
60 #define FRONT_PAGE_HEADER_HEIGHT 6
61 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
62 #define LEFT_SKIPPED_COLUMNS 4
63 #define FOOTER_HEIGHT 4
64 #define STATUS_BAR_HEIGHT 1
65 #define SCROLL_ARROW_HEIGHT 1
66 #define POPUP_PAD_SPACE_COUNT 5
67 #define POPUP_FRAME_WIDTH 2
70 // Definition for function key setting
72 #define NONE_FUNCTION_KEY_SETTING 0
73 #define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_ONE | FUNCTION_TWO | FUNCTION_NINE | FUNCTION_TEN)
75 #define FUNCTION_ONE (1 << 0)
76 #define FUNCTION_TWO (1 << 1)
77 #define FUNCTION_NINE (1 << 2)
78 #define FUNCTION_TEN (1 << 3)
83 } FUNCTIION_KEY_SETTING
;
86 // Character definitions
88 #define CHAR_SPACE 0x0020
89 #define UPPER_LOWER_CASE_OFFSET 0x20
94 #define ONE_SECOND 10000000
97 // Display definitions
99 #define LEFT_HYPER_DELIMITER L'<'
100 #define RIGHT_HYPER_DELIMITER L'>'
102 #define LEFT_ONEOF_DELIMITER L'<'
103 #define RIGHT_ONEOF_DELIMITER L'>'
105 #define LEFT_NUMERIC_DELIMITER L'['
106 #define RIGHT_NUMERIC_DELIMITER L']'
108 #define LEFT_CHECKBOX_DELIMITER L'['
109 #define RIGHT_CHECKBOX_DELIMITER L']'
111 #define CHECK_ON L'X'
112 #define CHECK_OFF L' '
114 #define TIME_SEPARATOR L':'
115 #define DATE_SEPARATOR L'/'
117 #define YES_ANSWER L'Y'
118 #define NO_ANSWER L'N'
121 // This is the Input Error Message
123 #define INPUT_ERROR 1
126 // This is the NV RAM update required Message
128 #define NV_UPDATE_REQUIRED 2
131 // Refresh the Status Bar with flags
133 #define REFRESH_STATUS_BAR 0xff
136 // Incremental string lenght of ConfigRequest
138 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
141 // HII value compare result
143 #define HII_VALUE_UNDEFINED 0
144 #define HII_VALUE_EQUAL 1
145 #define HII_VALUE_LESS_THAN 2
146 #define HII_VALUE_GREATER_THAN 3
149 // Incremental size of stack for expression
151 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
154 #define EFI_SPECIFICATION_ERRATA_VERSION 0
156 #define EFI_IFR_SPECIFICATION_VERSION \
157 ((((EFI_SPECIFICATION_VERSION) >> 8) & 0xff00) | \
158 (((EFI_SPECIFICATION_VERSION) & 0xf) << 4) | \
159 ((EFI_SPECIFICATION_ERRATA_VERSION) & 0xf))
161 #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')
170 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2
;
172 } SETUP_DRIVER_PRIVATE_DATA
;
175 EFI_STRING_ID Banner
[BANNER_HEIGHT
][BANNER_COLUMNS
];
179 // IFR relative definition
181 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
182 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
183 #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
184 #define EFI_HII_EXPRESSION_SUPPRESS_IF 3
185 #define EFI_HII_EXPRESSION_DISABLE_IF 4
186 #define EFI_HII_EXPRESSION_VALUE 5
187 #define EFI_HII_EXPRESSION_RULE 6
189 #define EFI_HII_VARSTORE_BUFFER 0
190 #define EFI_HII_VARSTORE_NAME_VALUE 1
191 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
193 #define FORM_INCONSISTENT_VALIDATION 0
194 #define FORM_NO_SUBMIT_VALIDATION 1
198 EFI_IFR_TYPE_VALUE Value
;
201 #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')
211 #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)
213 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
219 UINT8 Type
; // Storage type
224 CHAR16
*Name
; // For EFI_IFR_VARSTORE
227 UINT8
*EditBuffer
; // Edit copy for Buffer Storage
229 LIST_ENTRY NameValueListHead
; // List of NAME_VALUE_NODE
231 UINT32 Attributes
; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute
233 CHAR16
*ConfigHdr
; // <ConfigHdr>
234 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
235 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
236 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
239 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
241 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
249 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
250 UINT8 Flags
; // For EFI_IFR_SPAN
251 UINT8 RuleId
; // For EFI_IFR_RULE_REF
253 EFI_HII_VALUE Value
; // For EFI_IFR_EQ_ID_VAL, EFI_IFR_UINT64, EFI_IFR_UINT32, EFI_IFR_UINT16, EFI_IFR_UINT8, EFI_IFR_STRING_REF1
255 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_LIST, EFI_IFR_QUESTION_REF1
256 EFI_QUESTION_ID QuestionId2
;
258 UINT16 ListLength
; // For EFI_IFR_EQ_ID_LIST
261 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
265 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
267 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
273 UINT8 Type
; // Type for this expression
275 UINT8 RuleId
; // For EFI_IFR_RULE only
276 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
278 EFI_HII_VALUE Result
; // Expression evaluation result
280 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
283 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
285 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
292 EFI_HII_VALUE Value
; // Default value
294 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
297 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
299 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
308 EFI_IMAGE_ID ImageId
;
310 FORM_EXPRESSION
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
313 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
315 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
320 UINT8 Operand
; // The operand (first byte) of this Statement or Question
325 EFI_STRING_ID Prompt
;
327 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
332 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
333 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
334 FORMSET_STORAGE
*Storage
;
336 EFI_STRING_ID VarName
;
341 CHAR16
*VariableName
; // Name/Value or EFI Variable name
342 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
344 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
345 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
348 // OpCode specific members
350 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
351 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
352 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
354 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
355 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
357 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
358 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
361 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
362 EFI_FORM_ID RefFormId
; // for EFI_IFR_REF
363 EFI_QUESTION_ID RefQuestionId
; // for EFI_IFR_REF2
364 EFI_GUID RefFormSetId
; // for EFI_IFR_REF3
365 EFI_STRING_ID RefDevicePath
; // for EFI_IFR_REF4
368 // Get from IFR parsing
370 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
371 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
372 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
374 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
375 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
376 BOOLEAN InSubtitle
; // nesting inside of EFI_IFR_SUBTITLE
378 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
379 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
380 FORM_EXPRESSION
*GrayOutExpression
; // nesting inside of GrayOutIf
381 FORM_EXPRESSION
*SuppressExpression
; // nesting inside of SuppressIf
383 } FORM_BROWSER_STATEMENT
;
385 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
387 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
394 EFI_STRING_ID FormTitle
;
396 EFI_IMAGE_ID ImageId
;
398 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
399 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
402 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
404 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
411 EFI_STRING_ID DefaultName
;
412 } FORMSET_DEFAULTSTORE
;
414 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
417 EFI_HII_HANDLE HiiHandle
;
418 EFI_HANDLE DriverHandle
;
419 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
420 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
422 UINTN IfrBinaryLength
;
423 UINT8
*IfrBinaryData
;
426 EFI_STRING_ID FormSetTitle
;
430 EFI_IMAGE_ID ImageId
;
432 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
433 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
435 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
436 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
437 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
438 } FORM_BROWSER_FORMSET
;
441 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
442 extern EFI_HII_STRING_PROTOCOL
*mHiiString
;
443 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
445 extern BANNER_DATA
*BannerData
;
446 extern EFI_HII_HANDLE FrontPageHandle
;
447 extern UINTN gClassOfVfr
;
448 extern UINTN gFunctionKeySetting
;
449 extern BOOLEAN gResetRequired
;
450 extern BOOLEAN gNvUpdateRequired
;
451 extern EFI_HII_HANDLE gHiiHandle
;
452 extern UINT16 gDirection
;
453 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
454 extern BOOLEAN gUpArrow
;
455 extern BOOLEAN gDownArrow
;
458 // Browser Global Strings
460 extern CHAR16
*gFunctionOneString
;
461 extern CHAR16
*gFunctionTwoString
;
462 extern CHAR16
*gFunctionNineString
;
463 extern CHAR16
*gFunctionTenString
;
464 extern CHAR16
*gEnterString
;
465 extern CHAR16
*gEnterCommitString
;
466 extern CHAR16
*gEnterEscapeString
;
467 extern CHAR16
*gEscapeString
;
468 extern CHAR16
*gSaveFailed
;
469 extern CHAR16
*gMoveHighlight
;
470 extern CHAR16
*gMakeSelection
;
471 extern CHAR16
*gDecNumericInput
;
472 extern CHAR16
*gHexNumericInput
;
473 extern CHAR16
*gToggleCheckBox
;
474 extern CHAR16
*gPromptForData
;
475 extern CHAR16
*gPromptForPassword
;
476 extern CHAR16
*gPromptForNewPassword
;
477 extern CHAR16
*gConfirmPassword
;
478 extern CHAR16
*gConfirmError
;
479 extern CHAR16
*gPassowordInvalid
;
480 extern CHAR16
*gPressEnter
;
481 extern CHAR16
*gEmptyString
;
482 extern CHAR16
*gAreYouSure
;
483 extern CHAR16
*gYesResponse
;
484 extern CHAR16
*gNoResponse
;
485 extern CHAR16
*gMiniString
;
486 extern CHAR16
*gPlusString
;
487 extern CHAR16
*gMinusString
;
488 extern CHAR16
*gAdjustNumber
;
489 extern CHAR16
*gSaveChanges
;
490 extern CHAR16
*gOptionMismatch
;
492 extern CHAR16 gPromptBlockWidth
;
493 extern CHAR16 gOptionBlockWidth
;
494 extern CHAR16 gHelpBlockWidth
;
496 extern EFI_GUID gZeroGuid
;
497 extern EFI_GUID gTianoHiiIfrGuid
;
500 // Global Procedure Defines
504 Initialize the HII String Token to the correct values.
508 InitializeBrowserStrings (
513 Prints a unicode string to the default console,
516 @param String String pointer.
518 @return Length of string printed to the console
527 Prints a chracter to the default console,
530 @param Character Character to print.
532 @return Length of string printed to the console.
541 Prints a formatted unicode string to the default console, at
542 the supplied cursor position.
544 @param Column The cursor position to print the string at.
545 @param Row The cursor position to print the string at
546 @param Fmt Format string
547 @param ... Variable argument list for formating string.
549 @return Length of string printed to the console
561 Prints a unicode string to the default console, at
562 the supplied cursor position, using L"%s" format.
564 @param Column The cursor position to print the string at.
565 @param Row The cursor position to print the string at
566 @param String String pointer.
568 @return Length of string printed to the console
579 Prints a chracter to the default console, at
580 the supplied cursor position, using L"%c" format.
582 @param Column The cursor position to print the string at.
583 @param Row The cursor position to print the string at.
584 @param Character Character to print.
586 @return Length of string printed to the console.
597 Parse opcodes in the formset IFR binary.
599 @param FormSet Pointer of the FormSet data structure.
601 @retval EFI_SUCCESS Opcode parse success.
602 @retval Other Opcode parse fail.
607 IN FORM_BROWSER_FORMSET
*FormSet
611 Free resources allocated for a FormSet.
613 @param FormSet Pointer of the FormSet
618 IN OUT FORM_BROWSER_FORMSET
*FormSet
622 This function displays the page frame.
631 Create a new string in HII Package List.
633 @param String The String to be added
634 @param HiiHandle The package list in the HII database to insert the
637 @return The output string.
643 IN EFI_HII_HANDLE HiiHandle
647 Delete a string from HII Package List.
649 @param StringId Id of the string in HII database.
650 @param HiiHandle The HII package list handle.
652 @retval EFI_SUCCESS The string was deleted successfully.
657 IN EFI_STRING_ID StringId
,
658 IN EFI_HII_HANDLE HiiHandle
662 Get the string based on the StringId and HII Package List Handle.
664 @param Token The String's ID.
665 @param HiiHandle The package list in the HII database to search for
666 the specified string.
668 @return The output string.
673 IN EFI_STRING_ID Token
,
674 IN EFI_HII_HANDLE HiiHandle
678 Draw a pop up windows based on the dimension, number of lines and
681 @param RequestedWidth The width of the pop-up.
682 @param NumberOfLines The number of lines.
683 @param Marker The variable argument list for the list of string to be printed.
688 IN UINTN RequestedWidth
,
689 IN UINTN NumberOfLines
,
694 Routine used to abstract a generic dialog interface and return the selected key or string
696 @param NumberOfLines The number of lines for the dialog box
697 @param HotKey Defines whether a single character is parsed
698 (TRUE) and returned in KeyValue or a string is
699 returned in StringBuffer. Two special characters
700 are considered when entering a string, a SCAN_ESC
701 and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates
702 string input and returns
703 @param MaximumStringSize The maximum size in bytes of a typed in string
704 (each character is a CHAR16) and the minimum
705 string returned is two bytes
706 @param StringBuffer The passed in pointer to the buffer which will
707 hold the typed in string if HotKey is FALSE
708 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
709 @param ... A series of (quantity == NumberOfLines) text
710 strings which will be used to construct the dialog
713 @retval EFI_SUCCESS Displayed dialog and received user interaction
714 @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.
715 (StringBuffer == NULL) && (HotKey == FALSE))
716 @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine
721 IN UINTN NumberOfLines
,
723 IN UINTN MaximumStringSize
,
724 OUT CHAR16
*StringBuffer
,
725 OUT EFI_INPUT_KEY
*KeyValue
,
730 Get Question's current Value.
732 @param FormSet FormSet data structure.
733 @param Form Form data structure.
734 @param Question Question to be initialized.
735 @param Cached TRUE: get from Edit copy FALSE: get from original
738 @retval EFI_SUCCESS The function completed successfully.
743 IN FORM_BROWSER_FORMSET
*FormSet
,
744 IN FORM_BROWSER_FORM
*Form
,
745 IN OUT FORM_BROWSER_STATEMENT
*Question
,
750 Save Question Value to edit copy(cached) or Storage(uncached).
752 @param FormSet FormSet data structure.
753 @param Form Form data structure.
754 @param Question Pointer to the Question.
755 @param Cached TRUE: set to Edit copy FALSE: set to original
758 @retval EFI_SUCCESS The function completed successfully.
763 IN FORM_BROWSER_FORMSET
*FormSet
,
764 IN FORM_BROWSER_FORM
*Form
,
765 IN OUT FORM_BROWSER_STATEMENT
*Question
,
770 Perform inconsistent check for a Form.
772 @param FormSet FormSet data structure.
773 @param Form Form data structure.
774 @param Question The Question to be validated.
775 @param Type Validation type: InConsistent or NoSubmit
777 @retval EFI_SUCCESS Form validation pass.
778 @retval other Form validation failed.
783 IN FORM_BROWSER_FORMSET
*FormSet
,
784 IN FORM_BROWSER_FORM
*Form
,
785 IN FORM_BROWSER_STATEMENT
*Question
,
792 @param FormSet FormSet data structure.
793 @param Form Form data structure.
795 @retval EFI_SUCCESS The function completed successfully.
800 IN FORM_BROWSER_FORMSET
*FormSet
,
801 IN FORM_BROWSER_FORM
*Form
805 Reset Question to its default value.
807 @param FormSet The form set.
808 @param Form The form.
809 @param Question The question.
810 @param DefaultId The Class of the default.
812 @retval EFI_SUCCESS Question is reset to default value.
817 IN FORM_BROWSER_FORMSET
*FormSet
,
818 IN FORM_BROWSER_FORM
*Form
,
819 IN FORM_BROWSER_STATEMENT
*Question
,
824 Get current setting of Questions.
826 @param FormSet FormSet data structure.
828 @retval EFI_SUCCESS The function completed successfully.
832 InitializeCurrentSetting (
833 IN OUT FORM_BROWSER_FORMSET
*FormSet
837 Initialize the internal data structure of a FormSet.
839 @param Handle PackageList Handle
840 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
841 GUID), take the first FormSet found in package
843 @param FormSet FormSet data structure.
845 @retval EFI_SUCCESS The function completed successfully.
846 @retval EFI_NOT_FOUND The specified FormSet could not be found.
851 IN EFI_HII_HANDLE Handle
,
852 IN OUT EFI_GUID
*FormSetGuid
,
853 OUT FORM_BROWSER_FORMSET
*FormSet
857 Reset Questions in a Form to their default value.
859 @param FormSet FormSet data structure.
860 @param Form The Form which to be reset.
861 @param DefaultId The Class of the default.
863 @retval EFI_SUCCESS The function completed successfully.
868 IN FORM_BROWSER_FORMSET
*FormSet
,
869 IN FORM_BROWSER_FORM
*Form
,
874 Initialize Question's Edit copy from Storage.
876 @param FormSet FormSet data structure.
877 @param Form Form data structure.
879 @retval EFI_SUCCESS The function completed successfully.
884 IN FORM_BROWSER_FORMSET
*FormSet
,
885 IN FORM_BROWSER_FORM
*Form
889 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
891 @param Storage The Storage to be conveted.
892 @param ConfigResp The returned <ConfigResp>.
894 @retval EFI_SUCCESS Convert success.
895 @retval EFI_INVALID_PARAMETER Incorrect storage type.
899 StorageToConfigResp (
900 IN FORMSET_STORAGE
*Storage
,
901 IN CHAR16
**ConfigResp
905 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
907 @param Storage The Storage to receive the settings.
908 @param ConfigResp The <ConfigResp> to be converted.
910 @retval EFI_SUCCESS Convert success.
911 @retval EFI_INVALID_PARAMETER Incorrect storage type.
915 ConfigRespToStorage (
916 IN FORMSET_STORAGE
*Storage
,
917 IN CHAR16
*ConfigResp
921 Fill storage's edit copy with settings requested from Configuration Driver.
923 @param FormSet FormSet data structure.
924 @param Storage Buffer Storage.
926 @retval EFI_SUCCESS The function completed successfully.
931 IN FORM_BROWSER_FORMSET
*FormSet
,
932 IN FORMSET_STORAGE
*Storage
936 Fetch the Ifr binary data of a FormSet.
938 @param Handle PackageList Handle
939 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
940 GUID), take the first FormSet found in package
942 @param BinaryLength The length of the FormSet IFR binary.
943 @param BinaryData The buffer designed to receive the FormSet.
945 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
946 BufferLength was updated.
947 @retval EFI_INVALID_PARAMETER The handle is unknown.
948 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
949 be found with the requested FormId.
954 IN EFI_HII_HANDLE Handle
,
955 IN OUT EFI_GUID
*FormSetGuid
,
956 OUT UINTN
*BinaryLength
,
957 OUT UINT8
**BinaryData
961 This is the routine which an external caller uses to direct the browser
962 where to obtain it's information.
965 @param This The Form Browser protocol instanse.
966 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
967 display a list of the formsets for the handles specified.
968 @param HandleCount The number of Handles specified in Handle.
969 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
970 field in the EFI_IFR_FORM_SET op-code for the specified
971 forms-based package. If FormSetGuid is NULL, then this
972 function will display the first found forms package.
973 @param FormId This field specifies which EFI_IFR_FORM to render as the first
974 displayable page. If this field has a value of 0x0000, then
975 the forms browser will render the specified forms in their encoded order.
976 ScreenDimenions - This allows the browser to be called so that it occupies a
977 portion of the physical screen instead of dynamically determining the screen dimensions.
978 ActionRequest - Points to the action recommended by the form.
979 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
981 @param ActionRequest Points to the action recommended by the form.
983 @retval EFI_SUCCESS The function completed successfully.
984 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
985 @retval EFI_NOT_FOUND No valid forms could be found to display.
991 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
992 IN EFI_HII_HANDLE
*Handles
,
993 IN UINTN HandleCount
,
994 IN EFI_GUID
*FormSetGuid
, OPTIONAL
995 IN UINT16 FormId
, OPTIONAL
996 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
997 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1001 This function is called by a callback handler to retrieve uncommitted state
1002 data from the browser.
1004 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1006 @param ResultsDataSize A pointer to the size of the buffer associated
1008 @param ResultsData A string returned from an IFR browser or
1009 equivalent. The results string will have no
1010 routing information in them.
1011 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1012 (if RetrieveData = TRUE) data from the uncommitted
1013 browser state information or set (if RetrieveData
1014 = FALSE) data in the uncommitted browser state
1016 @param VariableGuid An optional field to indicate the target variable
1018 @param VariableName An optional field to indicate the target
1019 human-readable variable name.
1021 @retval EFI_SUCCESS The results have been distributed or are awaiting
1023 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1024 contain the results data.
1030 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1031 IN OUT UINTN
*ResultsDataSize
,
1032 IN OUT EFI_STRING ResultsData
,
1033 IN BOOLEAN RetrieveData
,
1034 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1035 IN CONST CHAR16
*VariableName OPTIONAL