]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
Enhance the browser parse opcode logic, skip the opcode which is not defined in UEFI...
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.h
index 9cb4653c82567bf379cbd7e97314e0272672575d..cb3cc320bca4135f75ed0104431c32d6397b67a3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private MACRO, structure and function definitions for Setup Browser module.\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -169,7 +169,6 @@ typedef struct {
   BROWSER_STORAGE  *BrowserStorage;\r
 \r
   CHAR16           *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
-  CHAR16           *ConfigElements;// Elements need to load initial data.\r
   UINTN            ElementCount;   // Number of <RequestElement> in the <ConfigRequest>\r
   UINTN            SpareStrLen;    // Spare length of ConfigRequest string buffer\r
 } FORMSET_STORAGE;\r
@@ -228,6 +227,7 @@ typedef struct {
   EFI_HII_VALUE     Result;          // Expression evaluation result\r
 \r
   UINT8             TimeOut;         // For EFI_IFR_WARNING_IF\r
+  EFI_IFR_OP_HEADER *OpCode;         // Save the opcode buffer.\r
 \r
   LIST_ENTRY        OpCodeListHead;  // OpCodes consist of this expression (EXPRESSION_OPCODE)\r
 } FORM_EXPRESSION;\r
@@ -288,9 +288,11 @@ typedef enum {
   ExpressOption\r
 } EXPRESS_LEVEL;\r
 \r
+typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT;\r
+\r
 #define FORM_BROWSER_STATEMENT_SIGNATURE  SIGNATURE_32 ('F', 'S', 'T', 'A')\r
 \r
-typedef struct {\r
+struct _FORM_BROWSER_STATEMENT{\r
   UINTN                 Signature;\r
   LIST_ENTRY            Link;\r
 \r
@@ -352,7 +354,8 @@ typedef struct {
 \r
   EFI_IMAGE_ID          ImageId;             // nested EFI_IFR_IMAGE\r
   UINT8                 RefreshInterval;     // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh\r
-  BOOLEAN               InSubtitle;          // nesting inside of EFI_IFR_SUBTITLE\r
+\r
+  FORM_BROWSER_STATEMENT *ParentStatement;\r
 \r
   LIST_ENTRY            InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
   LIST_ENTRY            NoSubmitListHead;    // nested nosubmit expression list (FORM_EXPRESSION)\r
@@ -361,7 +364,7 @@ typedef struct {
 \r
   FORM_EXPRESSION       *ReadExpression;     // nested EFI_IFR_READ, provide this question value by read expression.\r
   FORM_EXPRESSION       *WriteExpression;    // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.\r
-} FORM_BROWSER_STATEMENT;\r
+};\r
 \r
 #define FORM_BROWSER_STATEMENT_FROM_LINK(a)  CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r
 \r
@@ -544,7 +547,6 @@ extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;
 \r
 extern BOOLEAN               gResetRequired;\r
 extern BOOLEAN               gExitRequired;\r
-extern BOOLEAN               gFinishRetrieveCall;\r
 extern LIST_ENTRY            gBrowserFormSetList;\r
 extern LIST_ENTRY            gBrowserHotKeyList;\r
 extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r
@@ -709,6 +711,35 @@ IsQuestionValueChanged (
   IN GET_SET_QUESTION_VALUE_WITH      GetValueFrom\r
   );\r
 \r
+/**\r
+  Validate the FormSet. If the formset is not validate, remove it from the list.\r
+\r
+  @param  FormSet                The input FormSet which need to validate.\r
+\r
+  @retval TRUE                   The handle is validate.\r
+  @retval FALSE                  The handle is invalidate.\r
+\r
+**/\r
+BOOLEAN\r
+ValidateFormSet (\r
+  FORM_BROWSER_FORMSET    *FormSet\r
+  );\r
+\r
+/**\r
+  Update the ValueChanged status for questions.\r
+\r
+  @param  FormSet                FormSet data structure.\r
+  @param  Form                   Form data structure.\r
+  @param  SettingScope           Setting Scope for Default action.\r
+\r
+**/\r
+VOID \r
+UpdateStatementStatus (\r
+  IN FORM_BROWSER_FORMSET             *FormSet,\r
+  IN FORM_BROWSER_FORM                *Form, \r
+  IN BROWSER_SETTING_SCOPE            SettingScope\r
+  );\r
+\r
 /**\r
   Get Question's current Value.\r
 \r
@@ -1140,19 +1171,6 @@ IsNvUpdateRequiredForFormSet (
   IN FORM_BROWSER_FORMSET  *FormSet\r
   );\r
 \r
-/**\r
-  Check whether the storage data for current form set is changed.\r
-\r
-  @param  FormSet           FormSet data structure.\r
-\r
-  @retval TRUE              Data is changed.\r
-  @retval FALSE             Data is not changed.\r
-**/\r
-BOOLEAN \r
-IsStorageDataChangedForFormSet (\r
-  IN FORM_BROWSER_FORMSET             *FormSet\r
-  );\r
-\r
 /**\r
   Call the call back function for the question and process the return action.\r
 \r
@@ -1187,6 +1205,7 @@ ProcessCallBackFunction (
 \r
   @param ConfigAccess          The config access protocol produced by the hii driver.\r
   @param Statement             The Question which need to call.\r
+  @param FormSet               The formset this question belong to.\r
 \r
   @retval EFI_SUCCESS          The call back function excutes successfully.\r
   @return Other value if the call back function failed to excute.  \r
@@ -1194,7 +1213,8 @@ ProcessCallBackFunction (
 EFI_STATUS \r
 ProcessRetrieveForQuestion (\r
   IN     EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess,\r
-  IN     FORM_BROWSER_STATEMENT          *Statement\r
+  IN     FORM_BROWSER_STATEMENT          *Statement,\r
+  IN     FORM_BROWSER_FORMSET            *FormSet\r
   );\r
 \r
 /**\r
@@ -1324,6 +1344,7 @@ ExecuteAction (
   @retval BROWSER_NO_CHANGES       No browser data is changed.\r
   @retval BROWSER_SAVE_CHANGES     The changed browser data is saved.\r
   @retval BROWSER_DISCARD_CHANGES  The changed browser data is discard.\r
+  @retval BROWSER_KEEP_CURRENT     Browser keep current changes.\r
 \r
 **/\r
 UINT32\r
@@ -1637,4 +1658,57 @@ DevicePathToHiiHandle (
   IN EFI_GUID                   *FormsetGuid\r
   );\r
 \r
+/**\r
+  Adjust the config request info, remove the request elements which already in AllConfigRequest string.\r
+\r
+  @param  Storage                Form set Storage.\r
+  @param  Request                The input request string.\r
+  @param  RespString             Whether the input is ConfigRequest or ConfigResp format.\r
+\r
+  @retval TRUE                   Has element not covered by current used elements, need to continue to call ExtractConfig\r
+  @retval FALSE                  All elements covered by current used elements.\r
+\r
+**/\r
+BOOLEAN \r
+ConfigRequestAdjust (\r
+  IN  BROWSER_STORAGE         *Storage,\r
+  IN  CHAR16                  *Request,\r
+  IN  BOOLEAN                 RespString\r
+  );\r
+\r
+/**\r
+  Perform question check. \r
+  \r
+  If one question has more than one check, process form high priority to low.\r
+\r
+  @param  FormSet                FormSet data structure.\r
+  @param  Form                   Form data structure.\r
+  @param  Question               The Question to be validated.\r
+\r
+  @retval EFI_SUCCESS            Form validation pass.\r
+  @retval other                  Form validation failed.\r
+\r
+**/\r
+EFI_STATUS\r
+ValueChangedValidation (\r
+  IN  FORM_BROWSER_FORMSET            *FormSet,\r
+  IN  FORM_BROWSER_FORM               *Form,\r
+  IN  FORM_BROWSER_STATEMENT          *Question\r
+  );\r
+\r
+/**\r
+  Pop up the error info.\r
+\r
+  @param      BrowserStatus    The input browser status.\r
+  @param      OpCode           The opcode use to get the erro info and timeout value.\r
+  @param      ErrorString      Error string used by BROWSER_NO_SUBMIT_IF.\r
+\r
+**/\r
+VOID\r
+PopupErrorMessage (\r
+  IN UINT32                BrowserStatus,\r
+  IN EFI_IFR_OP_HEADER     *OpCode, OPTIONAL\r
+  IN CHAR16                *ErrorString\r
+  );\r
+\r
 #endif\r