X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FSetupBrowserDxe%2FSetup.h;h=8e32cb4e4a992bc47b7bfb54852298979e4af2f1;hb=80a047f04a9005c37580532307d8c7c4b337fe4b;hp=11714d6be7306f6388ad8404b70ebbe457e3c523;hpb=40245175993beffd410783a5a2f84d8e264dbb30;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h index 11714d6be7..8e32cb4e4a 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h @@ -1,8 +1,8 @@ /** @file Private MACRO, structure and function definitions for Setup Browser module. -Copyright (c) 2007 - 2009, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -22,6 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include @@ -29,9 +30,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include +#include #include #include @@ -58,10 +61,11 @@ extern UINT8 SetupBrowserStrings[]; // #define BANNER_HEIGHT 6 #define BANNER_COLUMNS 3 +#define BANNER_LEFT_COLUMN_INDENT 1 #define FRONT_PAGE_HEADER_HEIGHT 6 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3 -#define LEFT_SKIPPED_COLUMNS 4 +#define LEFT_SKIPPED_COLUMNS 3 #define FOOTER_HEIGHT 4 #define STATUS_BAR_HEIGHT 1 #define SCROLL_ARROW_HEIGHT 1 @@ -72,10 +76,7 @@ extern UINT8 SetupBrowserStrings[]; // Definition for function key setting // #define NONE_FUNCTION_KEY_SETTING 0 -#define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_NINE | FUNCTION_TEN) - -#define FUNCTION_NINE (1 << 2) -#define FUNCTION_TEN (1 << 3) +#define ENABLE_FUNCTION_KEY_SETTING 1 typedef struct { EFI_GUID FormSetGuid; @@ -150,13 +151,8 @@ typedef struct { // #define EXPRESSION_STACK_SIZE_INCREMENT 0x100 +#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)) -#define EFI_SPECIFICATION_ERRATA_VERSION 0 - -#define EFI_IFR_SPECIFICATION_VERSION \ - ((((EFI_SPECIFICATION_VERSION) >> 8) & 0xff00) | \ - (((EFI_SPECIFICATION_VERSION) & 0xf) << 4) | \ - ((EFI_SPECIFICATION_ERRATA_VERSION) & 0xf)) #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V') typedef struct { @@ -167,7 +163,9 @@ typedef struct { // // Produced protocol // - EFI_FORM_BROWSER2_PROTOCOL FormBrowser2; + EFI_FORM_BROWSER2_PROTOCOL FormBrowser2; + + EFI_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx; } SETUP_DRIVER_PRIVATE_DATA; @@ -185,10 +183,13 @@ typedef struct { #define EFI_HII_EXPRESSION_DISABLE_IF 4 #define EFI_HII_EXPRESSION_VALUE 5 #define EFI_HII_EXPRESSION_RULE 6 +#define EFI_HII_EXPRESSION_READ 7 +#define EFI_HII_EXPRESSION_WRITE 8 #define EFI_HII_VARSTORE_BUFFER 0 #define EFI_HII_VARSTORE_NAME_VALUE 1 #define EFI_HII_VARSTORE_EFI_VARIABLE 2 +#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 #define FORM_INCONSISTENT_VALIDATION 0 #define FORM_NO_SUBMIT_VALIDATION 1 @@ -198,6 +199,8 @@ typedef struct { typedef struct { UINT8 Type; + UINT8 *Buffer; + UINT16 BufferLen; EFI_IFR_TYPE_VALUE Value; } EFI_HII_VALUE; @@ -241,6 +244,11 @@ typedef struct { #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE) +typedef union { + EFI_STRING_ID VarName; + UINT16 VarOffset; +} VAR_STORE_INFO; + #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P') typedef struct { @@ -263,6 +271,13 @@ typedef struct { EFI_STRING_ID DevicePath; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3 EFI_GUID Guid; + + FORMSET_STORAGE *VarStorage; // For EFI_IFR_SET, EFI_IFR_GET + VAR_STORE_INFO VarStoreInfo;// For EFI_IFR_SET, EFI_IFR_GET + UINT8 ValueType; // For EFI_IFR_SET, EFI_IFR_GET + UINT8 ValueWidth; // For EFI_IFR_SET, EFI_IFR_GET + CHAR16 *ValueName; // For EFI_IFR_SET, EFI_IFR_GET + LIST_ENTRY MapExpressionList; // nested expressions inside of Map opcode. } EXPRESSION_OPCODE; #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE) @@ -285,6 +300,14 @@ typedef struct { #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE) +#define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R') + +typedef struct { + UINTN Signature; + UINTN Count; + FORM_EXPRESSION *Expression[1]; // Array[Count] of expressions +} FORM_EXPRESSION_LIST; + #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T') typedef struct { @@ -302,20 +325,35 @@ typedef struct { #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T') typedef struct { - UINTN Signature; - LIST_ENTRY Link; + UINTN Signature; + LIST_ENTRY Link; - EFI_STRING_ID Text; - UINT8 Flags; - EFI_HII_VALUE Value; - EFI_IMAGE_ID ImageId; + EFI_STRING_ID Text; + UINT8 Flags; + EFI_HII_VALUE Value; + EFI_IMAGE_ID ImageId; - FORM_EXPRESSION *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf + FORM_EXPRESSION_LIST *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf } QUESTION_OPTION; #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE) +typedef enum { + ExpressFalse = 0, + ExpressGrayOut, + ExpressSuppress, + ExpressDisable +} EXPRESS_RESULT; + +typedef enum { + ExpressNone = 0, + ExpressForm, + ExpressStatement, + ExpressOption +} EXPRESS_LEVEL; + #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A') + typedef struct { UINTN Signature; LIST_ENTRY Link; @@ -335,10 +373,7 @@ typedef struct { EFI_QUESTION_ID QuestionId; // The value of zero is reserved EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage FORMSET_STORAGE *Storage; - union { - EFI_STRING_ID VarName; - UINT16 VarOffset; - } VarStoreInfo; + VAR_STORE_INFO VarStoreInfo; UINT16 StorageWidth; UINT8 QuestionFlags; CHAR16 *VariableName; // Name/Value or EFI Variable name @@ -363,11 +398,8 @@ typedef struct { UINT64 Step; EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON - EFI_FORM_ID RefFormId; // for EFI_IFR_REF - EFI_QUESTION_ID RefQuestionId; // for EFI_IFR_REF2 - EFI_GUID RefFormSetId; // for EFI_IFR_REF3 - EFI_STRING_ID RefDevicePath; // for EFI_IFR_REF4 - + EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID + BOOLEAN Locked; // Whether this statement is locked. // // Get from IFR parsing // @@ -381,28 +413,49 @@ typedef struct { LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION) LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION) - FORM_EXPRESSION *GrayOutExpression; // nesting inside of GrayOutIf - FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf - FORM_EXPRESSION *DisableExpression; // nesting inside of DisableIf + FORM_EXPRESSION_LIST *Expression; // nesting inside of GrayOutIf/DisableIf/SuppressIf + FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression. + FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set. } FORM_BROWSER_STATEMENT; #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE) +#define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S') +typedef struct { + UINTN Signature; + LIST_ENTRY Link; + + CHAR16 *ConfigRequest; // = + + UINTN ElementCount; // Number of in the + UINTN SpareStrLen; + + FORMSET_STORAGE *Storage; +} FORM_BROWSER_CONFIG_REQUEST; +#define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE) + #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M') +#define STANDARD_MAP_FORM_TYPE 0x01 typedef struct { - UINTN Signature; - LIST_ENTRY Link; + UINTN Signature; + LIST_ENTRY Link; + + UINT16 FormId; // FormId of normal form or formmap form. + EFI_STRING_ID FormTitle; // FormTile of normal form, or FormMapMethod title of formmap form. + UINT16 FormType; // Specific form type for the different form. - UINT16 FormId; - EFI_STRING_ID FormTitle; + EFI_IMAGE_ID ImageId; - EFI_IMAGE_ID ImageId; + BOOLEAN ModalForm; // Whether this is a modal form. + BOOLEAN Locked; // Whether this form is locked. - LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION) - LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT) - FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf + BOOLEAN NvUpdateRequired; // Whether this form has NV update request. + + LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION) + LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT) + LIST_ENTRY ConfigRequestHead; // List of configreques for all storage. + FORM_EXPRESSION_LIST *SuppressExpression; // nesting inside of SuppressIf } FORM_BROWSER_FORM; #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE) @@ -419,8 +472,12 @@ typedef struct { #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE) +#define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S') + typedef struct { - EFI_HII_HANDLE HiiHandle; + UINTN Signature; + LIST_ENTRY Link; + EFI_HII_HANDLE HiiHandle; // unique id for formset. EFI_HANDLE DriverHandle; EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess; EFI_DEVICE_PATH_PROTOCOL *DevicePath; @@ -446,6 +503,8 @@ typedef struct { LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION) } FORM_BROWSER_FORMSET; +#define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE) + #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X') typedef struct { @@ -459,16 +518,12 @@ typedef struct { UINTN ClassOfVfr; UINTN FunctionKeySetting; BOOLEAN ResetRequired; - BOOLEAN NvUpdateRequired; UINT16 Direction; EFI_SCREEN_DESCRIPTOR ScreenDimensions; - CHAR16 *FunctionNineString; - CHAR16 *FunctionTenString; CHAR16 *EnterString; CHAR16 *EnterCommitString; CHAR16 *EnterEscapeString; CHAR16 *EscapeString; - CHAR16 *SaveFailed; CHAR16 *MoveHighlight; CHAR16 *MakeSelection; CHAR16 *DecNumericInput; @@ -492,6 +547,7 @@ typedef struct { CHAR16 *SaveChanges; CHAR16 *OptionMismatch; CHAR16 *FormSuppress; + CHAR16 *ProtocolNotFound; CHAR16 PromptBlockWidth; CHAR16 OptionBlockWidth; CHAR16 HelpBlockWidth; @@ -506,27 +562,66 @@ typedef struct { #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE) +#define BROWSER_HOT_KEY_SIGNATURE SIGNATURE_32 ('B', 'H', 'K', 'S') + +typedef struct { + UINTN Signature; + LIST_ENTRY Link; + + EFI_INPUT_KEY *KeyData; + IN UINT32 Action; + IN UINT16 DefaultId; + IN EFI_STRING HelpString; +} BROWSER_HOT_KEY; + +#define BROWSER_HOT_KEY_FROM_LINK(a) CR (a, BROWSER_HOT_KEY, Link, BROWSER_HOT_KEY_SIGNATURE) + +// +// Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll. +// +typedef enum { + GetDefaultForNoStorage, // Get default value for question which not has storage. + GetDefaultForStorage, // Get default value for question which has storage. + GetDefaultForAll, // Get default value for all questions. + GetDefaultForMax // Invalid value. +} BROWSER_GET_DEFAULT_VALUE; + +// +// Get/set question value from/to. +// +typedef enum { + GetSetValueWithEditBuffer, // Get/Set question value from/to editbuffer in the storage. + GetSetValueWithBuffer, // Get/Set question value from/to buffer in the storage. + GetSetValueWithHiiDriver, // Get/Set question value from/to hii driver. + GetSetValueWithMax // Invalid value. +} GET_SET_QUESTION_VALUE_WITH; + extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase; extern EFI_HII_STRING_PROTOCOL *mHiiString; extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting; +extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText; extern BANNER_DATA *gBannerData; extern EFI_HII_HANDLE gFrontPageHandle; extern UINTN gClassOfVfr; extern UINTN gFunctionKeySetting; extern BOOLEAN gResetRequired; -extern BOOLEAN gNvUpdateRequired; extern EFI_HII_HANDLE gHiiHandle; extern UINT16 gDirection; extern EFI_SCREEN_DESCRIPTOR gScreenDimensions; extern FORM_BROWSER_FORMSET *gOldFormSet; +extern LIST_ENTRY gBrowserFormSetList; +extern LIST_ENTRY gBrowserHotKeyList; +extern BROWSER_SETTING_SCOPE gBrowserSettingScope; +extern EXIT_HANDLER ExitHandlerFunction; +extern UINTN gFooterHeight; // // Browser Global Strings // -extern CHAR16 *gFunctionNineString; -extern CHAR16 *gFunctionTenString; +extern CHAR16 *gDiscardFailed; +extern CHAR16 *gDefaultFailed; extern CHAR16 *gEnterString; extern CHAR16 *gEnterCommitString; extern CHAR16 *gEnterEscapeString; @@ -555,6 +650,7 @@ extern CHAR16 *gAdjustNumber; extern CHAR16 *gSaveChanges; extern CHAR16 *gOptionMismatch; extern CHAR16 *gFormSuppress; +extern CHAR16 *gProtocolNotFound; extern CHAR16 gPromptBlockWidth; extern CHAR16 gOptionBlockWidth; @@ -618,6 +714,7 @@ PrintChar ( **/ UINTN +EFIAPI PrintAt ( IN UINTN Column, IN UINTN Row, @@ -689,10 +786,13 @@ DestroyFormSet ( /** This function displays the page frame. + @param Selection Selection contains the information about + the Selection, form and formset to be displayed. + Selection action may be updated in retrieve callback. **/ VOID DisplayPageFrame ( - VOID + IN UI_MENU_SELECTION *Selection ); /** @@ -785,6 +885,7 @@ CreateSharedPopUp ( **/ EFI_STATUS +EFIAPI CreateDialog ( IN UINTN NumberOfLines, IN BOOLEAN HotKey, @@ -794,14 +895,53 @@ CreateDialog ( ... ); +/** + Get Value for given Name from a NameValue Storage. + + @param Storage The NameValue Storage. + @param Name The Name. + @param Value The retured Value. + @param GetValueFrom Where to get source value, from EditValue or Value. + + @retval EFI_SUCCESS Value found for given Name. + @retval EFI_NOT_FOUND No such Name found in NameValue storage. + +**/ +EFI_STATUS +GetValueByName ( + IN FORMSET_STORAGE *Storage, + IN CHAR16 *Name, + IN OUT CHAR16 **Value, + IN GET_SET_QUESTION_VALUE_WITH GetValueFrom + ); + +/** + Set Value of given Name in a NameValue Storage. + + @param Storage The NameValue Storage. + @param Name The Name. + @param Value The Value to set. + @param SetValueTo Whether update editValue or Value. + + @retval EFI_SUCCESS Value found for given Name. + @retval EFI_NOT_FOUND No such Name found in NameValue storage. + +**/ +EFI_STATUS +SetValueByName ( + IN FORMSET_STORAGE *Storage, + IN CHAR16 *Name, + IN CHAR16 *Value, + IN GET_SET_QUESTION_VALUE_WITH SetValueTo + ); + /** Get Question's current Value. @param FormSet FormSet data structure. @param Form Form data structure. @param Question Question to be initialized. - @param Cached TRUE: get from Edit copy FALSE: get from original - Storage + @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver. @retval EFI_SUCCESS The function completed successfully. @@ -811,7 +951,7 @@ GetQuestionValue ( IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, - IN BOOLEAN Cached + IN GET_SET_QUESTION_VALUE_WITH GetValueFrom ); /** @@ -820,8 +960,7 @@ GetQuestionValue ( @param FormSet FormSet data structure. @param Form Form data structure. @param Question Pointer to the Question. - @param Cached TRUE: set to Edit copy FALSE: set to original - Storage + @param SetValueTo Update the question value to editbuffer , buffer or hii driver. @retval EFI_SUCCESS The function completed successfully. @@ -831,7 +970,7 @@ SetQuestionValue ( IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_BROWSER_STATEMENT *Question, - IN BOOLEAN Cached + IN GET_SET_QUESTION_VALUE_WITH SetValueTo ); /** @@ -854,19 +993,41 @@ ValidateQuestion ( IN UINTN Type ); + /** - Submit a Form. + Discard data based on the input setting scope (Form, FormSet or System). @param FormSet FormSet data structure. @param Form Form data structure. + @param SettingScope Setting Scope for Discard action. @retval EFI_SUCCESS The function completed successfully. + @retval EFI_UNSUPPORTED Unsupport SettingScope. + +**/ +EFI_STATUS +DiscardForm ( + IN FORM_BROWSER_FORMSET *FormSet, + IN FORM_BROWSER_FORM *Form, + IN BROWSER_SETTING_SCOPE SettingScope + ); + +/** + Submit data based on the input Setting level (Form, FormSet or System). + + @param FormSet FormSet data structure. + @param Form Form data structure. + @param SettingScope Setting Scope for Submit action. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_UNSUPPORTED Unsupport SettingScope. **/ EFI_STATUS SubmitForm ( IN FORM_BROWSER_FORMSET *FormSet, - IN FORM_BROWSER_FORM *Form + IN FORM_BROWSER_FORM *Form, + IN BROWSER_SETTING_SCOPE SettingScope ); /** @@ -909,6 +1070,7 @@ InitializeCurrentSetting ( GUID), take the first FormSet found in package list. @param FormSet FormSet data structure. + @param UpdateGlobalVar Whether need to update the global variable. @retval EFI_SUCCESS The function completed successfully. @retval EFI_NOT_FOUND The specified FormSet could not be found. @@ -918,24 +1080,39 @@ EFI_STATUS InitializeFormSet ( IN EFI_HII_HANDLE Handle, IN OUT EFI_GUID *FormSetGuid, - OUT FORM_BROWSER_FORMSET *FormSet + OUT FORM_BROWSER_FORMSET *FormSet, + IN BOOLEAN UpdateGlobalVar ); /** - Reset Questions in a Form to their default value. + Reset Questions to their initial value or default value in a Form, Formset or System. + + GetDefaultValueScope parameter decides which questions will reset + to its default value. @param FormSet FormSet data structure. - @param Form The Form which to be reset. + @param Form Form data structure. @param DefaultId The Class of the default. + @param SettingScope Setting Scope for Default action. + @param GetDefaultValueScope Get default value scope. + @param Storage Get default value only for this storage. + @param RetrieveValueFirst Whether call the retrieve call back to + get the initial value before get default + value. @retval EFI_SUCCESS The function completed successfully. + @retval EFI_UNSUPPORTED Unsupport SettingScope. **/ EFI_STATUS -ExtractFormDefault ( +ExtractDefault ( IN FORM_BROWSER_FORMSET *FormSet, - IN FORM_BROWSER_FORM *Form, - IN UINT16 DefaultId + IN FORM_BROWSER_FORM *Form, + IN UINT16 DefaultId, + IN BROWSER_SETTING_SCOPE SettingScope, + IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope, + IN FORMSET_STORAGE *Storage, + IN BOOLEAN RetrieveValueFirst ); /** @@ -944,6 +1121,7 @@ ExtractFormDefault ( @param Selection Selection contains the information about the Selection, form and formset to be displayed. Selection action may be updated in retrieve callback. + If Selection is NULL, only initialize Question value. @param FormSet FormSet data structure. @param Form Form data structure. @@ -963,6 +1141,7 @@ LoadFormConfig ( @param Selection Selection contains the information about the Selection, form and formset to be displayed. Selection action may be updated in retrieve callback. + If Selection is NULL, only initialize Question value. @param FormSet FormSet data structure. @retval EFI_SUCCESS The function completed successfully. @@ -977,8 +1156,9 @@ LoadFormSetConfig ( /** Convert setting of Buffer Storage or NameValue Storage to . - @param Storage The Storage to be conveted. + @param Buffer The Storage to be conveted. @param ConfigResp The returned . + @param SingleForm Whether update data for single form or formset level. @retval EFI_SUCCESS Convert success. @retval EFI_INVALID_PARAMETER Incorrect storage type. @@ -986,8 +1166,9 @@ LoadFormSetConfig ( **/ EFI_STATUS StorageToConfigResp ( - IN FORMSET_STORAGE *Storage, - IN CHAR16 **ConfigResp + IN VOID *Buffer, + IN CHAR16 **ConfigResp, + IN BOOLEAN SingleForm ); /** @@ -1144,4 +1325,206 @@ BrowserCallback ( IN CONST CHAR16 *VariableName OPTIONAL ); +/** + Find menu which will show next time. + + @param Selection On input, Selection tell setup browser the information + about the Selection, form and formset to be displayed. + On output, Selection return the screen item that is selected + by user. + @param Repaint Whether need to repaint the menu. + @param NewLine Whether need to show at new line. + + @retval TRUE Need return. + @retval FALSE No need to return. +**/ +BOOLEAN +FindNextMenu ( + IN OUT UI_MENU_SELECTION *Selection, + IN BOOLEAN *Repaint, + IN BOOLEAN *NewLine + ); + +/** + check whether the formset need to update the NV. + + @param FormSet FormSet data structure. + @param SetValue Whether set new value or clear old value. + +**/ +VOID +UpdateNvInfoInForm ( + IN FORM_BROWSER_FORMSET *FormSet, + IN BOOLEAN SetValue + ); + +/** + check whether the formset need to update the NV. + + @param FormSet FormSet data structure. + + @retval TRUE Need to update the NV. + @retval FALSE No need to update the NV. +**/ +BOOLEAN +IsNvUpdateRequired ( + IN FORM_BROWSER_FORMSET *FormSet + ); + +/** + Call the call back function for the question and process the return action. + + @param Selection On input, Selection tell setup browser the information + about the Selection, form and formset to be displayed. + On output, Selection return the screen item that is selected + by user. + @param Statement The Question which need to call. + @param Action The action request. + @param SkipSaveOrDiscard Whether skip save or discard action. + + @retval EFI_SUCCESS The call back function excutes successfully. + @return Other value if the call back function failed to excute. +**/ +EFI_STATUS +ProcessCallBackFunction ( + IN OUT UI_MENU_SELECTION *Selection, + IN FORM_BROWSER_STATEMENT *Question, + IN EFI_BROWSER_ACTION Action, + IN BOOLEAN SkipSaveOrDiscard + ); + +/** + Call the retrieve type call back function for one question to get the initialize data. + + This function only used when in the initialize stage, because in this stage, the + Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead. + + @param ConfigAccess The config access protocol produced by the hii driver. + @param Statement The Question which need to call. + + @retval EFI_SUCCESS The call back function excutes successfully. + @return Other value if the call back function failed to excute. +**/ +EFI_STATUS +ProcessRetrieveForQuestion ( + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess, + IN FORM_BROWSER_STATEMENT *Statement + ); + +/** + Find the matched FormSet context in the backup maintain list based on HiiHandle. + + @param Handle The Hii Handle. + + @return the found FormSet context. If no found, NULL will return. + +**/ +FORM_BROWSER_FORMSET * +GetFormSetFromHiiHandle ( + EFI_HII_HANDLE Handle + ); + +/** + Check whether the input HII handle is the FormSet that is being used. + + @param Handle The Hii Handle. + + @retval TRUE HII handle is being used. + @retval FALSE HII handle is not being used. + +**/ +BOOLEAN +IsHiiHandleInBrowserContext ( + EFI_HII_HANDLE Handle + ); + +/** + Configure what scope the hot key will impact. + All hot keys have the same scope. The mixed hot keys with the different level are not supported. + If no scope is set, the default scope will be FormSet level. + After all registered hot keys are removed, previous Scope can reset to another level. + + @param[in] Scope Scope level to be set. + + @retval EFI_SUCCESS Scope is set correctly. + @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE. + @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have. + +**/ +EFI_STATUS +EFIAPI +SetScope ( + IN BROWSER_SETTING_SCOPE Scope + ); + +/** + Register the hot key with its browser action, or unregistered the hot key. + Only support hot key that is not printable character (control key, function key, etc.). + If the action value is zero, the hot key will be unregistered if it has been registered. + If the same hot key has been registered, the new action and help string will override the previous ones. + + @param[in] KeyData A pointer to a buffer that describes the keystroke + information for the hot key. Its type is EFI_INPUT_KEY to + be supported by all ConsoleIn devices. + @param[in] Action Action value that describes what action will be trigged when the hot key is pressed. + @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action. + @param[in] HelpString Help string that describes the hot key information. + Its value may be NULL for the unregistered hot key. + + @retval EFI_SUCCESS Hot key is registered or unregistered. + @retval EFI_INVALID_PARAMETER KeyData is NULL. + @retval EFI_NOT_FOUND KeyData is not found to be unregistered. + @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser. +**/ +EFI_STATUS +EFIAPI +RegisterHotKey ( + IN EFI_INPUT_KEY *KeyData, + IN UINT32 Action, + IN UINT16 DefaultId, + IN EFI_STRING HelpString OPTIONAL + ); + +/** + Register Exit handler function. + When more than one handler function is registered, the latter one will override the previous one. + When NULL handler is specified, the previous Exit handler will be unregistered. + + @param[in] Handler Pointer to handler function. + +**/ +VOID +EFIAPI +RegiserExitHandler ( + IN EXIT_HANDLER Handler + ); + +/** + Create reminder to let user to choose save or discard the changed browser data. + Caller can use it to actively check the changed browser data. + + @retval BROWSER_NO_CHANGES No browser data is changed. + @retval BROWSER_SAVE_CHANGES The changed browser data is saved. + @retval BROWSER_DISCARD_CHANGES The changed browser data is discard. + +**/ +UINT32 +EFIAPI +SaveReminder ( + VOID + ); + +/** + Find the registered HotKey based on KeyData. + + @param[in] KeyData A pointer to a buffer that describes the keystroke + information for the hot key. + + @return The registered HotKey context. If no found, NULL will return. +**/ +BROWSER_HOT_KEY * +GetHotKeyFromRegisterList ( + IN EFI_INPUT_KEY *KeyData + ); + #endif