2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007 - 2011, 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
62 #define BANNER_LEFT_COLUMN_INDENT 1
64 #define FRONT_PAGE_HEADER_HEIGHT 6
65 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
66 #define LEFT_SKIPPED_COLUMNS 3
67 #define FOOTER_HEIGHT 4
68 #define STATUS_BAR_HEIGHT 1
69 #define SCROLL_ARROW_HEIGHT 1
70 #define POPUP_PAD_SPACE_COUNT 5
71 #define POPUP_FRAME_WIDTH 2
74 // Definition for function key setting
76 #define NONE_FUNCTION_KEY_SETTING 0
77 #define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_NINE | FUNCTION_TEN)
79 #define FUNCTION_NINE (1 << 2)
80 #define FUNCTION_TEN (1 << 3)
85 } FUNCTIION_KEY_SETTING
;
88 // Character definitions
90 #define CHAR_SPACE 0x0020
91 #define UPPER_LOWER_CASE_OFFSET 0x20
96 #define ONE_SECOND 10000000
99 // Display definitions
101 #define LEFT_HYPER_DELIMITER L'<'
102 #define RIGHT_HYPER_DELIMITER L'>'
104 #define LEFT_ONEOF_DELIMITER L'<'
105 #define RIGHT_ONEOF_DELIMITER L'>'
107 #define LEFT_NUMERIC_DELIMITER L'['
108 #define RIGHT_NUMERIC_DELIMITER L']'
110 #define LEFT_CHECKBOX_DELIMITER L'['
111 #define RIGHT_CHECKBOX_DELIMITER L']'
113 #define CHECK_ON L'X'
114 #define CHECK_OFF L' '
116 #define TIME_SEPARATOR L':'
117 #define DATE_SEPARATOR L'/'
119 #define YES_ANSWER L'Y'
120 #define NO_ANSWER L'N'
123 // This is the Input Error Message
125 #define INPUT_ERROR 1
128 // This is the NV RAM update required Message
130 #define NV_UPDATE_REQUIRED 2
133 // Refresh the Status Bar with flags
135 #define REFRESH_STATUS_BAR 0xff
138 // Incremental string lenght of ConfigRequest
140 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
143 // HII value compare result
145 #define HII_VALUE_UNDEFINED 0
146 #define HII_VALUE_EQUAL 1
147 #define HII_VALUE_LESS_THAN 2
148 #define HII_VALUE_GREATER_THAN 3
151 // Incremental size of stack for expression
153 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
155 #define EFI_IFR_SPECIFICATION_VERSION (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))
158 #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')
167 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2
;
169 } SETUP_DRIVER_PRIVATE_DATA
;
172 EFI_STRING_ID Banner
[BANNER_HEIGHT
][BANNER_COLUMNS
];
176 // IFR relative definition
178 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
179 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
180 #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
181 #define EFI_HII_EXPRESSION_SUPPRESS_IF 3
182 #define EFI_HII_EXPRESSION_DISABLE_IF 4
183 #define EFI_HII_EXPRESSION_VALUE 5
184 #define EFI_HII_EXPRESSION_RULE 6
185 #define EFI_HII_EXPRESSION_READ 7
186 #define EFI_HII_EXPRESSION_WRITE 8
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 0x0001
196 #define FORMSET_CLASS_FRONT_PAGE 0x0002
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)
244 EFI_STRING_ID VarName
;
248 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
256 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
257 UINT8 Flags
; // For EFI_IFR_SPAN
258 UINT8 RuleId
; // For EFI_IFR_RULE_REF
260 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
262 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
263 EFI_QUESTION_ID QuestionId2
;
265 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
268 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
271 FORMSET_STORAGE
*VarStorage
; // For EFI_IFR_SET, EFI_IFR_GET
272 VAR_STORE_INFO VarStoreInfo
;// For EFI_IFR_SET, EFI_IFR_GET
273 UINT8 ValueType
; // For EFI_IFR_SET, EFI_IFR_GET
274 UINT8 ValueWidth
; // For EFI_IFR_SET, EFI_IFR_GET
275 CHAR16
*ValueName
; // For EFI_IFR_SET, EFI_IFR_GET
276 LIST_ENTRY MapExpressionList
; // nested expressions inside of Map opcode.
279 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
281 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
287 UINT8 Type
; // Type for this expression
289 UINT8 RuleId
; // For EFI_IFR_RULE only
290 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
292 EFI_HII_VALUE Result
; // Expression evaluation result
294 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
297 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
299 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
306 EFI_HII_VALUE Value
; // Default value
308 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
311 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
313 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
322 EFI_IMAGE_ID ImageId
;
324 FORM_EXPRESSION
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
327 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
329 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
335 UINT8 Operand
; // The operand (first byte) of this Statement or Question
340 EFI_STRING_ID Prompt
;
342 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
347 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
348 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
349 FORMSET_STORAGE
*Storage
;
350 VAR_STORE_INFO VarStoreInfo
;
353 CHAR16
*VariableName
; // Name/Value or EFI Variable name
354 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
356 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
357 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
358 UINT8 ValueType
; // Data type for orderedlist value array
361 // OpCode specific members
363 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
364 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
365 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
367 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
368 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
370 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
371 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
374 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
375 EFI_FORM_ID RefFormId
; // for EFI_IFR_REF
376 EFI_QUESTION_ID RefQuestionId
; // for EFI_IFR_REF2
377 EFI_GUID RefFormSetId
; // for EFI_IFR_REF3
378 EFI_STRING_ID RefDevicePath
; // for EFI_IFR_REF4
381 // Get from IFR parsing
383 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
384 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
385 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
387 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
388 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
389 BOOLEAN InSubtitle
; // nesting inside of EFI_IFR_SUBTITLE
391 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
392 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
393 FORM_EXPRESSION
*GrayOutExpression
; // nesting inside of GrayOutIf
394 FORM_EXPRESSION
*SuppressExpression
; // nesting inside of SuppressIf
395 FORM_EXPRESSION
*DisableExpression
; // nesting inside of DisableIf
397 FORM_EXPRESSION
*ReadExpression
; // nested EFI_IFR_READ, provide this question value by read expression.
398 FORM_EXPRESSION
*WriteExpression
; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
399 } FORM_BROWSER_STATEMENT
;
401 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
403 #define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')
408 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
409 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
412 FORMSET_STORAGE
*Storage
;
413 } FORM_BROWSER_CONFIG_REQUEST
;
414 #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
416 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
417 #define STANDARD_MAP_FORM_TYPE 0x01
423 UINT16 FormId
; // FormId of normal form or formmap form.
424 EFI_STRING_ID FormTitle
; // FormTile of normal form, or FormMapMethod title of formmap form.
425 UINT16 FormType
; // Specific form type for the different form.
427 EFI_IMAGE_ID ImageId
;
429 BOOLEAN ModalForm
; // Whether this is a modal form.
431 BOOLEAN NvUpdateRequired
; // Whether this form has NV update request.
433 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
434 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
435 LIST_ENTRY ConfigRequestHead
; // List of configreques for all storage.
436 FORM_EXPRESSION
*SuppressExpression
; // nesting inside of SuppressIf
439 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
441 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
448 EFI_STRING_ID DefaultName
;
449 } FORMSET_DEFAULTSTORE
;
451 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
454 EFI_HII_HANDLE HiiHandle
;
455 EFI_HANDLE DriverHandle
;
456 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
457 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
459 UINTN IfrBinaryLength
;
460 UINT8
*IfrBinaryData
;
463 EFI_STRING_ID FormSetTitle
;
465 UINT8 NumberOfClassGuid
;
466 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
467 UINT16 Class
; // Tiano extended Class code
468 UINT16 SubClass
; // Tiano extended Subclass code
469 EFI_IMAGE_ID ImageId
;
471 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
472 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
474 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
475 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
476 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
477 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
478 } FORM_BROWSER_FORMSET
;
480 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
487 // Globals defined in Setup.c
489 BANNER_DATA
*BannerData
;
491 UINTN FunctionKeySetting
;
492 BOOLEAN ResetRequired
;
494 EFI_SCREEN_DESCRIPTOR ScreenDimensions
;
495 CHAR16
*FunctionNineString
;
496 CHAR16
*FunctionTenString
;
498 CHAR16
*EnterCommitString
;
499 CHAR16
*EnterEscapeString
;
500 CHAR16
*EscapeString
;
502 CHAR16
*MoveHighlight
;
503 CHAR16
*MakeSelection
;
504 CHAR16
*DecNumericInput
;
505 CHAR16
*HexNumericInput
;
506 CHAR16
*ToggleCheckBox
;
507 CHAR16
*PromptForData
;
508 CHAR16
*PromptForPassword
;
509 CHAR16
*PromptForNewPassword
;
510 CHAR16
*ConfirmPassword
;
511 CHAR16
*ConfirmError
;
512 CHAR16
*PassowordInvalid
;
521 CHAR16
*AdjustNumber
;
523 CHAR16
*OptionMismatch
;
524 CHAR16
*FormSuppress
;
525 CHAR16 PromptBlockWidth
;
526 CHAR16 OptionBlockWidth
;
527 CHAR16 HelpBlockWidth
;
528 FORM_BROWSER_FORMSET
*OldFormSet
;
531 // Globals defined in Ui.c
533 LIST_ENTRY MenuOption
;
534 VOID
*MenuRefreshHead
;
537 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
539 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
540 extern EFI_HII_STRING_PROTOCOL
*mHiiString
;
541 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
543 extern BANNER_DATA
*gBannerData
;
544 extern EFI_HII_HANDLE gFrontPageHandle
;
545 extern UINTN gClassOfVfr
;
546 extern UINTN gFunctionKeySetting
;
547 extern BOOLEAN gResetRequired
;
548 extern EFI_HII_HANDLE gHiiHandle
;
549 extern UINT16 gDirection
;
550 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
552 extern FORM_BROWSER_FORMSET
*gOldFormSet
;
555 // Browser Global Strings
557 extern CHAR16
*gFunctionNineString
;
558 extern CHAR16
*gFunctionTenString
;
559 extern CHAR16
*gEnterString
;
560 extern CHAR16
*gEnterCommitString
;
561 extern CHAR16
*gEnterEscapeString
;
562 extern CHAR16
*gEscapeString
;
563 extern CHAR16
*gSaveFailed
;
564 extern CHAR16
*gMoveHighlight
;
565 extern CHAR16
*gMakeSelection
;
566 extern CHAR16
*gDecNumericInput
;
567 extern CHAR16
*gHexNumericInput
;
568 extern CHAR16
*gToggleCheckBox
;
569 extern CHAR16
*gPromptForData
;
570 extern CHAR16
*gPromptForPassword
;
571 extern CHAR16
*gPromptForNewPassword
;
572 extern CHAR16
*gConfirmPassword
;
573 extern CHAR16
*gConfirmError
;
574 extern CHAR16
*gPassowordInvalid
;
575 extern CHAR16
*gPressEnter
;
576 extern CHAR16
*gEmptyString
;
577 extern CHAR16
*gAreYouSure
;
578 extern CHAR16
*gYesResponse
;
579 extern CHAR16
*gNoResponse
;
580 extern CHAR16
*gMiniString
;
581 extern CHAR16
*gPlusString
;
582 extern CHAR16
*gMinusString
;
583 extern CHAR16
*gAdjustNumber
;
584 extern CHAR16
*gSaveChanges
;
585 extern CHAR16
*gOptionMismatch
;
586 extern CHAR16
*gFormSuppress
;
588 extern CHAR16 gPromptBlockWidth
;
589 extern CHAR16 gOptionBlockWidth
;
590 extern CHAR16 gHelpBlockWidth
;
592 extern EFI_GUID gZeroGuid
;
593 extern EFI_GUID gTianoHiiIfrGuid
;
597 // Global Procedure Defines
601 Initialize the HII String Token to the correct values.
605 InitializeBrowserStrings (
610 Prints a unicode string to the default console,
613 @param String String pointer.
615 @return Length of string printed to the console
624 Prints a chracter to the default console,
627 @param Character Character to print.
629 @return Length of string printed to the console.
638 Prints a formatted unicode string to the default console, at
639 the supplied cursor position.
641 @param Column The cursor position to print the string at.
642 @param Row The cursor position to print the string at
643 @param Fmt Format string
644 @param ... Variable argument list for formating string.
646 @return Length of string printed to the console
659 Prints a unicode string to the default console, at
660 the supplied cursor position, using L"%s" format.
662 @param Column The cursor position to print the string at.
663 @param Row The cursor position to print the string at
664 @param String String pointer.
666 @return Length of string printed to the console
677 Prints a chracter to the default console, at
678 the supplied cursor position, using L"%c" format.
680 @param Column The cursor position to print the string at.
681 @param Row The cursor position to print the string at.
682 @param Character Character to print.
684 @return Length of string printed to the console.
695 Parse opcodes in the formset IFR binary.
697 @param FormSet Pointer of the FormSet data structure.
699 @retval EFI_SUCCESS Opcode parse success.
700 @retval Other Opcode parse fail.
705 IN FORM_BROWSER_FORMSET
*FormSet
709 Free resources allocated for a FormSet.
711 @param FormSet Pointer of the FormSet
716 IN OUT FORM_BROWSER_FORMSET
*FormSet
720 This function displays the page frame.
722 @param Selection Selection contains the information about
723 the Selection, form and formset to be displayed.
724 Selection action may be updated in retrieve callback.
728 IN UI_MENU_SELECTION
*Selection
732 Create a new string in HII Package List.
734 @param String The String to be added
735 @param HiiHandle The package list in the HII database to insert the
738 @return The output string.
744 IN EFI_HII_HANDLE HiiHandle
748 Delete a string from HII Package List.
750 @param StringId Id of the string in HII database.
751 @param HiiHandle The HII package list handle.
753 @retval EFI_SUCCESS The string was deleted successfully.
758 IN EFI_STRING_ID StringId
,
759 IN EFI_HII_HANDLE HiiHandle
763 Get the string based on the StringId and HII Package List Handle.
765 @param Token The String's ID.
766 @param HiiHandle The package list in the HII database to search for
767 the specified string.
769 @return The output string.
774 IN EFI_STRING_ID Token
,
775 IN EFI_HII_HANDLE HiiHandle
779 Draw a pop up windows based on the dimension, number of lines and
782 @param RequestedWidth The width of the pop-up.
783 @param NumberOfLines The number of lines.
784 @param Marker The variable argument list for the list of string to be printed.
789 IN UINTN RequestedWidth
,
790 IN UINTN NumberOfLines
,
795 Routine used to abstract a generic dialog interface and return the selected key or string
797 @param NumberOfLines The number of lines for the dialog box
798 @param HotKey Defines whether a single character is parsed
799 (TRUE) and returned in KeyValue or a string is
800 returned in StringBuffer. Two special characters
801 are considered when entering a string, a SCAN_ESC
802 and an CHAR_CARRIAGE_RETURN. SCAN_ESC terminates
803 string input and returns
804 @param MaximumStringSize The maximum size in bytes of a typed in string
805 (each character is a CHAR16) and the minimum
806 string returned is two bytes
807 @param StringBuffer The passed in pointer to the buffer which will
808 hold the typed in string if HotKey is FALSE
809 @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
810 @param ... A series of (quantity == NumberOfLines) text
811 strings which will be used to construct the dialog
814 @retval EFI_SUCCESS Displayed dialog and received user interaction
815 @retval EFI_INVALID_PARAMETER One of the parameters was invalid (e.g.
816 (StringBuffer == NULL) && (HotKey == FALSE))
817 @retval EFI_DEVICE_ERROR User typed in an ESC character to exit the routine
823 IN UINTN NumberOfLines
,
825 IN UINTN MaximumStringSize
,
826 OUT CHAR16
*StringBuffer
,
827 OUT EFI_INPUT_KEY
*KeyValue
,
832 Get Value for given Name from a NameValue Storage.
834 @param Storage The NameValue Storage.
835 @param Name The Name.
836 @param Value The retured Value.
838 @retval EFI_SUCCESS Value found for given Name.
839 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
844 IN FORMSET_STORAGE
*Storage
,
846 IN OUT CHAR16
**Value
850 Set Value of given Name in a NameValue Storage.
852 @param Storage The NameValue Storage.
853 @param Name The Name.
854 @param Value The Value to set.
855 @param Edit Whether update editValue or Value.
857 @retval EFI_SUCCESS Value found for given Name.
858 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
863 IN FORMSET_STORAGE
*Storage
,
870 Get Question's current Value.
872 @param FormSet FormSet data structure.
873 @param Form Form data structure.
874 @param Question Question to be initialized.
875 @param Cached TRUE: get from Edit copy FALSE: get from original
878 @retval EFI_SUCCESS The function completed successfully.
883 IN FORM_BROWSER_FORMSET
*FormSet
,
884 IN FORM_BROWSER_FORM
*Form
,
885 IN OUT FORM_BROWSER_STATEMENT
*Question
,
890 Save Question Value to edit copy(cached) or Storage(uncached).
892 @param FormSet FormSet data structure.
893 @param Form Form data structure.
894 @param Question Pointer to the Question.
895 @param Cached TRUE: set to Edit copy FALSE: set to original
898 @retval EFI_SUCCESS The function completed successfully.
903 IN FORM_BROWSER_FORMSET
*FormSet
,
904 IN FORM_BROWSER_FORM
*Form
,
905 IN OUT FORM_BROWSER_STATEMENT
*Question
,
910 Perform inconsistent check for a Form.
912 @param FormSet FormSet data structure.
913 @param Form Form data structure.
914 @param Question The Question to be validated.
915 @param Type Validation type: InConsistent or NoSubmit
917 @retval EFI_SUCCESS Form validation pass.
918 @retval other Form validation failed.
923 IN FORM_BROWSER_FORMSET
*FormSet
,
924 IN FORM_BROWSER_FORM
*Form
,
925 IN FORM_BROWSER_STATEMENT
*Question
,
930 Discard data for form level or formset level.
932 @param FormSet FormSet data structure.
933 @param Form Form data structure.
934 @param SingleForm whether submit single form or formset.
936 @retval EFI_SUCCESS The function completed successfully.
941 IN FORM_BROWSER_FORMSET
*FormSet
,
942 IN FORM_BROWSER_FORM
*Form
,
943 IN BOOLEAN SingleForm
947 Submit data for form level or formset level.
949 @param FormSet FormSet data structure.
950 @param Form Form data structure.
951 @param SingleForm whether submit single form or formset.
953 @retval EFI_SUCCESS The function completed successfully.
958 IN FORM_BROWSER_FORMSET
*FormSet
,
959 IN FORM_BROWSER_FORM
*Form
,
960 IN BOOLEAN SingleForm
964 Reset Question to its default value.
966 @param FormSet The form set.
967 @param Form The form.
968 @param Question The question.
969 @param DefaultId The Class of the default.
971 @retval EFI_SUCCESS Question is reset to default value.
976 IN FORM_BROWSER_FORMSET
*FormSet
,
977 IN FORM_BROWSER_FORM
*Form
,
978 IN FORM_BROWSER_STATEMENT
*Question
,
983 Get current setting of Questions.
985 @param FormSet FormSet data structure.
987 @retval EFI_SUCCESS The function completed successfully.
991 InitializeCurrentSetting (
992 IN OUT FORM_BROWSER_FORMSET
*FormSet
996 Initialize the internal data structure of a FormSet.
998 @param Handle PackageList Handle
999 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1000 GUID), take the first FormSet found in package
1002 @param FormSet FormSet data structure.
1004 @retval EFI_SUCCESS The function completed successfully.
1005 @retval EFI_NOT_FOUND The specified FormSet could not be found.
1010 IN EFI_HII_HANDLE Handle
,
1011 IN OUT EFI_GUID
*FormSetGuid
,
1012 OUT FORM_BROWSER_FORMSET
*FormSet
1016 Reset Questions in a Form to their default value.
1018 @param FormSet FormSet data structure.
1019 @param Form The Form which to be reset.
1020 @param DefaultId The Class of the default.
1022 @retval EFI_SUCCESS The function completed successfully.
1026 ExtractFormDefault (
1027 IN FORM_BROWSER_FORMSET
*FormSet
,
1028 IN FORM_BROWSER_FORM
*Form
,
1033 Initialize Question's Edit copy from Storage.
1035 @param Selection Selection contains the information about
1036 the Selection, form and formset to be displayed.
1037 Selection action may be updated in retrieve callback.
1038 @param FormSet FormSet data structure.
1039 @param Form Form data structure.
1041 @retval EFI_SUCCESS The function completed successfully.
1046 IN OUT UI_MENU_SELECTION
*Selection
,
1047 IN FORM_BROWSER_FORMSET
*FormSet
,
1048 IN FORM_BROWSER_FORM
*Form
1052 Initialize Question's Edit copy from Storage for the whole Formset.
1054 @param Selection Selection contains the information about
1055 the Selection, form and formset to be displayed.
1056 Selection action may be updated in retrieve callback.
1057 @param FormSet FormSet data structure.
1059 @retval EFI_SUCCESS The function completed successfully.
1064 IN OUT UI_MENU_SELECTION
*Selection
,
1065 IN FORM_BROWSER_FORMSET
*FormSet
1069 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
1071 @param Buffer The Storage to be conveted.
1072 @param ConfigResp The returned <ConfigResp>.
1073 @param SingleForm Whether update data for single form or formset level.
1075 @retval EFI_SUCCESS Convert success.
1076 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1080 StorageToConfigResp (
1082 IN CHAR16
**ConfigResp
,
1083 IN BOOLEAN SingleForm
1087 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
1089 @param Storage The Storage to receive the settings.
1090 @param ConfigResp The <ConfigResp> to be converted.
1092 @retval EFI_SUCCESS Convert success.
1093 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1097 ConfigRespToStorage (
1098 IN FORMSET_STORAGE
*Storage
,
1099 IN CHAR16
*ConfigResp
1103 Fill storage's edit copy with settings requested from Configuration Driver.
1105 @param FormSet FormSet data structure.
1106 @param Storage Buffer Storage.
1108 @retval EFI_SUCCESS The function completed successfully.
1113 IN FORM_BROWSER_FORMSET
*FormSet
,
1114 IN FORMSET_STORAGE
*Storage
1118 Fetch the Ifr binary data of a FormSet.
1120 @param Handle PackageList Handle
1121 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1122 GUID), take the first FormSet found in package
1124 @param BinaryLength The length of the FormSet IFR binary.
1125 @param BinaryData The buffer designed to receive the FormSet.
1127 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1128 BufferLength was updated.
1129 @retval EFI_INVALID_PARAMETER The handle is unknown.
1130 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1131 be found with the requested FormId.
1136 IN EFI_HII_HANDLE Handle
,
1137 IN OUT EFI_GUID
*FormSetGuid
,
1138 OUT UINTN
*BinaryLength
,
1139 OUT UINT8
**BinaryData
1143 Save globals used by previous call to SendForm(). SendForm() may be called from
1144 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1145 So, save globals of previous call to SendForm() and restore them upon exit.
1149 SaveBrowserContext (
1154 Restore globals used by previous call to SendForm().
1158 RestoreBrowserContext (
1163 This is the routine which an external caller uses to direct the browser
1164 where to obtain it's information.
1167 @param This The Form Browser protocol instanse.
1168 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1169 display a list of the formsets for the handles specified.
1170 @param HandleCount The number of Handles specified in Handle.
1171 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1172 field in the EFI_IFR_FORM_SET op-code for the specified
1173 forms-based package. If FormSetGuid is NULL, then this
1174 function will display the first found forms package.
1175 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1176 displayable page. If this field has a value of 0x0000, then
1177 the forms browser will render the specified forms in their encoded order.
1178 ScreenDimenions - This allows the browser to be called so that it occupies a
1179 portion of the physical screen instead of dynamically determining the screen dimensions.
1180 ActionRequest - Points to the action recommended by the form.
1181 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1183 @param ActionRequest Points to the action recommended by the form.
1185 @retval EFI_SUCCESS The function completed successfully.
1186 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1187 @retval EFI_NOT_FOUND No valid forms could be found to display.
1193 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1194 IN EFI_HII_HANDLE
*Handles
,
1195 IN UINTN HandleCount
,
1196 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1197 IN UINT16 FormId
, OPTIONAL
1198 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1199 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1203 This function is called by a callback handler to retrieve uncommitted state
1204 data from the browser.
1206 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1208 @param ResultsDataSize A pointer to the size of the buffer associated
1210 @param ResultsData A string returned from an IFR browser or
1211 equivalent. The results string will have no
1212 routing information in them.
1213 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1214 (if RetrieveData = TRUE) data from the uncommitted
1215 browser state information or set (if RetrieveData
1216 = FALSE) data in the uncommitted browser state
1218 @param VariableGuid An optional field to indicate the target variable
1220 @param VariableName An optional field to indicate the target
1221 human-readable variable name.
1223 @retval EFI_SUCCESS The results have been distributed or are awaiting
1225 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1226 contain the results data.
1232 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1233 IN OUT UINTN
*ResultsDataSize
,
1234 IN OUT EFI_STRING ResultsData
,
1235 IN BOOLEAN RetrieveData
,
1236 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1237 IN CONST CHAR16
*VariableName OPTIONAL
1241 Find menu which will show next time.
1243 @param Selection On input, Selection tell setup browser the information
1244 about the Selection, form and formset to be displayed.
1245 On output, Selection return the screen item that is selected
1247 @param Repaint Whether need to repaint the menu.
1248 @param NewLine Whether need to show at new line.
1250 @retval TRUE Need return.
1251 @retval FALSE No need to return.
1255 IN OUT UI_MENU_SELECTION
*Selection
,
1256 IN BOOLEAN
*Repaint
,
1261 check whether the formset need to update the NV.
1263 @param FormSet FormSet data structure.
1264 @param SetValue Whether set new value or clear old value.
1268 UpdateNvInfoInForm (
1269 IN FORM_BROWSER_FORMSET
*FormSet
,
1274 check whether the formset need to update the NV.
1276 @param FormSet FormSet data structure.
1278 @retval TRUE Need to update the NV.
1279 @retval FALSE No need to update the NV.
1282 IsNvUpdateRequired (
1283 IN FORM_BROWSER_FORMSET
*FormSet
1287 Call the call back function for the question and process the return action.
1289 @param Selection On input, Selection tell setup browser the information
1290 about the Selection, form and formset to be displayed.
1291 On output, Selection return the screen item that is selected
1293 @param Statement The Question which need to call.
1294 @param Action The action request.
1295 @param SkipSaveOrDiscard Whether skip save or discard action.
1297 @retval EFI_SUCCESS The call back function excutes successfully.
1298 @return Other value if the call back function failed to excute.
1301 ProcessCallBackFunction (
1302 IN OUT UI_MENU_SELECTION
*Selection
,
1303 IN FORM_BROWSER_STATEMENT
*Question
,
1304 IN EFI_BROWSER_ACTION Action
,
1305 IN BOOLEAN SkipSaveOrDiscard