2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
5 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>
31 #include <Protocol/UserManager.h>
33 #include <Guid/MdeModuleHii.h>
34 #include <Guid/HiiPlatformSetupFormset.h>
35 #include <Guid/HiiFormMapMethodGuid.h>
37 #include <Library/PrintLib.h>
38 #include <Library/DebugLib.h>
39 #include <Library/BaseMemoryLib.h>
40 #include <Library/UefiRuntimeServicesTableLib.h>
41 #include <Library/UefiDriverEntryPoint.h>
42 #include <Library/UefiBootServicesTableLib.h>
43 #include <Library/BaseLib.h>
44 #include <Library/MemoryAllocationLib.h>
45 #include <Library/HiiLib.h>
46 #include <Library/PcdLib.h>
47 #include <Library/DevicePathLib.h>
52 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
55 extern UINT8 SetupBrowserStrings
[];
60 #define BANNER_HEIGHT 6
61 #define BANNER_COLUMNS 3
63 #define FRONT_PAGE_HEADER_HEIGHT 6
64 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
65 #define LEFT_SKIPPED_COLUMNS 1
66 #define FOOTER_HEIGHT 4
67 #define STATUS_BAR_HEIGHT 1
68 #define SCROLL_ARROW_HEIGHT 1
69 #define POPUP_PAD_SPACE_COUNT 5
70 #define POPUP_FRAME_WIDTH 2
73 // Definition for function key setting
75 #define NONE_FUNCTION_KEY_SETTING 0
76 #define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_NINE | FUNCTION_TEN)
78 #define FUNCTION_NINE (1 << 2)
79 #define FUNCTION_TEN (1 << 3)
84 } FUNCTIION_KEY_SETTING
;
87 // Character definitions
89 #define CHAR_SPACE 0x0020
90 #define UPPER_LOWER_CASE_OFFSET 0x20
95 #define ONE_SECOND 10000000
98 // Display definitions
100 #define LEFT_HYPER_DELIMITER L'<'
101 #define RIGHT_HYPER_DELIMITER L'>'
103 #define LEFT_ONEOF_DELIMITER L'<'
104 #define RIGHT_ONEOF_DELIMITER L'>'
106 #define LEFT_NUMERIC_DELIMITER L'['
107 #define RIGHT_NUMERIC_DELIMITER L']'
109 #define LEFT_CHECKBOX_DELIMITER L'['
110 #define RIGHT_CHECKBOX_DELIMITER L']'
112 #define CHECK_ON L'X'
113 #define CHECK_OFF L' '
115 #define TIME_SEPARATOR L':'
116 #define DATE_SEPARATOR L'/'
118 #define YES_ANSWER L'Y'
119 #define NO_ANSWER L'N'
122 // This is the Input Error Message
124 #define INPUT_ERROR 1
127 // This is the NV RAM update required Message
129 #define NV_UPDATE_REQUIRED 2
132 // Refresh the Status Bar with flags
134 #define REFRESH_STATUS_BAR 0xff
137 // Incremental string lenght of ConfigRequest
139 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
142 // HII value compare result
144 #define HII_VALUE_UNDEFINED 0
145 #define HII_VALUE_EQUAL 1
146 #define HII_VALUE_LESS_THAN 2
147 #define HII_VALUE_GREATER_THAN 3
150 // Incremental size of stack for expression
152 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
154 #define EFI_SPECIFICATION_MAJOR_VERSION 0x2
155 #define EFI_SPECIFICATION_MINOR_VERSION 0x1
156 #define EFI_SPECIFICATION_ERRATA_VERSION 0x0
157 #define EFI_IFR_SPECIFICATION_VERSION (UINT16)((EFI_SPECIFICATION_MAJOR_VERSION << 8) | (EFI_SPECIFICATION_MINOR_VERSION << 4) | EFI_SPECIFICATION_ERRATA_VERSION)
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
187 #define EFI_HII_EXPRESSION_READ 7
188 #define EFI_HII_EXPRESSION_WRITE 8
190 #define EFI_HII_VARSTORE_BUFFER 0
191 #define EFI_HII_VARSTORE_NAME_VALUE 1
192 #define EFI_HII_VARSTORE_EFI_VARIABLE 2
194 #define FORM_INCONSISTENT_VALIDATION 0
195 #define FORM_NO_SUBMIT_VALIDATION 1
197 #define FORMSET_CLASS_PLATFORM_SETUP 0x0001
198 #define FORMSET_CLASS_FRONT_PAGE 0x0002
202 EFI_IFR_TYPE_VALUE Value
;
205 #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')
215 #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)
217 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
223 UINT8 Type
; // Storage type
228 CHAR16
*Name
; // For EFI_IFR_VARSTORE
231 UINT8
*EditBuffer
; // Edit copy for Buffer Storage
233 LIST_ENTRY NameValueListHead
; // List of NAME_VALUE_NODE
235 UINT32 Attributes
; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute
237 CHAR16
*ConfigHdr
; // <ConfigHdr>
238 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
239 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
240 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
243 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
246 EFI_STRING_ID VarName
;
250 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
258 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
259 UINT8 Flags
; // For EFI_IFR_SPAN
260 UINT8 RuleId
; // For EFI_IFR_RULE_REF
262 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
264 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
265 EFI_QUESTION_ID QuestionId2
;
267 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
270 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
273 FORMSET_STORAGE
*VarStorage
; // For EFI_IFR_SET, EFI_IFR_GET
274 VAR_STORE_INFO VarStoreInfo
;// For EFI_IFR_SET, EFI_IFR_GET
275 UINT8 ValueType
; // For EFI_IFR_SET, EFI_IFR_GET
276 UINT8 ValueWidth
; // For EFI_IFR_SET, EFI_IFR_GET
277 CHAR16
*ValueName
; // For EFI_IFR_SET, EFI_IFR_GET
278 LIST_ENTRY MapExpressionList
; // nested expressions inside of Map opcode.
281 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
283 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
289 UINT8 Type
; // Type for this expression
291 UINT8 RuleId
; // For EFI_IFR_RULE only
292 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
294 EFI_HII_VALUE Result
; // Expression evaluation result
296 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
299 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
301 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
308 EFI_HII_VALUE Value
; // Default value
310 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
313 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
315 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
324 EFI_IMAGE_ID ImageId
;
326 FORM_EXPRESSION
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
329 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
331 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
337 UINT8 Operand
; // The operand (first byte) of this Statement or Question
342 EFI_STRING_ID Prompt
;
344 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
349 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
350 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
351 FORMSET_STORAGE
*Storage
;
352 VAR_STORE_INFO VarStoreInfo
;
355 CHAR16
*VariableName
; // Name/Value or EFI Variable name
356 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
358 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
359 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
360 UINT8 ValueType
; // Data type for orderedlist value array
363 // OpCode specific members
365 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
366 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
367 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
369 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
370 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
372 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
373 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
376 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
377 EFI_FORM_ID RefFormId
; // for EFI_IFR_REF
378 EFI_QUESTION_ID RefQuestionId
; // for EFI_IFR_REF2
379 EFI_GUID RefFormSetId
; // for EFI_IFR_REF3
380 EFI_STRING_ID RefDevicePath
; // for EFI_IFR_REF4
383 // Get from IFR parsing
385 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
386 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
387 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
389 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
390 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
391 BOOLEAN InSubtitle
; // nesting inside of EFI_IFR_SUBTITLE
393 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
394 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
395 FORM_EXPRESSION
*GrayOutExpression
; // nesting inside of GrayOutIf
396 FORM_EXPRESSION
*SuppressExpression
; // nesting inside of SuppressIf
397 FORM_EXPRESSION
*DisableExpression
; // nesting inside of DisableIf
399 FORM_EXPRESSION
*ReadExpression
; // nested EFI_IFR_READ, provide this question value by read expression.
400 FORM_EXPRESSION
*WriteExpression
; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
401 } FORM_BROWSER_STATEMENT
;
403 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
405 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
406 #define STANDARD_MAP_FORM_TYPE 0x01
412 UINT16 FormId
; // FormId of normal form or formmap form.
413 EFI_STRING_ID FormTitle
; // FormTile of normal form, or FormMapMethod title of formmap form.
414 UINT16 FormType
; // Specific form type for the different form.
416 EFI_IMAGE_ID ImageId
;
418 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
419 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
420 FORM_EXPRESSION
*SuppressExpression
; // nesting inside of SuppressIf
423 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
425 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
432 EFI_STRING_ID DefaultName
;
433 } FORMSET_DEFAULTSTORE
;
435 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
438 EFI_HII_HANDLE HiiHandle
;
439 EFI_HANDLE DriverHandle
;
440 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
441 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
443 UINTN IfrBinaryLength
;
444 UINT8
*IfrBinaryData
;
447 EFI_STRING_ID FormSetTitle
;
449 UINT8 NumberOfClassGuid
;
450 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
451 UINT16 Class
; // Tiano extended Class code
452 UINT16 SubClass
; // Tiano extended Subclass code
453 EFI_IMAGE_ID ImageId
;
455 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
456 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
458 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
459 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
460 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
461 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
462 } FORM_BROWSER_FORMSET
;
464 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
471 // Globals defined in Setup.c
473 BANNER_DATA
*BannerData
;
475 UINTN FunctionKeySetting
;
476 BOOLEAN ResetRequired
;
477 BOOLEAN NvUpdateRequired
;
479 EFI_SCREEN_DESCRIPTOR ScreenDimensions
;
480 CHAR16
*FunctionNineString
;
481 CHAR16
*FunctionTenString
;
483 CHAR16
*EnterCommitString
;
484 CHAR16
*EnterEscapeString
;
485 CHAR16
*EscapeString
;
487 CHAR16
*MoveHighlight
;
488 CHAR16
*MakeSelection
;
489 CHAR16
*DecNumericInput
;
490 CHAR16
*HexNumericInput
;
491 CHAR16
*ToggleCheckBox
;
492 CHAR16
*PromptForData
;
493 CHAR16
*PromptForPassword
;
494 CHAR16
*PromptForNewPassword
;
495 CHAR16
*ConfirmPassword
;
496 CHAR16
*ConfirmError
;
497 CHAR16
*PassowordInvalid
;
506 CHAR16
*AdjustNumber
;
508 CHAR16
*OptionMismatch
;
509 CHAR16
*FormSuppress
;
510 CHAR16 PromptBlockWidth
;
511 CHAR16 OptionBlockWidth
;
512 CHAR16 HelpBlockWidth
;
513 FORM_BROWSER_FORMSET
*OldFormSet
;
516 // Globals defined in Ui.c
518 LIST_ENTRY MenuOption
;
519 VOID
*MenuRefreshHead
;
522 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
524 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
525 extern EFI_HII_STRING_PROTOCOL
*mHiiString
;
526 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
528 extern BANNER_DATA
*gBannerData
;
529 extern EFI_HII_HANDLE gFrontPageHandle
;
530 extern UINTN gClassOfVfr
;
531 extern UINTN gFunctionKeySetting
;
532 extern BOOLEAN gResetRequired
;
533 extern BOOLEAN gNvUpdateRequired
;
534 extern EFI_HII_HANDLE gHiiHandle
;
535 extern UINT16 gDirection
;
536 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
538 extern FORM_BROWSER_FORMSET
*gOldFormSet
;
541 // Browser Global Strings
543 extern CHAR16
*gFunctionNineString
;
544 extern CHAR16
*gFunctionTenString
;
545 extern CHAR16
*gEnterString
;
546 extern CHAR16
*gEnterCommitString
;
547 extern CHAR16
*gEnterEscapeString
;
548 extern CHAR16
*gEscapeString
;
549 extern CHAR16
*gSaveFailed
;
550 extern CHAR16
*gMoveHighlight
;
551 extern CHAR16
*gMakeSelection
;
552 extern CHAR16
*gDecNumericInput
;
553 extern CHAR16
*gHexNumericInput
;
554 extern CHAR16
*gToggleCheckBox
;
555 extern CHAR16
*gPromptForData
;
556 extern CHAR16
*gPromptForPassword
;
557 extern CHAR16
*gPromptForNewPassword
;
558 extern CHAR16
*gConfirmPassword
;
559 extern CHAR16
*gConfirmError
;
560 extern CHAR16
*gPassowordInvalid
;
561 extern CHAR16
*gPressEnter
;
562 extern CHAR16
*gEmptyString
;
563 extern CHAR16
*gAreYouSure
;
564 extern CHAR16
*gYesResponse
;
565 extern CHAR16
*gNoResponse
;
566 extern CHAR16
*gMiniString
;
567 extern CHAR16
*gPlusString
;
568 extern CHAR16
*gMinusString
;
569 extern CHAR16
*gAdjustNumber
;
570 extern CHAR16
*gSaveChanges
;
571 extern CHAR16
*gOptionMismatch
;
572 extern CHAR16
*gFormSuppress
;
574 extern CHAR16 gPromptBlockWidth
;
575 extern CHAR16 gOptionBlockWidth
;
576 extern CHAR16 gHelpBlockWidth
;
578 extern EFI_GUID gZeroGuid
;
579 extern EFI_GUID gTianoHiiIfrGuid
;
583 // Global Procedure Defines
587 Initialize the HII String Token to the correct values.
591 InitializeBrowserStrings (
596 Prints a unicode string to the default console,
599 @param String String pointer.
601 @return Length of string printed to the console
610 Prints a chracter to the default console,
613 @param Character Character to print.
615 @return Length of string printed to the console.
624 Prints a formatted unicode string to the default console, at
625 the supplied cursor position.
627 @param Column The cursor position to print the string at.
628 @param Row The cursor position to print the string at
629 @param Fmt Format string
630 @param ... Variable argument list for formating string.
632 @return Length of string printed to the console
645 Prints a unicode string to the default console, at
646 the supplied cursor position, using L"%s" 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 String String pointer.
652 @return Length of string printed to the console
663 Prints a chracter to the default console, at
664 the supplied cursor position, using L"%c" format.
666 @param Column The cursor position to print the string at.
667 @param Row The cursor position to print the string at.
668 @param Character Character to print.
670 @return Length of string printed to the console.
681 Parse opcodes in the formset IFR binary.
683 @param FormSet Pointer of the FormSet data structure.
685 @retval EFI_SUCCESS Opcode parse success.
686 @retval Other Opcode parse fail.
691 IN FORM_BROWSER_FORMSET
*FormSet
695 Free resources allocated for a FormSet.
697 @param FormSet Pointer of the FormSet
702 IN OUT FORM_BROWSER_FORMSET
*FormSet
706 This function displays the page frame.
715 Create a new string in HII Package List.
717 @param String The String to be added
718 @param HiiHandle The package list in the HII database to insert the
721 @return The output string.
727 IN EFI_HII_HANDLE HiiHandle
731 Delete a string from HII Package List.
733 @param StringId Id of the string in HII database.
734 @param HiiHandle The HII package list handle.
736 @retval EFI_SUCCESS The string was deleted successfully.
741 IN EFI_STRING_ID StringId
,
742 IN EFI_HII_HANDLE HiiHandle
746 Get the string based on the StringId and HII Package List Handle.
748 @param Token The String's ID.
749 @param HiiHandle The package list in the HII database to search for
750 the specified string.
752 @return The output string.
757 IN EFI_STRING_ID Token
,
758 IN EFI_HII_HANDLE HiiHandle
762 Draw a pop up windows based on the dimension, number of lines and
765 @param RequestedWidth The width of the pop-up.
766 @param NumberOfLines The number of lines.
767 @param Marker The variable argument list for the list of string to be printed.
772 IN UINTN RequestedWidth
,
773 IN UINTN NumberOfLines
,
778 Routine used to abstract a generic dialog interface and return the selected key or string
780 @param NumberOfLines The number of lines for the dialog box
781 @param HotKey Defines whether a single character is parsed
782 (TRUE) and returned in KeyValue or a string is
783 returned in StringBuffer. Two special characters
784 are considered when entering a string, a SCAN_ESC
785 and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates
786 string input and returns
787 @param MaximumStringSize The maximum size in bytes of a typed in string
788 (each character is a CHAR16) and the minimum
789 string returned is two bytes
790 @param StringBuffer The passed in pointer to the buffer which will
791 hold the typed in string if HotKey is FALSE
792 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
793 @param ... A series of (quantity == NumberOfLines) text
794 strings which will be used to construct the dialog
797 @retval EFI_SUCCESS Displayed dialog and received user interaction
798 @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.
799 (StringBuffer == NULL) && (HotKey == FALSE))
800 @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine
806 IN UINTN NumberOfLines
,
808 IN UINTN MaximumStringSize
,
809 OUT CHAR16
*StringBuffer
,
810 OUT EFI_INPUT_KEY
*KeyValue
,
815 Get Value for given Name from a NameValue Storage.
817 @param Storage The NameValue Storage.
818 @param Name The Name.
819 @param Value The retured Value.
821 @retval EFI_SUCCESS Value found for given Name.
822 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
827 IN FORMSET_STORAGE
*Storage
,
829 IN OUT CHAR16
**Value
833 Set Value of given Name in a NameValue Storage.
835 @param Storage The NameValue Storage.
836 @param Name The Name.
837 @param Value The Value to set.
839 @retval EFI_SUCCESS Value found for given Name.
840 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
845 IN FORMSET_STORAGE
*Storage
,
851 Get Question's current Value.
853 @param FormSet FormSet data structure.
854 @param Form Form data structure.
855 @param Question Question to be initialized.
856 @param Cached TRUE: get from Edit copy FALSE: get from original
859 @retval EFI_SUCCESS The function completed successfully.
864 IN FORM_BROWSER_FORMSET
*FormSet
,
865 IN FORM_BROWSER_FORM
*Form
,
866 IN OUT FORM_BROWSER_STATEMENT
*Question
,
871 Save Question Value to edit copy(cached) or Storage(uncached).
873 @param FormSet FormSet data structure.
874 @param Form Form data structure.
875 @param Question Pointer to the Question.
876 @param Cached TRUE: set to Edit copy FALSE: set to original
879 @retval EFI_SUCCESS The function completed successfully.
884 IN FORM_BROWSER_FORMSET
*FormSet
,
885 IN FORM_BROWSER_FORM
*Form
,
886 IN OUT FORM_BROWSER_STATEMENT
*Question
,
891 Perform inconsistent check for a Form.
893 @param FormSet FormSet data structure.
894 @param Form Form data structure.
895 @param Question The Question to be validated.
896 @param Type Validation type: InConsistent or NoSubmit
898 @retval EFI_SUCCESS Form validation pass.
899 @retval other Form validation failed.
904 IN FORM_BROWSER_FORMSET
*FormSet
,
905 IN FORM_BROWSER_FORM
*Form
,
906 IN FORM_BROWSER_STATEMENT
*Question
,
913 @param FormSet FormSet data structure.
914 @param Form Form data structure.
916 @retval EFI_SUCCESS The function completed successfully.
921 IN FORM_BROWSER_FORMSET
*FormSet
,
922 IN FORM_BROWSER_FORM
*Form
926 Reset Question to its default value.
928 @param FormSet The form set.
929 @param Form The form.
930 @param Question The question.
931 @param DefaultId The Class of the default.
933 @retval EFI_SUCCESS Question is reset to default value.
938 IN FORM_BROWSER_FORMSET
*FormSet
,
939 IN FORM_BROWSER_FORM
*Form
,
940 IN FORM_BROWSER_STATEMENT
*Question
,
945 Get current setting of Questions.
947 @param FormSet FormSet data structure.
949 @retval EFI_SUCCESS The function completed successfully.
953 InitializeCurrentSetting (
954 IN OUT FORM_BROWSER_FORMSET
*FormSet
958 Initialize the internal data structure of a FormSet.
960 @param Handle PackageList Handle
961 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
962 GUID), take the first FormSet found in package
964 @param FormSet FormSet data structure.
966 @retval EFI_SUCCESS The function completed successfully.
967 @retval EFI_NOT_FOUND The specified FormSet could not be found.
972 IN EFI_HII_HANDLE Handle
,
973 IN OUT EFI_GUID
*FormSetGuid
,
974 OUT FORM_BROWSER_FORMSET
*FormSet
978 Reset Questions in a Form to their default value.
980 @param FormSet FormSet data structure.
981 @param Form The Form which to be reset.
982 @param DefaultId The Class of the default.
984 @retval EFI_SUCCESS The function completed successfully.
989 IN FORM_BROWSER_FORMSET
*FormSet
,
990 IN FORM_BROWSER_FORM
*Form
,
995 Initialize Question's Edit copy from Storage.
997 @param Selection Selection contains the information about
998 the Selection, form and formset to be displayed.
999 Selection action may be updated in retrieve callback.
1000 @param FormSet FormSet data structure.
1001 @param Form Form data structure.
1003 @retval EFI_SUCCESS The function completed successfully.
1008 IN OUT UI_MENU_SELECTION
*Selection
,
1009 IN FORM_BROWSER_FORMSET
*FormSet
,
1010 IN FORM_BROWSER_FORM
*Form
1014 Initialize Question's Edit copy from Storage for the whole Formset.
1016 @param Selection Selection contains the information about
1017 the Selection, form and formset to be displayed.
1018 Selection action may be updated in retrieve callback.
1019 @param FormSet FormSet data structure.
1021 @retval EFI_SUCCESS The function completed successfully.
1026 IN OUT UI_MENU_SELECTION
*Selection
,
1027 IN FORM_BROWSER_FORMSET
*FormSet
1031 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
1033 @param Storage The Storage to be conveted.
1034 @param ConfigResp The returned <ConfigResp>.
1036 @retval EFI_SUCCESS Convert success.
1037 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1041 StorageToConfigResp (
1042 IN FORMSET_STORAGE
*Storage
,
1043 IN CHAR16
**ConfigResp
1047 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
1049 @param Storage The Storage to receive the settings.
1050 @param ConfigResp The <ConfigResp> to be converted.
1052 @retval EFI_SUCCESS Convert success.
1053 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1057 ConfigRespToStorage (
1058 IN FORMSET_STORAGE
*Storage
,
1059 IN CHAR16
*ConfigResp
1063 Fill storage's edit copy with settings requested from Configuration Driver.
1065 @param FormSet FormSet data structure.
1066 @param Storage Buffer Storage.
1068 @retval EFI_SUCCESS The function completed successfully.
1073 IN FORM_BROWSER_FORMSET
*FormSet
,
1074 IN FORMSET_STORAGE
*Storage
1078 Fetch the Ifr binary data of a FormSet.
1080 @param Handle PackageList Handle
1081 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1082 GUID), take the first FormSet found in package
1084 @param BinaryLength The length of the FormSet IFR binary.
1085 @param BinaryData The buffer designed to receive the FormSet.
1087 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1088 BufferLength was updated.
1089 @retval EFI_INVALID_PARAMETER The handle is unknown.
1090 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1091 be found with the requested FormId.
1096 IN EFI_HII_HANDLE Handle
,
1097 IN OUT EFI_GUID
*FormSetGuid
,
1098 OUT UINTN
*BinaryLength
,
1099 OUT UINT8
**BinaryData
1103 Save globals used by previous call to SendForm(). SendForm() may be called from
1104 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1105 So, save globals of previous call to SendForm() and restore them upon exit.
1109 SaveBrowserContext (
1114 Restore globals used by previous call to SendForm().
1118 RestoreBrowserContext (
1123 This is the routine which an external caller uses to direct the browser
1124 where to obtain it's information.
1127 @param This The Form Browser protocol instanse.
1128 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1129 display a list of the formsets for the handles specified.
1130 @param HandleCount The number of Handles specified in Handle.
1131 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1132 field in the EFI_IFR_FORM_SET op-code for the specified
1133 forms-based package. If FormSetGuid is NULL, then this
1134 function will display the first found forms package.
1135 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1136 displayable page. If this field has a value of 0x0000, then
1137 the forms browser will render the specified forms in their encoded order.
1138 ScreenDimenions - This allows the browser to be called so that it occupies a
1139 portion of the physical screen instead of dynamically determining the screen dimensions.
1140 ActionRequest - Points to the action recommended by the form.
1141 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1143 @param ActionRequest Points to the action recommended by the form.
1145 @retval EFI_SUCCESS The function completed successfully.
1146 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1147 @retval EFI_NOT_FOUND No valid forms could be found to display.
1153 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1154 IN EFI_HII_HANDLE
*Handles
,
1155 IN UINTN HandleCount
,
1156 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1157 IN UINT16 FormId
, OPTIONAL
1158 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1159 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1163 This function is called by a callback handler to retrieve uncommitted state
1164 data from the browser.
1166 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1168 @param ResultsDataSize A pointer to the size of the buffer associated
1170 @param ResultsData A string returned from an IFR browser or
1171 equivalent. The results string will have no
1172 routing information in them.
1173 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1174 (if RetrieveData = TRUE) data from the uncommitted
1175 browser state information or set (if RetrieveData
1176 = FALSE) data in the uncommitted browser state
1178 @param VariableGuid An optional field to indicate the target variable
1180 @param VariableName An optional field to indicate the target
1181 human-readable variable name.
1183 @retval EFI_SUCCESS The results have been distributed or are awaiting
1185 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1186 contain the results data.
1192 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1193 IN OUT UINTN
*ResultsDataSize
,
1194 IN OUT EFI_STRING ResultsData
,
1195 IN BOOLEAN RetrieveData
,
1196 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1197 IN CONST CHAR16
*VariableName OPTIONAL