X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDisplayEngineDxe%2FFormDisplay.h;h=7e2a1aa64be084d0b394425b6e0315daad28bbd6;hb=2f808acc87ccc7bbaade923886e968b719104d11;hp=ad4684efc393c188568b36c73359b69bb93d9e5d;hpb=7c6c064ca8ebb5baf5104e8a4764cd3c19ef8bf1;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h index ad4684efc3..7e2a1aa64b 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h @@ -1,7 +1,7 @@ /** @file FormDiplay protocol to show Form -Copyright (c) 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at @@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include @@ -41,6 +42,17 @@ extern FORM_DISPLAY_ENGINE_FORM *gFormData; extern EFI_HII_HANDLE gHiiHandle; extern UINT16 gDirection; extern LIST_ENTRY gMenuOption; +extern CHAR16 *gConfirmOptYes; +extern CHAR16 *gConfirmOptNo; +extern CHAR16 *gConfirmOptOk; +extern CHAR16 *gConfirmOptCancel; +extern CHAR16 *gYesOption; +extern CHAR16 *gNoOption; +extern CHAR16 *gOkOption; +extern CHAR16 *gCancelOption; +extern CHAR16 *gErrorPopup; +extern CHAR16 *gWarningPopup; +extern CHAR16 *gInfoPopup; // // Browser Global Strings @@ -58,11 +70,13 @@ extern CHAR16 *gMiniString; extern CHAR16 *gOptionMismatch; extern CHAR16 *gFormSuppress; extern CHAR16 *gProtocolNotFound; +extern CHAR16 *gPasswordUnsupported; extern CHAR16 gPromptBlockWidth; extern CHAR16 gOptionBlockWidth; extern CHAR16 gHelpBlockWidth; extern CHAR16 *mUnknownString; +extern BOOLEAN gMisMatch; // // Screen definitions @@ -73,6 +87,8 @@ extern CHAR16 *mUnknownString; #define POPUP_PAD_SPACE_COUNT 5 #define POPUP_FRAME_WIDTH 2 +#define UPPER_LOWER_CASE_OFFSET 0x20 + // // Display definitions // @@ -110,8 +126,9 @@ extern CHAR16 *mUnknownString; // // It take 23 characters including the NULL to print a 64 bits number with "[" and "]". // pow(2, 64) = [18446744073709551616] +// with extra '-' flat, set the width to 24. // -#define MAX_NUMERIC_INPUT_WIDTH 23 +#define MAX_NUMERIC_INPUT_WIDTH 24 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1 @@ -134,6 +151,7 @@ typedef struct { // Produced protocol // EDKII_FORM_DISPLAY_ENGINE_PROTOCOL FromDisplayProt; + EFI_HII_POPUP_PROTOCOL HiiPopup; } FORM_DISPLAY_DRIVER_PRIVATE_DATA; @@ -169,7 +187,6 @@ typedef enum { CfUiPageUp, CfUiPageDown, CfUiDown, - CfUiDefault, CfUiNoOperation, CfExit, CfUiHotKey, @@ -194,10 +211,41 @@ typedef struct { } SCREEN_OPERATION_T0_CONTROL_FLAG; typedef struct { - EFI_QUESTION_ID QuestionId; - UINT16 DisplayRow; + EFI_HII_HANDLE HiiHandle; + UINT16 FormId; + + // + // Info for the highlight question. + // HLT means highlight + // + // If one statement has questionid, save questionid info to find the question. + // If one statement not has questionid info, save the opcode info to find the + // statement. If more than one statement has same opcode in one form(just like + // empty subtitle info may has more than one info one form), also use Index + // info to find the statement. + // + EFI_QUESTION_ID HLTQuestionId; + EFI_IFR_OP_HEADER *HLTOpCode; + UINTN HLTIndex; + UINTN HLTSequence; + + // + // Info for the top of screen question. + // TOS means Top Of Screen + // + EFI_QUESTION_ID TOSQuestionId; + EFI_IFR_OP_HEADER *TOSOpCode; + UINTN TOSIndex; + + UINT16 SkipValue; } DISPLAY_HIGHLIGHT_MENU_INFO; +typedef struct { + EFI_EVENT SyncEvent; + UINT8 *TimeOut; + CHAR16 *ErrorInfo; +} WARNING_IF_CONTEXT; + #define UI_MENU_OPTION_SIGNATURE SIGNATURE_32 ('u', 'i', 'm', 'm') typedef struct { @@ -237,6 +285,60 @@ typedef struct { #define MENU_OPTION_FROM_LINK(a) CR (a, UI_MENU_OPTION, Link, UI_MENU_OPTION_SIGNATURE) +#define USER_SELECTABLE_OPTION_OK_WIDTH StrLen (gOkOption) +#define USER_SELECTABLE_OPTION_OK_CAL_WIDTH (StrLen (gOkOption) + StrLen (gCancelOption)) +#define USER_SELECTABLE_OPTION_YES_NO_WIDTH (StrLen (gYesOption) + StrLen (gNoOption)) +#define USER_SELECTABLE_OPTION_YES_NO_CAL_WIDTH (StrLen (gYesOption) + StrLen (gNoOption) + StrLen (gCancelOption)) + +#define USER_SELECTABLE_OPTION_SKIP_WIDTH 2 + +// +// +-------------------------------------------+ // POPUP_BORDER } +// | ERROR/WARNING/INFO | // POPUP_STYLE_STRING_HEIGHT } POPUP_HEADER_HEIGHT +// |-------------------------------------------| // POPUP_EMPTY_LINE_HEIGHT } +// | popup messages | +// | | // POPUP_EMPTY_LINE_HEIGHT } +// | user selectable options | // POPUP_USER_SELECTABLE_OPTION_HEIGHT } POPUP_FOOTER_HEIGHT +// +-------------------------------------------+ // POPUP_BORDER } +// +#define POPUP_BORDER 1 +#define POPUP_EMPTY_LINE_HEIGHT 1 +#define POPUP_STYLE_STRING_HEIGHT 1 +#define POPUP_USER_SELECTABLE_OPTION_HEIGHT 1 + +#define POPUP_HEADER_HEIGHT (POPUP_BORDER + POPUP_STYLE_STRING_HEIGHT + POPUP_EMPTY_LINE_HEIGHT) +#define POPUP_FOOTER_HEIGHT (POPUP_EMPTY_LINE_HEIGHT + POPUP_USER_SELECTABLE_OPTION_HEIGHT + POPUP_BORDER) + +#define USER_SELECTABLE_OPTION_SIGNATURE SIGNATURE_32 ('u', 's', 's', 'o') + +typedef struct { + UINTN Signature; + LIST_ENTRY Link; + EFI_HII_POPUP_SELECTION OptionType; + CHAR16 *OptionString; + // + // Display item sequence for user select options + // Ok: Ok + // Sequence: 0 + // + // Ok/Cancel: Ok : Cancel + // Sequence: 0 1 + // + // Yes/No: Yes : No + // Sequence: 0 1 + // + // Yes/No/Cancel: Yes : No: Cancel + // Sequence: 0 1 2 + // + UINTN Sequence; + UINTN OptionRow; + UINTN OptionCol; + UINTN MaxSequence; + UINTN MinSequence; +} USER_SELECTABLE_OPTION; + +#define SELECTABLE_OPTION_FROM_LINK(a) CR (a, USER_SELECTABLE_OPTION, Link, USER_SELECTABLE_OPTION_SIGNATURE) + /** Print Question Value according to it's storage width and display attributes. @@ -553,6 +655,15 @@ FormDisplay ( OUT USER_INPUT *UserInputData ); +/** + Clear Screen to the initial state. +**/ +VOID +EFIAPI +DriverClearDisplayPage ( + VOID + ); + /** Exit Display and Clear Screen to the original state. @@ -564,17 +675,73 @@ ExitDisplay ( ); /** - Process validate for one question. + Process nothing. - @param Question The question which need to validate. + @param Event The Event need to be process + @param Context The context of the event. - @retval EFI_SUCCESS Question Option process success. - @retval Other Question Option process fail. +**/ +VOID +EFIAPI +EmptyEventProcess ( + IN EFI_EVENT Event, + IN VOID *Context + ); + +/** + Process for the refresh interval statement. + + @param Event The Event need to be process + @param Context The context of the event. **/ -EFI_STATUS -ValidateQuestion ( - IN FORM_DISPLAY_ENGINE_STATEMENT *Question +VOID +EFIAPI +RefreshTimeOutProcess ( + IN EFI_EVENT Event, + IN VOID *Context + ); + +/** + Record the highlight menu and top of screen menu info. + + @param Highlight The menu opton which is highlight. + @param TopOfScreen The menu opton which is at the top of the form. + @param SkipValue The skip line info for the top of screen menu. + +**/ +VOID +UpdateHighlightMenuInfo ( + IN LIST_ENTRY *Highlight, + IN LIST_ENTRY *TopOfScreen, + IN UINTN SkipValue + ); + +/** + Displays a popup window. + + @param This A pointer to the EFI_HII_POPUP_PROTOCOL instance. + @param PopupStyle Popup style to use. + @param PopupType Type of the popup to display. + @param HiiHandle HII handle of the string pack containing Message + @param Message A message to display in the popup box. + @param UserSelection User selection. + + @retval EFI_SUCCESS The popup box was successfully displayed. + @retval EFI_INVALID_PARAMETER HiiHandle and Message do not define a valid HII string. + @retval EFI_INVALID_PARAMETER PopupType is not one of the values defined by this specification. + @retval EFI_OUT_OF_RESOURCES There are not enough resources available to display the popup box. + +**/ +EFI_STATUS +EFIAPI +CreatePopup ( + IN EFI_HII_POPUP_PROTOCOL *This, + IN EFI_HII_POPUP_STYLE PopupStyle, + IN EFI_HII_POPUP_TYPE PopupType, + IN EFI_HII_HANDLE HiiHandle, + IN EFI_STRING_ID Message, + OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL ); #endif