]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h
MdeModulePkg/DisplayEngineDxe: Remove unnecessary parentheses in 'if'
[mirror_edk2.git] / MdeModulePkg / Universal / DisplayEngineDxe / FormDisplay.h
index ad4684efc393c188568b36c73359b69bb93d9e5d..7e2a1aa64be084d0b394425b6e0315daad28bbd6 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 - 2017, 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
@@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/FormBrowserEx2.h>\r
 #include <Protocol/SimpleTextIn.h>\r
 #include <Protocol/DisplayProtocol.h>\r
+#include <Protocol/HiiPopup.h>\r
 \r
 #include <Guid/MdeModuleHii.h>\r
 \r
@@ -41,6 +42,17 @@ extern FORM_DISPLAY_ENGINE_FORM      *gFormData;
 extern EFI_HII_HANDLE                gHiiHandle;\r
 extern UINT16                        gDirection;\r
 extern LIST_ENTRY                    gMenuOption;\r
+extern CHAR16                        *gConfirmOptYes;\r
+extern CHAR16                        *gConfirmOptNo;\r
+extern CHAR16                        *gConfirmOptOk;\r
+extern CHAR16                        *gConfirmOptCancel;\r
+extern CHAR16                        *gYesOption;\r
+extern CHAR16                        *gNoOption;\r
+extern CHAR16                        *gOkOption;\r
+extern CHAR16                        *gCancelOption;\r
+extern CHAR16                        *gErrorPopup;\r
+extern CHAR16                        *gWarningPopup;\r
+extern CHAR16                        *gInfoPopup;\r
 \r
 //\r
 // Browser Global Strings\r
@@ -58,11 +70,13 @@ extern CHAR16            *gMiniString;
 extern CHAR16            *gOptionMismatch;\r
 extern CHAR16            *gFormSuppress;\r
 extern CHAR16            *gProtocolNotFound;\r
+extern CHAR16            *gPasswordUnsupported;\r
 \r
 extern CHAR16            gPromptBlockWidth;\r
 extern CHAR16            gOptionBlockWidth;\r
 extern CHAR16            gHelpBlockWidth;\r
 extern CHAR16            *mUnknownString;\r
+extern BOOLEAN           gMisMatch;\r
 \r
 //\r
 // Screen definitions\r
@@ -73,6 +87,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 +126,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
@@ -134,6 +151,7 @@ typedef struct {
   // Produced protocol\r
   //\r
   EDKII_FORM_DISPLAY_ENGINE_PROTOCOL FromDisplayProt;\r
+  EFI_HII_POPUP_PROTOCOL             HiiPopup;\r
 } FORM_DISPLAY_DRIVER_PRIVATE_DATA;\r
 \r
 \r
@@ -169,7 +187,6 @@ typedef enum {
   CfUiPageUp,\r
   CfUiPageDown,\r
   CfUiDown,\r
-  CfUiDefault,\r
   CfUiNoOperation,\r
   CfExit,\r
   CfUiHotKey,\r
@@ -194,10 +211,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
@@ -237,6 +285,60 @@ typedef struct {
 \r
 #define MENU_OPTION_FROM_LINK(a)  CR (a, UI_MENU_OPTION, Link, UI_MENU_OPTION_SIGNATURE)\r
 \r
+#define USER_SELECTABLE_OPTION_OK_WIDTH           StrLen (gOkOption)\r
+#define USER_SELECTABLE_OPTION_OK_CAL_WIDTH       (StrLen (gOkOption) + StrLen (gCancelOption))\r
+#define USER_SELECTABLE_OPTION_YES_NO_WIDTH       (StrLen (gYesOption) + StrLen (gNoOption))\r
+#define USER_SELECTABLE_OPTION_YES_NO_CAL_WIDTH   (StrLen (gYesOption) + StrLen (gNoOption) + StrLen (gCancelOption))\r
+\r
+#define USER_SELECTABLE_OPTION_SKIP_WIDTH  2\r
+\r
+//\r
+// +-------------------------------------------+ // POPUP_BORDER                        }\r
+// |            ERROR/WARNING/INFO             | // POPUP_STYLE_STRING_HEIGHT           } POPUP_HEADER_HEIGHT\r
+// |-------------------------------------------| // POPUP_EMPTY_LINE_HEIGHT             }\r
+// |             popup messages                |\r
+// |                                           | // POPUP_EMPTY_LINE_HEIGHT             }\r
+// |         user selectable options           | // POPUP_USER_SELECTABLE_OPTION_HEIGHT } POPUP_FOOTER_HEIGHT\r
+// +-------------------------------------------+ // POPUP_BORDER                        }\r
+//\r
+#define POPUP_BORDER  1\r
+#define POPUP_EMPTY_LINE_HEIGHT  1\r
+#define POPUP_STYLE_STRING_HEIGHT  1\r
+#define POPUP_USER_SELECTABLE_OPTION_HEIGHT  1\r
+\r
+#define POPUP_HEADER_HEIGHT  (POPUP_BORDER + POPUP_STYLE_STRING_HEIGHT + POPUP_EMPTY_LINE_HEIGHT)\r
+#define POPUP_FOOTER_HEIGHT  (POPUP_EMPTY_LINE_HEIGHT + POPUP_USER_SELECTABLE_OPTION_HEIGHT + POPUP_BORDER)\r
+\r
+#define USER_SELECTABLE_OPTION_SIGNATURE  SIGNATURE_32 ('u', 's', 's', 'o')\r
+\r
+typedef struct {\r
+  UINTN                   Signature;\r
+  LIST_ENTRY              Link;\r
+  EFI_HII_POPUP_SELECTION OptionType;\r
+  CHAR16                  *OptionString;\r
+  //\r
+  // Display item sequence for user select options\r
+  //  Ok:        Ok\r
+  //  Sequence:  0\r
+  //\r
+  //  Ok/Cancel:   Ok : Cancel\r
+  //  Sequence:    0      1\r
+  //\r
+  //  Yes/No:      Yes : No\r
+  //  Sequence:     0    1\r
+  //\r
+  //  Yes/No/Cancel: Yes : No: Cancel\r
+  //  Sequence:       0    1    2\r
+  //\r
+  UINTN                   Sequence;\r
+  UINTN                   OptionRow;\r
+  UINTN                   OptionCol;\r
+  UINTN                   MaxSequence;\r
+  UINTN                   MinSequence;\r
+} USER_SELECTABLE_OPTION;\r
+\r
+#define SELECTABLE_OPTION_FROM_LINK(a)  CR (a, USER_SELECTABLE_OPTION, Link, USER_SELECTABLE_OPTION_SIGNATURE)\r
+\r
 /**\r
   Print Question Value according to it's storage width and display attributes.\r
 \r
@@ -553,6 +655,15 @@ FormDisplay (
   OUT USER_INPUT                *UserInputData\r
   );\r
 \r
+/**\r
+  Clear Screen to the initial state.\r
+**/\r
+VOID\r
+EFIAPI \r
+DriverClearDisplayPage (\r
+  VOID\r
+  );\r
+\r
 /**\r
   Exit Display and Clear Screen to the original state.\r
 \r
@@ -564,17 +675,73 @@ 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
-EFI_STATUS \r
-ValidateQuestion (\r
-  IN FORM_DISPLAY_ENGINE_STATEMENT   *Question\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
+VOID\r
+UpdateHighlightMenuInfo (\r
+  IN  LIST_ENTRY                      *Highlight,\r
+  IN  LIST_ENTRY                      *TopOfScreen,\r
+  IN  UINTN                           SkipValue\r
+  );\r
+\r
+/**\r
+  Displays a popup window.\r
+\r
+  @param  This           A pointer to the EFI_HII_POPUP_PROTOCOL instance.\r
+  @param  PopupStyle     Popup style to use.\r
+  @param  PopupType      Type of the popup to display.\r
+  @param  HiiHandle      HII handle of the string pack containing Message\r
+  @param  Message        A message to display in the popup box.\r
+  @param  UserSelection  User selection.\r
+\r
+  @retval EFI_SUCCESS            The popup box was successfully displayed.\r
+  @retval EFI_INVALID_PARAMETER  HiiHandle and Message do not define a valid HII string.\r
+  @retval EFI_INVALID_PARAMETER  PopupType is not one of the values defined by this specification.\r
+  @retval EFI_OUT_OF_RESOURCES   There are not enough resources available to display the popup box.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CreatePopup (\r
+  IN  EFI_HII_POPUP_PROTOCOL  *This,\r
+  IN  EFI_HII_POPUP_STYLE     PopupStyle,\r
+  IN  EFI_HII_POPUP_TYPE      PopupType,\r
+  IN  EFI_HII_HANDLE          HiiHandle,\r
+  IN  EFI_STRING_ID           Message,\r
+  OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL\r
   );\r
 \r
 #endif\r