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 4
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
644 Prints a unicode string to the default console, at
645 the supplied cursor position, using L"%s" format.
647 @param Column The cursor position to print the string at.
648 @param Row The cursor position to print the string at
649 @param String String pointer.
651 @return Length of string printed to the console
662 Prints a chracter to the default console, at
663 the supplied cursor position, using L"%c" format.
665 @param Column The cursor position to print the string at.
666 @param Row The cursor position to print the string at.
667 @param Character Character to print.
669 @return Length of string printed to the console.
680 Parse opcodes in the formset IFR binary.
682 @param FormSet Pointer of the FormSet data structure.
684 @retval EFI_SUCCESS Opcode parse success.
685 @retval Other Opcode parse fail.
690 IN FORM_BROWSER_FORMSET
*FormSet
694 Free resources allocated for a FormSet.
696 @param FormSet Pointer of the FormSet
701 IN OUT FORM_BROWSER_FORMSET
*FormSet
705 This function displays the page frame.
714 Create a new string in HII Package List.
716 @param String The String to be added
717 @param HiiHandle The package list in the HII database to insert the
720 @return The output string.
726 IN EFI_HII_HANDLE HiiHandle
730 Delete a string from HII Package List.
732 @param StringId Id of the string in HII database.
733 @param HiiHandle The HII package list handle.
735 @retval EFI_SUCCESS The string was deleted successfully.
740 IN EFI_STRING_ID StringId
,
741 IN EFI_HII_HANDLE HiiHandle
745 Get the string based on the StringId and HII Package List Handle.
747 @param Token The String's ID.
748 @param HiiHandle The package list in the HII database to search for
749 the specified string.
751 @return The output string.
756 IN EFI_STRING_ID Token
,
757 IN EFI_HII_HANDLE HiiHandle
761 Draw a pop up windows based on the dimension, number of lines and
764 @param RequestedWidth The width of the pop-up.
765 @param NumberOfLines The number of lines.
766 @param Marker The variable argument list for the list of string to be printed.
771 IN UINTN RequestedWidth
,
772 IN UINTN NumberOfLines
,
777 Routine used to abstract a generic dialog interface and return the selected key or string
779 @param NumberOfLines The number of lines for the dialog box
780 @param HotKey Defines whether a single character is parsed
781 (TRUE) and returned in KeyValue or a string is
782 returned in StringBuffer. Two special characters
783 are considered when entering a string, a SCAN_ESC
784 and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates
785 string input and returns
786 @param MaximumStringSize The maximum size in bytes of a typed in string
787 (each character is a CHAR16) and the minimum
788 string returned is two bytes
789 @param StringBuffer The passed in pointer to the buffer which will
790 hold the typed in string if HotKey is FALSE
791 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
792 @param ... A series of (quantity == NumberOfLines) text
793 strings which will be used to construct the dialog
796 @retval EFI_SUCCESS Displayed dialog and received user interaction
797 @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.
798 (StringBuffer == NULL) && (HotKey == FALSE))
799 @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine
804 IN UINTN NumberOfLines
,
806 IN UINTN MaximumStringSize
,
807 OUT CHAR16
*StringBuffer
,
808 OUT EFI_INPUT_KEY
*KeyValue
,
813 Get Value for given Name from a NameValue Storage.
815 @param Storage The NameValue Storage.
816 @param Name The Name.
817 @param Value The retured Value.
819 @retval EFI_SUCCESS Value found for given Name.
820 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
825 IN FORMSET_STORAGE
*Storage
,
827 IN OUT CHAR16
**Value
831 Set Value of given Name in a NameValue Storage.
833 @param Storage The NameValue Storage.
834 @param Name The Name.
835 @param Value The Value to set.
837 @retval EFI_SUCCESS Value found for given Name.
838 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
843 IN FORMSET_STORAGE
*Storage
,
849 Get Question's current Value.
851 @param FormSet FormSet data structure.
852 @param Form Form data structure.
853 @param Question Question to be initialized.
854 @param Cached TRUE: get from Edit copy FALSE: get from original
857 @retval EFI_SUCCESS The function completed successfully.
862 IN FORM_BROWSER_FORMSET
*FormSet
,
863 IN FORM_BROWSER_FORM
*Form
,
864 IN OUT FORM_BROWSER_STATEMENT
*Question
,
869 Save Question Value to edit copy(cached) or Storage(uncached).
871 @param FormSet FormSet data structure.
872 @param Form Form data structure.
873 @param Question Pointer to the Question.
874 @param Cached TRUE: set to Edit copy FALSE: set to original
877 @retval EFI_SUCCESS The function completed successfully.
882 IN FORM_BROWSER_FORMSET
*FormSet
,
883 IN FORM_BROWSER_FORM
*Form
,
884 IN OUT FORM_BROWSER_STATEMENT
*Question
,
889 Perform inconsistent check for a Form.
891 @param FormSet FormSet data structure.
892 @param Form Form data structure.
893 @param Question The Question to be validated.
894 @param Type Validation type: InConsistent or NoSubmit
896 @retval EFI_SUCCESS Form validation pass.
897 @retval other Form validation failed.
902 IN FORM_BROWSER_FORMSET
*FormSet
,
903 IN FORM_BROWSER_FORM
*Form
,
904 IN FORM_BROWSER_STATEMENT
*Question
,
911 @param FormSet FormSet data structure.
912 @param Form Form data structure.
914 @retval EFI_SUCCESS The function completed successfully.
919 IN FORM_BROWSER_FORMSET
*FormSet
,
920 IN FORM_BROWSER_FORM
*Form
924 Reset Question to its default value.
926 @param FormSet The form set.
927 @param Form The form.
928 @param Question The question.
929 @param DefaultId The Class of the default.
931 @retval EFI_SUCCESS Question is reset to default value.
936 IN FORM_BROWSER_FORMSET
*FormSet
,
937 IN FORM_BROWSER_FORM
*Form
,
938 IN FORM_BROWSER_STATEMENT
*Question
,
943 Get current setting of Questions.
945 @param FormSet FormSet data structure.
947 @retval EFI_SUCCESS The function completed successfully.
951 InitializeCurrentSetting (
952 IN OUT FORM_BROWSER_FORMSET
*FormSet
956 Initialize the internal data structure of a FormSet.
958 @param Handle PackageList Handle
959 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
960 GUID), take the first FormSet found in package
962 @param FormSet FormSet data structure.
964 @retval EFI_SUCCESS The function completed successfully.
965 @retval EFI_NOT_FOUND The specified FormSet could not be found.
970 IN EFI_HII_HANDLE Handle
,
971 IN OUT EFI_GUID
*FormSetGuid
,
972 OUT FORM_BROWSER_FORMSET
*FormSet
976 Reset Questions in a Form to their default value.
978 @param FormSet FormSet data structure.
979 @param Form The Form which to be reset.
980 @param DefaultId The Class of the default.
982 @retval EFI_SUCCESS The function completed successfully.
987 IN FORM_BROWSER_FORMSET
*FormSet
,
988 IN FORM_BROWSER_FORM
*Form
,
993 Initialize Question's Edit copy from Storage.
995 @param Selection Selection contains the information about
996 the Selection, form and formset to be displayed.
997 Selection action may be updated in retrieve callback.
998 @param FormSet FormSet data structure.
999 @param Form Form data structure.
1001 @retval EFI_SUCCESS The function completed successfully.
1006 IN OUT UI_MENU_SELECTION
*Selection
,
1007 IN FORM_BROWSER_FORMSET
*FormSet
,
1008 IN FORM_BROWSER_FORM
*Form
1012 Initialize Question's Edit copy from Storage for the whole Formset.
1014 @param Selection Selection contains the information about
1015 the Selection, form and formset to be displayed.
1016 Selection action may be updated in retrieve callback.
1017 @param FormSet FormSet data structure.
1019 @retval EFI_SUCCESS The function completed successfully.
1024 IN OUT UI_MENU_SELECTION
*Selection
,
1025 IN FORM_BROWSER_FORMSET
*FormSet
1029 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
1031 @param Storage The Storage to be conveted.
1032 @param ConfigResp The returned <ConfigResp>.
1034 @retval EFI_SUCCESS Convert success.
1035 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1039 StorageToConfigResp (
1040 IN FORMSET_STORAGE
*Storage
,
1041 IN CHAR16
**ConfigResp
1045 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
1047 @param Storage The Storage to receive the settings.
1048 @param ConfigResp The <ConfigResp> to be converted.
1050 @retval EFI_SUCCESS Convert success.
1051 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1055 ConfigRespToStorage (
1056 IN FORMSET_STORAGE
*Storage
,
1057 IN CHAR16
*ConfigResp
1061 Fill storage's edit copy with settings requested from Configuration Driver.
1063 @param FormSet FormSet data structure.
1064 @param Storage Buffer Storage.
1066 @retval EFI_SUCCESS The function completed successfully.
1071 IN FORM_BROWSER_FORMSET
*FormSet
,
1072 IN FORMSET_STORAGE
*Storage
1076 Fetch the Ifr binary data of a FormSet.
1078 @param Handle PackageList Handle
1079 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1080 GUID), take the first FormSet found in package
1082 @param BinaryLength The length of the FormSet IFR binary.
1083 @param BinaryData The buffer designed to receive the FormSet.
1085 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1086 BufferLength was updated.
1087 @retval EFI_INVALID_PARAMETER The handle is unknown.
1088 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1089 be found with the requested FormId.
1094 IN EFI_HII_HANDLE Handle
,
1095 IN OUT EFI_GUID
*FormSetGuid
,
1096 OUT UINTN
*BinaryLength
,
1097 OUT UINT8
**BinaryData
1101 Save globals used by previous call to SendForm(). SendForm() may be called from
1102 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1103 So, save globals of previous call to SendForm() and restore them upon exit.
1107 SaveBrowserContext (
1112 Restore globals used by previous call to SendForm().
1116 RestoreBrowserContext (
1121 This is the routine which an external caller uses to direct the browser
1122 where to obtain it's information.
1125 @param This The Form Browser protocol instanse.
1126 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1127 display a list of the formsets for the handles specified.
1128 @param HandleCount The number of Handles specified in Handle.
1129 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1130 field in the EFI_IFR_FORM_SET op-code for the specified
1131 forms-based package. If FormSetGuid is NULL, then this
1132 function will display the first found forms package.
1133 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1134 displayable page. If this field has a value of 0x0000, then
1135 the forms browser will render the specified forms in their encoded order.
1136 ScreenDimenions - This allows the browser to be called so that it occupies a
1137 portion of the physical screen instead of dynamically determining the screen dimensions.
1138 ActionRequest - Points to the action recommended by the form.
1139 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1141 @param ActionRequest Points to the action recommended by the form.
1143 @retval EFI_SUCCESS The function completed successfully.
1144 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1145 @retval EFI_NOT_FOUND No valid forms could be found to display.
1151 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1152 IN EFI_HII_HANDLE
*Handles
,
1153 IN UINTN HandleCount
,
1154 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1155 IN UINT16 FormId
, OPTIONAL
1156 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1157 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1161 This function is called by a callback handler to retrieve uncommitted state
1162 data from the browser.
1164 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1166 @param ResultsDataSize A pointer to the size of the buffer associated
1168 @param ResultsData A string returned from an IFR browser or
1169 equivalent. The results string will have no
1170 routing information in them.
1171 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1172 (if RetrieveData = TRUE) data from the uncommitted
1173 browser state information or set (if RetrieveData
1174 = FALSE) data in the uncommitted browser state
1176 @param VariableGuid An optional field to indicate the target variable
1178 @param VariableName An optional field to indicate the target
1179 human-readable variable name.
1181 @retval EFI_SUCCESS The results have been distributed or are awaiting
1183 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1184 contain the results data.
1190 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1191 IN OUT UINTN
*ResultsDataSize
,
1192 IN OUT EFI_STRING ResultsData
,
1193 IN BOOLEAN RetrieveData
,
1194 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1195 IN CONST CHAR16
*VariableName OPTIONAL