]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
Refine the code to have same function to process the string info. Also update the...
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.h
index eaf409b8e6afabd102be3e361633912c466877e2..6a5ddf1f2b06250ce74a77b48fd555f6cff72559 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private MACRO, structure and function definitions for Setup Browser module.\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, 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
@@ -198,6 +198,8 @@ typedef struct {
 \r
 typedef struct {\r
   UINT8               Type;\r
+  UINT8               *Buffer;\r
+  UINT16              BufferLen;\r
   EFI_IFR_TYPE_VALUE  Value;\r
 } EFI_HII_VALUE;\r
 \r
@@ -297,6 +299,14 @@ typedef struct {
 \r
 #define FORM_EXPRESSION_FROM_LINK(a)  CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r
 \r
+#define FORM_EXPRESSION_LIST_SIGNATURE  SIGNATURE_32 ('F', 'E', 'X', 'R')\r
+\r
+typedef struct {\r
+    UINTN               Signature;\r
+    UINTN               Count;\r
+    FORM_EXPRESSION    *Expression[1];   // Array[Count] of expressions\r
+} FORM_EXPRESSION_LIST;\r
+\r
 #define QUESTION_DEFAULT_SIGNATURE  SIGNATURE_32 ('Q', 'D', 'F', 'T')\r
 \r
 typedef struct {\r
@@ -314,19 +324,33 @@ typedef struct {
 #define QUESTION_OPTION_SIGNATURE  SIGNATURE_32 ('Q', 'O', 'P', 'T')\r
 \r
 typedef struct {\r
-  UINTN               Signature;\r
-  LIST_ENTRY          Link;\r
+  UINTN                Signature;\r
+  LIST_ENTRY           Link;\r
 \r
-  EFI_STRING_ID       Text;\r
-  UINT8               Flags;\r
-  EFI_HII_VALUE       Value;\r
-  EFI_IMAGE_ID        ImageId;\r
+  EFI_STRING_ID        Text;\r
+  UINT8                Flags;\r
+  EFI_HII_VALUE        Value;\r
+  EFI_IMAGE_ID         ImageId;\r
 \r
-  FORM_EXPRESSION     *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
+  FORM_EXPRESSION_LIST *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
 } QUESTION_OPTION;\r
 \r
 #define QUESTION_OPTION_FROM_LINK(a)  CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r
 \r
+typedef enum {\r
+  ExpressFalse = 0,\r
+  ExpressGrayOut,  \r
+  ExpressSuppress,\r
+  ExpressDisable\r
+} EXPRESS_RESULT;\r
+\r
+typedef enum {\r
+  ExpressNone = 0,\r
+  ExpressForm,  \r
+  ExpressStatement,\r
+  ExpressOption\r
+} EXPRESS_LEVEL;\r
+\r
 #define FORM_BROWSER_STATEMENT_SIGNATURE  SIGNATURE_32 ('F', 'S', 'T', 'A')\r
 \r
 typedef struct {\r
@@ -388,9 +412,7 @@ typedef struct {
 \r
   LIST_ENTRY            InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
   LIST_ENTRY            NoSubmitListHead;    // nested nosubmit expression list (FORM_EXPRESSION)\r
-  FORM_EXPRESSION       *GrayOutExpression;  // nesting inside of GrayOutIf\r
-  FORM_EXPRESSION       *SuppressExpression; // nesting inside of SuppressIf\r
-  FORM_EXPRESSION       *DisableExpression;  // nesting inside of DisableIf\r
+  FORM_EXPRESSION_LIST  *Expression;         // nesting inside of GrayOutIf/DisableIf/SuppressIf\r
 \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
@@ -415,24 +437,24 @@ typedef struct {
 #define STANDARD_MAP_FORM_TYPE 0x01\r
 \r
 typedef struct {\r
-  UINTN             Signature;\r
-  LIST_ENTRY        Link;\r
+  UINTN                Signature;\r
+  LIST_ENTRY           Link;\r
 \r
-  UINT16            FormId;               // FormId of normal form or formmap form.\r
-  EFI_STRING_ID     FormTitle;            // FormTile of normal form, or FormMapMethod title of formmap form.\r
-  UINT16            FormType;             // Specific form type for the different form.\r
+  UINT16               FormId;               // FormId of normal form or formmap form.\r
+  EFI_STRING_ID        FormTitle;            // FormTile of normal form, or FormMapMethod title of formmap form.\r
+  UINT16               FormType;             // Specific form type for the different form.\r
 \r
-  EFI_IMAGE_ID      ImageId;\r
+  EFI_IMAGE_ID         ImageId;\r
 \r
-  BOOLEAN           ModalForm;            // Whether this is a modal form.\r
-  BOOLEAN           Locked;               // Whether this form is locked.\r
+  BOOLEAN              ModalForm;            // Whether this is a modal form.\r
+  BOOLEAN              Locked;               // Whether this form is locked.\r
 \r
-  BOOLEAN           NvUpdateRequired;     // Whether this form has NV update request.\r
+  BOOLEAN              NvUpdateRequired;     // Whether this form has NV update request.\r
 \r
-  LIST_ENTRY        ExpressionListHead;   // List of Expressions (FORM_EXPRESSION)\r
-  LIST_ENTRY        StatementListHead;    // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
-  LIST_ENTRY        ConfigRequestHead;    // List of configreques for all storage.\r
-  FORM_EXPRESSION   *SuppressExpression;  // nesting inside of SuppressIf\r
+  LIST_ENTRY           ExpressionListHead;   // List of Expressions (FORM_EXPRESSION)\r
+  LIST_ENTRY           StatementListHead;    // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
+  LIST_ENTRY           ConfigRequestHead;    // List of configreques for all storage.\r
+  FORM_EXPRESSION_LIST *SuppressExpression;  // nesting inside of SuppressIf\r
 } FORM_BROWSER_FORM;\r
 \r
 #define FORM_BROWSER_FORM_FROM_LINK(a)  CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r
@@ -1024,6 +1046,7 @@ InitializeCurrentSetting (
                                  GUID), take the first FormSet found in package\r
                                  list.\r
   @param  FormSet                FormSet data structure.\r
+  @param  UpdateGlobalVar        Whether need to update the global variable.\r
 \r
   @retval EFI_SUCCESS            The function completed successfully.\r
   @retval EFI_NOT_FOUND          The specified FormSet could not be found.\r
@@ -1033,7 +1056,8 @@ EFI_STATUS
 InitializeFormSet (\r
   IN  EFI_HII_HANDLE                   Handle,\r
   IN OUT EFI_GUID                      *FormSetGuid,\r
-  OUT FORM_BROWSER_FORMSET             *FormSet\r
+  OUT FORM_BROWSER_FORMSET             *FormSet,\r
+  IN  BOOLEAN                          UpdateGlobalVar                   \r
   );\r
 \r
 /**\r
@@ -1062,6 +1086,7 @@ ExtractDefault (
   @param  Selection              Selection contains the information about \r
                                  the Selection, form and formset to be displayed.\r
                                  Selection action may be updated in retrieve callback.\r
+                                 If Selection is NULL, only initialize Question value.\r
   @param  FormSet                FormSet data structure.\r
   @param  Form                   Form data structure.\r
 \r
@@ -1081,6 +1106,7 @@ LoadFormConfig (
   @param  Selection              Selection contains the information about \r
                                  the Selection, form and formset to be displayed.\r
                                  Selection action may be updated in retrieve callback.\r
+                                 If Selection is NULL, only initialize Question value.\r
   @param  FormSet                FormSet data structure.\r
 \r
   @retval EFI_SUCCESS            The function completed successfully.\r