2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007 - 2009, 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>
33 #include <Guid/HiiPlatformSetupFormset.h>
35 #include <Library/PrintLib.h>
36 #include <Library/DebugLib.h>
37 #include <Library/BaseMemoryLib.h>
38 #include <Library/UefiRuntimeServicesTableLib.h>
39 #include <Library/UefiDriverEntryPoint.h>
40 #include <Library/UefiBootServicesTableLib.h>
41 #include <Library/BaseLib.h>
42 #include <Library/MemoryAllocationLib.h>
43 #include <Library/HiiLib.h>
44 #include <Library/PcdLib.h>
45 #include <Library/DevicePathLib.h>
50 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
53 extern UINT8 SetupBrowserStrings
[];
58 #define BANNER_HEIGHT 6
59 #define BANNER_COLUMNS 3
61 #define FRONT_PAGE_HEADER_HEIGHT 6
62 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
63 #define LEFT_SKIPPED_COLUMNS 4
64 #define FOOTER_HEIGHT 4
65 #define STATUS_BAR_HEIGHT 1
66 #define SCROLL_ARROW_HEIGHT 1
67 #define POPUP_PAD_SPACE_COUNT 5
68 #define POPUP_FRAME_WIDTH 2
71 // Definition for function key setting
73 #define NONE_FUNCTION_KEY_SETTING 0
74 #define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_NINE | FUNCTION_TEN)
76 #define FUNCTION_NINE (1 << 2)
77 #define FUNCTION_TEN (1 << 3)
82 } FUNCTIION_KEY_SETTING
;
85 // Character definitions
87 #define CHAR_SPACE 0x0020
88 #define UPPER_LOWER_CASE_OFFSET 0x20
93 #define ONE_SECOND 10000000
96 // Display definitions
98 #define LEFT_HYPER_DELIMITER L'<'
99 #define RIGHT_HYPER_DELIMITER L'>'
101 #define LEFT_ONEOF_DELIMITER L'<'
102 #define RIGHT_ONEOF_DELIMITER L'>'
104 #define LEFT_NUMERIC_DELIMITER L'['
105 #define RIGHT_NUMERIC_DELIMITER L']'
107 #define LEFT_CHECKBOX_DELIMITER L'['
108 #define RIGHT_CHECKBOX_DELIMITER L']'
110 #define CHECK_ON L'X'
111 #define CHECK_OFF L' '
113 #define TIME_SEPARATOR L':'
114 #define DATE_SEPARATOR L'/'
116 #define YES_ANSWER L'Y'
117 #define NO_ANSWER L'N'
120 // This is the Input Error Message
122 #define INPUT_ERROR 1
125 // This is the NV RAM update required Message
127 #define NV_UPDATE_REQUIRED 2
130 // Refresh the Status Bar with flags
132 #define REFRESH_STATUS_BAR 0xff
135 // Incremental string lenght of ConfigRequest
137 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
140 // HII value compare result
142 #define HII_VALUE_UNDEFINED 0
143 #define HII_VALUE_EQUAL 1
144 #define HII_VALUE_LESS_THAN 2
145 #define HII_VALUE_GREATER_THAN 3
148 // Incremental size of stack for expression
150 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
153 #define EFI_SPECIFICATION_ERRATA_VERSION 0
155 #define EFI_IFR_SPECIFICATION_VERSION \
156 ((((EFI_SPECIFICATION_VERSION) >> 8) & 0xff00) | \
157 (((EFI_SPECIFICATION_VERSION) & 0xf) << 4) | \
158 ((EFI_SPECIFICATION_ERRATA_VERSION) & 0xf))
160 #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')
169 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2
;
171 } SETUP_DRIVER_PRIVATE_DATA
;
174 EFI_STRING_ID Banner
[BANNER_HEIGHT
][BANNER_COLUMNS
];
178 // IFR relative definition
180 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
181 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
182 #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
183 #define EFI_HII_EXPRESSION_SUPPRESS_IF 3
184 #define EFI_HII_EXPRESSION_DISABLE_IF 4
185 #define EFI_HII_EXPRESSION_VALUE 5
186 #define EFI_HII_EXPRESSION_RULE 6
188 #define EFI_HII_VARSTORE_BUFFER 0
189 #define EFI_HII_VARSTORE_NAME_VALUE 1
190 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
192 #define FORM_INCONSISTENT_VALIDATION 0
193 #define FORM_NO_SUBMIT_VALIDATION 1
195 #define FORMSET_CLASS_PLATFORM_SETUP 0
196 #define FORMSET_CLASS_FRONT_PAGE 1
200 EFI_IFR_TYPE_VALUE Value
;
203 #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')
213 #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)
215 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
221 UINT8 Type
; // Storage type
226 CHAR16
*Name
; // For EFI_IFR_VARSTORE
229 UINT8
*EditBuffer
; // Edit copy for Buffer Storage
231 LIST_ENTRY NameValueListHead
; // List of NAME_VALUE_NODE
233 UINT32 Attributes
; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute
235 CHAR16
*ConfigHdr
; // <ConfigHdr>
236 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
237 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
238 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
241 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
243 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
251 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
252 UINT8 Flags
; // For EFI_IFR_SPAN
253 UINT8 RuleId
; // For EFI_IFR_RULE_REF
255 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
257 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
258 EFI_QUESTION_ID QuestionId2
;
260 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
263 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
267 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
269 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
275 UINT8 Type
; // Type for this expression
277 UINT8 RuleId
; // For EFI_IFR_RULE only
278 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
280 EFI_HII_VALUE Result
; // Expression evaluation result
282 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
285 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
287 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
294 EFI_HII_VALUE Value
; // Default value
296 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
299 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
301 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
310 EFI_IMAGE_ID ImageId
;
312 FORM_EXPRESSION
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
315 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
317 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
322 UINT8 Operand
; // The operand (first byte) of this Statement or Question
327 EFI_STRING_ID Prompt
;
329 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
334 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
335 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
336 FORMSET_STORAGE
*Storage
;
338 EFI_STRING_ID VarName
;
343 CHAR16
*VariableName
; // Name/Value or EFI Variable name
344 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
346 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
347 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
348 UINT8 ValueType
; // Data type for orderedlist value array
351 // OpCode specific members
353 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
354 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
355 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
357 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
358 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
360 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
361 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
364 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
365 EFI_FORM_ID RefFormId
; // for EFI_IFR_REF
366 EFI_QUESTION_ID RefQuestionId
; // for EFI_IFR_REF2
367 EFI_GUID RefFormSetId
; // for EFI_IFR_REF3
368 EFI_STRING_ID RefDevicePath
; // for EFI_IFR_REF4
371 // Get from IFR parsing
373 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
374 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
375 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
377 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
378 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
379 BOOLEAN InSubtitle
; // nesting inside of EFI_IFR_SUBTITLE
381 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
382 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
383 FORM_EXPRESSION
*GrayOutExpression
; // nesting inside of GrayOutIf
384 FORM_EXPRESSION
*SuppressExpression
; // nesting inside of SuppressIf
385 FORM_EXPRESSION
*DisableExpression
; // nesting inside of DisableIf
387 } FORM_BROWSER_STATEMENT
;
389 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
391 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
398 EFI_STRING_ID FormTitle
;
400 EFI_IMAGE_ID ImageId
;
402 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
403 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
404 FORM_EXPRESSION
*SuppressExpression
; // nesting inside of SuppressIf
407 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
409 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
416 EFI_STRING_ID DefaultName
;
417 } FORMSET_DEFAULTSTORE
;
419 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
422 EFI_HII_HANDLE HiiHandle
;
423 EFI_HANDLE DriverHandle
;
424 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
425 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
427 UINTN IfrBinaryLength
;
428 UINT8
*IfrBinaryData
;
431 EFI_STRING_ID FormSetTitle
;
433 UINT8 NumberOfClassGuid
;
434 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
435 UINT16 Class
; // Tiano extended Class code
436 UINT16 SubClass
; // Tiano extended Subclass code
437 EFI_IMAGE_ID ImageId
;
439 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
440 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
442 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
443 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
444 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
445 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
446 } FORM_BROWSER_FORMSET
;
448 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
455 // Globals defined in Setup.c
457 BANNER_DATA
*BannerData
;
459 UINTN FunctionKeySetting
;
460 BOOLEAN ResetRequired
;
461 BOOLEAN NvUpdateRequired
;
463 EFI_SCREEN_DESCRIPTOR ScreenDimensions
;
464 CHAR16
*FunctionNineString
;
465 CHAR16
*FunctionTenString
;
467 CHAR16
*EnterCommitString
;
468 CHAR16
*EnterEscapeString
;
469 CHAR16
*EscapeString
;
471 CHAR16
*MoveHighlight
;
472 CHAR16
*MakeSelection
;
473 CHAR16
*DecNumericInput
;
474 CHAR16
*HexNumericInput
;
475 CHAR16
*ToggleCheckBox
;
476 CHAR16
*PromptForData
;
477 CHAR16
*PromptForPassword
;
478 CHAR16
*PromptForNewPassword
;
479 CHAR16
*ConfirmPassword
;
480 CHAR16
*ConfirmError
;
481 CHAR16
*PassowordInvalid
;
490 CHAR16
*AdjustNumber
;
492 CHAR16
*OptionMismatch
;
493 CHAR16 PromptBlockWidth
;
494 CHAR16 OptionBlockWidth
;
495 CHAR16 HelpBlockWidth
;
496 FORM_BROWSER_FORMSET
*OldFormSet
;
499 // Globals defined in Ui.c
501 LIST_ENTRY MenuOption
;
502 VOID
*MenuRefreshHead
;
505 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
507 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
508 extern EFI_HII_STRING_PROTOCOL
*mHiiString
;
509 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
511 extern BANNER_DATA
*gBannerData
;
512 extern EFI_HII_HANDLE gFrontPageHandle
;
513 extern UINTN gClassOfVfr
;
514 extern UINTN gFunctionKeySetting
;
515 extern BOOLEAN gResetRequired
;
516 extern BOOLEAN gNvUpdateRequired
;
517 extern EFI_HII_HANDLE gHiiHandle
;
518 extern UINT16 gDirection
;
519 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
521 extern FORM_BROWSER_FORMSET
*gOldFormSet
;
524 // Browser Global Strings
526 extern CHAR16
*gFunctionNineString
;
527 extern CHAR16
*gFunctionTenString
;
528 extern CHAR16
*gEnterString
;
529 extern CHAR16
*gEnterCommitString
;
530 extern CHAR16
*gEnterEscapeString
;
531 extern CHAR16
*gEscapeString
;
532 extern CHAR16
*gSaveFailed
;
533 extern CHAR16
*gMoveHighlight
;
534 extern CHAR16
*gMakeSelection
;
535 extern CHAR16
*gDecNumericInput
;
536 extern CHAR16
*gHexNumericInput
;
537 extern CHAR16
*gToggleCheckBox
;
538 extern CHAR16
*gPromptForData
;
539 extern CHAR16
*gPromptForPassword
;
540 extern CHAR16
*gPromptForNewPassword
;
541 extern CHAR16
*gConfirmPassword
;
542 extern CHAR16
*gConfirmError
;
543 extern CHAR16
*gPassowordInvalid
;
544 extern CHAR16
*gPressEnter
;
545 extern CHAR16
*gEmptyString
;
546 extern CHAR16
*gAreYouSure
;
547 extern CHAR16
*gYesResponse
;
548 extern CHAR16
*gNoResponse
;
549 extern CHAR16
*gMiniString
;
550 extern CHAR16
*gPlusString
;
551 extern CHAR16
*gMinusString
;
552 extern CHAR16
*gAdjustNumber
;
553 extern CHAR16
*gSaveChanges
;
554 extern CHAR16
*gOptionMismatch
;
555 extern CHAR16
*gFormSuppress
;
557 extern CHAR16 gPromptBlockWidth
;
558 extern CHAR16 gOptionBlockWidth
;
559 extern CHAR16 gHelpBlockWidth
;
561 extern EFI_GUID gZeroGuid
;
562 extern EFI_GUID gTianoHiiIfrGuid
;
566 // Global Procedure Defines
570 Initialize the HII String Token to the correct values.
574 InitializeBrowserStrings (
579 Prints a unicode string to the default console,
582 @param String String pointer.
584 @return Length of string printed to the console
593 Prints a chracter to the default console,
596 @param Character Character to print.
598 @return Length of string printed to the console.
607 Prints a formatted unicode string to the default console, at
608 the supplied cursor position.
610 @param Column The cursor position to print the string at.
611 @param Row The cursor position to print the string at
612 @param Fmt Format string
613 @param ... Variable argument list for formating string.
615 @return Length of string printed to the console
627 Prints a unicode string to the default console, at
628 the supplied cursor position, using L"%s" format.
630 @param Column The cursor position to print the string at.
631 @param Row The cursor position to print the string at
632 @param String String pointer.
634 @return Length of string printed to the console
645 Prints a chracter to the default console, at
646 the supplied cursor position, using L"%c" format.
648 @param Column The cursor position to print the string at.
649 @param Row The cursor position to print the string at.
650 @param Character Character to print.
652 @return Length of string printed to the console.
663 Parse opcodes in the formset IFR binary.
665 @param FormSet Pointer of the FormSet data structure.
667 @retval EFI_SUCCESS Opcode parse success.
668 @retval Other Opcode parse fail.
673 IN FORM_BROWSER_FORMSET
*FormSet
677 Free resources allocated for a FormSet.
679 @param FormSet Pointer of the FormSet
684 IN OUT FORM_BROWSER_FORMSET
*FormSet
688 This function displays the page frame.
697 Create a new string in HII Package List.
699 @param String The String to be added
700 @param HiiHandle The package list in the HII database to insert the
703 @return The output string.
709 IN EFI_HII_HANDLE HiiHandle
713 Delete a string from HII Package List.
715 @param StringId Id of the string in HII database.
716 @param HiiHandle The HII package list handle.
718 @retval EFI_SUCCESS The string was deleted successfully.
723 IN EFI_STRING_ID StringId
,
724 IN EFI_HII_HANDLE HiiHandle
728 Get the string based on the StringId and HII Package List Handle.
730 @param Token The String's ID.
731 @param HiiHandle The package list in the HII database to search for
732 the specified string.
734 @return The output string.
739 IN EFI_STRING_ID Token
,
740 IN EFI_HII_HANDLE HiiHandle
744 Draw a pop up windows based on the dimension, number of lines and
747 @param RequestedWidth The width of the pop-up.
748 @param NumberOfLines The number of lines.
749 @param Marker The variable argument list for the list of string to be printed.
754 IN UINTN RequestedWidth
,
755 IN UINTN NumberOfLines
,
760 Routine used to abstract a generic dialog interface and return the selected key or string
762 @param NumberOfLines The number of lines for the dialog box
763 @param HotKey Defines whether a single character is parsed
764 (TRUE) and returned in KeyValue or a string is
765 returned in StringBuffer. Two special characters
766 are considered when entering a string, a SCAN_ESC
767 and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates
768 string input and returns
769 @param MaximumStringSize The maximum size in bytes of a typed in string
770 (each character is a CHAR16) and the minimum
771 string returned is two bytes
772 @param StringBuffer The passed in pointer to the buffer which will
773 hold the typed in string if HotKey is FALSE
774 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
775 @param ... A series of (quantity == NumberOfLines) text
776 strings which will be used to construct the dialog
779 @retval EFI_SUCCESS Displayed dialog and received user interaction
780 @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.
781 (StringBuffer == NULL) && (HotKey == FALSE))
782 @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine
787 IN UINTN NumberOfLines
,
789 IN UINTN MaximumStringSize
,
790 OUT CHAR16
*StringBuffer
,
791 OUT EFI_INPUT_KEY
*KeyValue
,
796 Get Question's current Value.
798 @param FormSet FormSet data structure.
799 @param Form Form data structure.
800 @param Question Question to be initialized.
801 @param Cached TRUE: get from Edit copy FALSE: get from original
804 @retval EFI_SUCCESS The function completed successfully.
809 IN FORM_BROWSER_FORMSET
*FormSet
,
810 IN FORM_BROWSER_FORM
*Form
,
811 IN OUT FORM_BROWSER_STATEMENT
*Question
,
816 Save Question Value to edit copy(cached) or Storage(uncached).
818 @param FormSet FormSet data structure.
819 @param Form Form data structure.
820 @param Question Pointer to the Question.
821 @param Cached TRUE: set to Edit copy FALSE: set to original
824 @retval EFI_SUCCESS The function completed successfully.
829 IN FORM_BROWSER_FORMSET
*FormSet
,
830 IN FORM_BROWSER_FORM
*Form
,
831 IN OUT FORM_BROWSER_STATEMENT
*Question
,
836 Perform inconsistent check for a Form.
838 @param FormSet FormSet data structure.
839 @param Form Form data structure.
840 @param Question The Question to be validated.
841 @param Type Validation type: InConsistent or NoSubmit
843 @retval EFI_SUCCESS Form validation pass.
844 @retval other Form validation failed.
849 IN FORM_BROWSER_FORMSET
*FormSet
,
850 IN FORM_BROWSER_FORM
*Form
,
851 IN FORM_BROWSER_STATEMENT
*Question
,
858 @param FormSet FormSet data structure.
859 @param Form Form data structure.
861 @retval EFI_SUCCESS The function completed successfully.
866 IN FORM_BROWSER_FORMSET
*FormSet
,
867 IN FORM_BROWSER_FORM
*Form
871 Reset Question to its default value.
873 @param FormSet The form set.
874 @param Form The form.
875 @param Question The question.
876 @param DefaultId The Class of the default.
878 @retval EFI_SUCCESS Question is reset to default value.
883 IN FORM_BROWSER_FORMSET
*FormSet
,
884 IN FORM_BROWSER_FORM
*Form
,
885 IN FORM_BROWSER_STATEMENT
*Question
,
890 Get current setting of Questions.
892 @param FormSet FormSet data structure.
894 @retval EFI_SUCCESS The function completed successfully.
898 InitializeCurrentSetting (
899 IN OUT FORM_BROWSER_FORMSET
*FormSet
903 Initialize the internal data structure of a FormSet.
905 @param Handle PackageList Handle
906 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
907 GUID), take the first FormSet found in package
909 @param FormSet FormSet data structure.
911 @retval EFI_SUCCESS The function completed successfully.
912 @retval EFI_NOT_FOUND The specified FormSet could not be found.
917 IN EFI_HII_HANDLE Handle
,
918 IN OUT EFI_GUID
*FormSetGuid
,
919 OUT FORM_BROWSER_FORMSET
*FormSet
923 Reset Questions in a Form to their default value.
925 @param FormSet FormSet data structure.
926 @param Form The Form which to be reset.
927 @param DefaultId The Class of the default.
929 @retval EFI_SUCCESS The function completed successfully.
934 IN FORM_BROWSER_FORMSET
*FormSet
,
935 IN FORM_BROWSER_FORM
*Form
,
940 Initialize Question's Edit copy from Storage.
942 @param Selection Selection contains the information about
943 the Selection, form and formset to be displayed.
944 Selection action may be updated in retrieve callback.
945 @param FormSet FormSet data structure.
946 @param Form Form data structure.
948 @retval EFI_SUCCESS The function completed successfully.
953 IN OUT UI_MENU_SELECTION
*Selection
,
954 IN FORM_BROWSER_FORMSET
*FormSet
,
955 IN FORM_BROWSER_FORM
*Form
959 Initialize Question's Edit copy from Storage for the whole Formset.
961 @param Selection Selection contains the information about
962 the Selection, form and formset to be displayed.
963 Selection action may be updated in retrieve callback.
964 @param FormSet FormSet data structure.
966 @retval EFI_SUCCESS The function completed successfully.
971 IN OUT UI_MENU_SELECTION
*Selection
,
972 IN FORM_BROWSER_FORMSET
*FormSet
976 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
978 @param Storage The Storage to be conveted.
979 @param ConfigResp The returned <ConfigResp>.
981 @retval EFI_SUCCESS Convert success.
982 @retval EFI_INVALID_PARAMETER Incorrect storage type.
986 StorageToConfigResp (
987 IN FORMSET_STORAGE
*Storage
,
988 IN CHAR16
**ConfigResp
992 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
994 @param Storage The Storage to receive the settings.
995 @param ConfigResp The <ConfigResp> to be converted.
997 @retval EFI_SUCCESS Convert success.
998 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1002 ConfigRespToStorage (
1003 IN FORMSET_STORAGE
*Storage
,
1004 IN CHAR16
*ConfigResp
1008 Fill storage's edit copy with settings requested from Configuration Driver.
1010 @param FormSet FormSet data structure.
1011 @param Storage Buffer Storage.
1013 @retval EFI_SUCCESS The function completed successfully.
1018 IN FORM_BROWSER_FORMSET
*FormSet
,
1019 IN FORMSET_STORAGE
*Storage
1023 Fetch the Ifr binary data of a FormSet.
1025 @param Handle PackageList Handle
1026 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1027 GUID), take the first FormSet found in package
1029 @param BinaryLength The length of the FormSet IFR binary.
1030 @param BinaryData The buffer designed to receive the FormSet.
1032 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1033 BufferLength was updated.
1034 @retval EFI_INVALID_PARAMETER The handle is unknown.
1035 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1036 be found with the requested FormId.
1041 IN EFI_HII_HANDLE Handle
,
1042 IN OUT EFI_GUID
*FormSetGuid
,
1043 OUT UINTN
*BinaryLength
,
1044 OUT UINT8
**BinaryData
1048 Save globals used by previous call to SendForm(). SendForm() may be called from
1049 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1050 So, save globals of previous call to SendForm() and restore them upon exit.
1054 SaveBrowserContext (
1059 Restore globals used by previous call to SendForm().
1063 RestoreBrowserContext (
1068 This is the routine which an external caller uses to direct the browser
1069 where to obtain it's information.
1072 @param This The Form Browser protocol instanse.
1073 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1074 display a list of the formsets for the handles specified.
1075 @param HandleCount The number of Handles specified in Handle.
1076 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1077 field in the EFI_IFR_FORM_SET op-code for the specified
1078 forms-based package. If FormSetGuid is NULL, then this
1079 function will display the first found forms package.
1080 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1081 displayable page. If this field has a value of 0x0000, then
1082 the forms browser will render the specified forms in their encoded order.
1083 ScreenDimenions - This allows the browser to be called so that it occupies a
1084 portion of the physical screen instead of dynamically determining the screen dimensions.
1085 ActionRequest - Points to the action recommended by the form.
1086 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1088 @param ActionRequest Points to the action recommended by the form.
1090 @retval EFI_SUCCESS The function completed successfully.
1091 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1092 @retval EFI_NOT_FOUND No valid forms could be found to display.
1098 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1099 IN EFI_HII_HANDLE
*Handles
,
1100 IN UINTN HandleCount
,
1101 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1102 IN UINT16 FormId
, OPTIONAL
1103 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1104 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1108 This function is called by a callback handler to retrieve uncommitted state
1109 data from the browser.
1111 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1113 @param ResultsDataSize A pointer to the size of the buffer associated
1115 @param ResultsData A string returned from an IFR browser or
1116 equivalent. The results string will have no
1117 routing information in them.
1118 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1119 (if RetrieveData = TRUE) data from the uncommitted
1120 browser state information or set (if RetrieveData
1121 = FALSE) data in the uncommitted browser state
1123 @param VariableGuid An optional field to indicate the target variable
1125 @param VariableName An optional field to indicate the target
1126 human-readable variable name.
1128 @retval EFI_SUCCESS The results have been distributed or are awaiting
1130 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1131 contain the results data.
1137 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1138 IN OUT UINTN
*ResultsDataSize
,
1139 IN OUT EFI_STRING ResultsData
,
1140 IN BOOLEAN RetrieveData
,
1141 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1142 IN CONST CHAR16
*VariableName OPTIONAL