]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
Base on the type field to get the width of value field for option opcode.
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.h
index 6a5ddf1f2b06250ce74a77b48fd555f6cff72559..e11cdc16d76b5c217d9a0ccbe5fdc259cb126aca 100644 (file)
@@ -574,6 +574,26 @@ typedef struct {
 \r
 #define BROWSER_HOT_KEY_FROM_LINK(a)  CR (a, BROWSER_HOT_KEY, Link, BROWSER_HOT_KEY_SIGNATURE)\r
 \r
+//\r
+// Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.\r
+//\r
+typedef enum {\r
+  GetDefaultForNoStorage,       // Get default value for question which not has storage.\r
+  GetDefaultForStorage,         // Get default value for question which has storage.\r
+  GetDefaultForAll,             // Get default value for all questions.\r
+  GetDefaultForMax              // Invalid value.\r
+} BROWSER_GET_DEFAULT_VALUE;\r
+\r
+//\r
+// Get/set question value from/to.\r
+//\r
+typedef enum {\r
+  GetSetValueWithEditBuffer,       // Get/Set question value from/to editbuffer in the storage.\r
+  GetSetValueWithBuffer,           // Get/Set question value from/to buffer in the storage.\r
+  GetSetValueWithHiiDriver,        // Get/Set question value from/to hii driver.\r
+  GetSetValueWithMax               // Invalid value.\r
+} GET_SET_QUESTION_VALUE_WITH;\r
+\r
 extern EFI_HII_DATABASE_PROTOCOL         *mHiiDatabase;\r
 extern EFI_HII_STRING_PROTOCOL           *mHiiString;\r
 extern EFI_HII_CONFIG_ROUTING_PROTOCOL   *mHiiConfigRouting;\r
@@ -877,6 +897,7 @@ CreateDialog (
   @param  Storage                The NameValue Storage.\r
   @param  Name                   The Name.\r
   @param  Value                  The retured Value.\r
+  @param  GetValueFrom           Where to get source value, from EditValue or Value.\r
 \r
   @retval EFI_SUCCESS            Value found for given Name.\r
   @retval EFI_NOT_FOUND          No such Name found in NameValue storage.\r
@@ -884,9 +905,10 @@ CreateDialog (
 **/\r
 EFI_STATUS\r
 GetValueByName (\r
-  IN FORMSET_STORAGE         *Storage,\r
-  IN CHAR16                  *Name,\r
-  IN OUT CHAR16              **Value\r
+  IN FORMSET_STORAGE             *Storage,\r
+  IN CHAR16                      *Name,\r
+  IN OUT CHAR16                  **Value,\r
+  IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
   );\r
 \r
 /**\r
@@ -895,7 +917,7 @@ GetValueByName (
   @param  Storage                The NameValue Storage.\r
   @param  Name                   The Name.\r
   @param  Value                  The Value to set.\r
-  @param  Edit                   Whether update editValue or Value.\r
+  @param  SetValueTo             Whether update editValue or Value.\r
 \r
   @retval EFI_SUCCESS            Value found for given Name.\r
   @retval EFI_NOT_FOUND          No such Name found in NameValue storage.\r
@@ -903,10 +925,10 @@ GetValueByName (
 **/\r
 EFI_STATUS\r
 SetValueByName (\r
-  IN FORMSET_STORAGE         *Storage,\r
-  IN CHAR16                  *Name,\r
-  IN CHAR16                  *Value,\r
-  IN BOOLEAN                 Edit\r
+  IN FORMSET_STORAGE             *Storage,\r
+  IN CHAR16                      *Name,\r
+  IN CHAR16                      *Value,\r
+  IN GET_SET_QUESTION_VALUE_WITH SetValueTo\r
   );\r
 \r
 /**\r
@@ -915,8 +937,7 @@ SetValueByName (
   @param  FormSet                FormSet data structure.\r
   @param  Form                   Form data structure.\r
   @param  Question               Question to be initialized.\r
-  @param  Cached                 TRUE:  get from Edit copy FALSE: get from original\r
-                                 Storage\r
+  @param  GetValueFrom           Where to get value, may from editbuffer, buffer or hii driver.\r
 \r
   @retval EFI_SUCCESS            The function completed successfully.\r
 \r
@@ -926,7 +947,7 @@ GetQuestionValue (
   IN FORM_BROWSER_FORMSET             *FormSet,\r
   IN FORM_BROWSER_FORM                *Form,\r
   IN OUT FORM_BROWSER_STATEMENT       *Question,\r
-  IN BOOLEAN                          Cached\r
+  IN GET_SET_QUESTION_VALUE_WITH      GetValueFrom\r
   );\r
 \r
 /**\r
@@ -935,8 +956,7 @@ GetQuestionValue (
   @param  FormSet                FormSet data structure.\r
   @param  Form                   Form data structure.\r
   @param  Question               Pointer to the Question.\r
-  @param  Cached                 TRUE:  set to Edit copy FALSE: set to original\r
-                                 Storage\r
+  @param  SetValueTo             Update the question value to editbuffer , buffer or hii driver.\r
 \r
   @retval EFI_SUCCESS            The function completed successfully.\r
 \r
@@ -946,7 +966,7 @@ SetQuestionValue (
   IN FORM_BROWSER_FORMSET             *FormSet,\r
   IN FORM_BROWSER_FORM                *Form,\r
   IN OUT FORM_BROWSER_STATEMENT       *Question,\r
-  IN BOOLEAN                          Cached\r
+  IN GET_SET_QUESTION_VALUE_WITH      SetValueTo\r
   );\r
 \r
 /**\r
@@ -1061,12 +1081,20 @@ InitializeFormSet (
   );\r
 \r
 /**\r
-  Reset Questions to their default value in a Form, Formset or System.\r
+  Reset Questions to their initial value or default value in a Form, Formset or System.\r
+\r
+  GetDefaultValueScope parameter decides which questions will reset \r
+  to its default value.\r
 \r
   @param  FormSet                FormSet data structure.\r
   @param  Form                   Form data structure.\r
   @param  DefaultId              The Class of the default.\r
   @param  SettingScope           Setting Scope for Default action.\r
+  @param  GetDefaultValueScope   Get default value scope.\r
+  @param  Storage                Get default value only for this storage.\r
+  @param  RetrieveValueFirst     Whether call the retrieve call back to\r
+                                 get the initial value before get default\r
+                                 value.\r
 \r
   @retval EFI_SUCCESS            The function completed successfully.\r
   @retval EFI_UNSUPPORTED        Unsupport SettingScope.\r
@@ -1077,7 +1105,10 @@ ExtractDefault (
   IN FORM_BROWSER_FORMSET             *FormSet,\r
   IN FORM_BROWSER_FORM                *Form,\r
   IN UINT16                           DefaultId,\r
-  IN BROWSER_SETTING_SCOPE            SettingScope\r
+  IN BROWSER_SETTING_SCOPE            SettingScope,\r
+  IN BROWSER_GET_DEFAULT_VALUE        GetDefaultValueScope,\r
+  IN FORMSET_STORAGE                  *Storage,\r
+  IN BOOLEAN                          RetrieveValueFirst\r
   );\r
 \r
 /**\r
@@ -1357,6 +1388,24 @@ ProcessCallBackFunction (
   IN     EFI_BROWSER_ACTION              Action,\r
   IN     BOOLEAN                         SkipSaveOrDiscard\r
   );\r
+  \r
+/**\r
+  Call the retrieve type call back function for one question to get the initialize data.\r
+  \r
+  This function only used when in the initialize stage, because in this stage, the \r
+  Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.\r
+\r
+  @param ConfigAccess          The config access protocol produced by the hii driver.\r
+  @param Statement             The Question which need to call.\r
+\r
+  @retval EFI_SUCCESS          The call back function excutes successfully.\r
+  @return Other value if the call back function failed to excute.  \r
+**/\r
+EFI_STATUS \r
+ProcessRetrieveForQuestion (\r
+  IN     EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess,\r
+  IN     FORM_BROWSER_STATEMENT          *Statement\r
+  );\r
 \r
 /**\r
   Find the matched FormSet context in the backup maintain list based on HiiHandle.\r