]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h
MdeModulePkg:Fix the potential memory leak issue in Display Engine
[mirror_edk2.git] / MdeModulePkg / Universal / DisplayEngineDxe / FormDisplay.h
index 45bcadc7e654dc6f268c7bce86e0d50db0180456..063e94c6bc4d45139ca508fac6e7b1c4cb004c59 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FormDiplay protocol to show Form\r
 \r
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -63,6 +63,7 @@ extern CHAR16            gPromptBlockWidth;
 extern CHAR16            gOptionBlockWidth;\r
 extern CHAR16            gHelpBlockWidth;\r
 extern CHAR16            *mUnknownString;\r
+extern BOOLEAN           gMisMatch;\r
 \r
 //\r
 // Screen definitions\r
@@ -73,6 +74,8 @@ extern CHAR16            *mUnknownString;
 #define POPUP_PAD_SPACE_COUNT         5\r
 #define POPUP_FRAME_WIDTH             2\r
 \r
+#define UPPER_LOWER_CASE_OFFSET       0x20\r
+\r
 //\r
 // Display definitions\r
 //\r
@@ -110,8 +113,9 @@ extern CHAR16            *mUnknownString;
 //\r
 // It take 23 characters including the NULL to print a 64 bits number with "[" and "]".\r
 // pow(2, 64) = [18446744073709551616]\r
+// with extra '-' flat, set the width to 24.\r
 //\r
-#define MAX_NUMERIC_INPUT_WIDTH 23\r
+#define MAX_NUMERIC_INPUT_WIDTH 24\r
 \r
 #define EFI_HII_EXPRESSION_INCONSISTENT_IF   0\r
 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF      1\r
@@ -169,7 +173,6 @@ typedef enum {
   CfUiPageUp,\r
   CfUiPageDown,\r
   CfUiDown,\r
-  CfUiDefault,\r
   CfUiNoOperation,\r
   CfExit,\r
   CfUiHotKey,\r
@@ -194,10 +197,41 @@ typedef struct {
 } SCREEN_OPERATION_T0_CONTROL_FLAG;\r
 \r
 typedef struct {\r
-  EFI_QUESTION_ID    QuestionId;\r
-  UINT16             DisplayRow;\r
+  EFI_HII_HANDLE     HiiHandle;\r
+  UINT16             FormId;\r
+  \r
+  //\r
+  // Info for the highlight question.\r
+  // HLT means highlight\r
+  //\r
+  // If one statement has questionid, save questionid info to find the question.\r
+  // If one statement not has questionid info, save the opcode info to find the \r
+  // statement. If more than one statement has same opcode in one form(just like\r
+  // empty subtitle info may has more than one info one form), also use Index \r
+  // info to find the statement.\r
+  //\r
+  EFI_QUESTION_ID    HLTQuestionId;\r
+  EFI_IFR_OP_HEADER  *HLTOpCode;\r
+  UINTN              HLTIndex;\r
+  UINTN              HLTSequence;\r
+  \r
+  //\r
+  // Info for the top of screen question.\r
+  // TOS means Top Of Screen\r
+  //\r
+  EFI_QUESTION_ID    TOSQuestionId;\r
+  EFI_IFR_OP_HEADER  *TOSOpCode;\r
+  UINTN              TOSIndex;\r
+\r
+  UINT16             SkipValue;\r
 } DISPLAY_HIGHLIGHT_MENU_INFO;\r
 \r
+typedef struct {\r
+  EFI_EVENT   SyncEvent;\r
+  UINT8       *TimeOut;\r
+  CHAR16      *ErrorInfo;\r
+} WARNING_IF_CONTEXT;\r
+\r
 #define UI_MENU_OPTION_SIGNATURE  SIGNATURE_32 ('u', 'i', 'm', 'm')\r
 \r
 typedef struct {\r
@@ -573,17 +607,46 @@ ExitDisplay (
   );\r
 \r
 /**\r
-  Process validate for one question.\r
+  Process nothing.\r
 \r
-  @param  Question               The question which need to validate.\r
+  @param Event    The Event need to be process\r
+  @param Context  The context of the event.\r
 \r
-  @retval EFI_SUCCESS            Question Option process success.\r
-  @retval Other                  Question Option process fail.\r
+**/\r
+VOID\r
+EFIAPI\r
+EmptyEventProcess (\r
+  IN  EFI_EVENT    Event,\r
+  IN  VOID         *Context\r
+  );\r
+\r
+/**\r
+  Process for the refresh interval statement.\r
+\r
+  @param Event    The Event need to be process\r
+  @param Context  The context of the event.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+RefreshTimeOutProcess (\r
+  IN  EFI_EVENT    Event,\r
+  IN  VOID         *Context\r
+  );\r
+\r
+/**\r
+  Record the highlight menu and top of screen menu info.\r
+\r
+  @param  Highlight               The menu opton which is highlight.\r
+  @param  TopOfScreen             The menu opton which is at the top of the form.\r
+  @param  SkipValue               The skip line info for the top of screen menu.\r
 \r
 **/\r
-EFI_STATUS \r
-ValidateQuestion (\r
-  IN FORM_DISPLAY_ENGINE_STATEMENT   *Question\r
+VOID\r
+UpdateHighlightMenuInfo (\r
+  IN  LIST_ENTRY                      *Highlight,\r
+  IN  LIST_ENTRY                      *TopOfScreen,\r
+  IN  UINTN                           SkipValue\r
   );\r
 \r
 #endif\r