/** @file\r
FormDiplay protocol to show Form\r
\r
-Copyright (c) 2013, 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
-http://opensource.org/licenses/bsd-license.php. \r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
#ifndef __DISPLAY_PROTOCOL_H__\r
#define __DISPLAY_PROTOCOL_H__\r
\r
-#define FORM_DISPLAY_ENGINE_PROTOCOL_GUID \\r
+#include <Protocol/FormBrowser2.h>\r
+\r
+#define EDKII_FORM_DISPLAY_ENGINE_PROTOCOL_GUID \\r
{ 0x9bbe29e9, 0xfda1, 0x41ec, { 0xad, 0x52, 0x45, 0x22, 0x13, 0x74, 0x2d, 0x2e } }\r
\r
-#define FORM_DISPLAY_ENGINE_STATEMENT_VERSION 0x10000\r
-#define FORM_DISPLAY_ENGINE_VERSION 0x10000\r
+//\r
+// Do nothing.\r
+//\r
+#define BROWSER_ACTION_NONE BIT16\r
+//\r
+// ESC Exit\r
+//\r
+#define BROWSER_ACTION_FORM_EXIT BIT17\r
+\r
+#define BROWSER_SUCCESS 0x0\r
+#define BROWSER_ERROR BIT31\r
+#define BROWSER_SUBMIT_FAIL BROWSER_ERROR | 0x01\r
+#define BROWSER_NO_SUBMIT_IF BROWSER_ERROR | 0x02\r
+#define BROWSER_FORM_NOT_FOUND BROWSER_ERROR | 0x03\r
+#define BROWSER_FORM_SUPPRESS BROWSER_ERROR | 0x04\r
+#define BROWSER_PROTOCOL_NOT_FOUND BROWSER_ERROR | 0x05\r
+#define BROWSER_INCONSISTENT_IF BROWSER_ERROR | 0x06\r
+#define BROWSER_WARNING_IF BROWSER_ERROR | 0x07\r
+#define BROWSER_SUBMIT_FAIL_NO_SUBMIT_IF BROWSER_ERROR | 0x08\r
+#define BROWSER_RECONNECT_REQUIRED BROWSER_ERROR | 0x09\r
+#define BROWSER_RECONNECT_FAIL BROWSER_ERROR | 0x0A\r
+#define BROWSER_RECONNECT_SAVE_CHANGES BROWSER_ERROR | 0x0B\r
\r
-typedef struct _FORM_DISPLAY_ENGINE_PROTOCOL FORM_DISPLAY_ENGINE_PROTOCOL;\r
+#define FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1 0x10000\r
+#define FORM_DISPLAY_ENGINE_VERSION_1 0x10000\r
\r
typedef struct {\r
- UINT8 Type; // HII Data Type\r
- UINT8 *Buffer; // Buffer Data and Length if Type is EFI_IFR_TYPE_BUFFER or EFI_IFR_TYPE_STRING\r
+ //\r
+ // HII Data Type\r
+ //\r
+ UINT8 Type;\r
+ //\r
+ // Buffer Data and Length if Type is EFI_IFR_TYPE_BUFFER or EFI_IFR_TYPE_STRING\r
+ //\r
+ UINT8 *Buffer;\r
UINT16 BufferLen;\r
EFI_IFR_TYPE_VALUE Value;\r
} EFI_HII_VALUE;\r
typedef struct {\r
UINTN Signature;\r
LIST_ENTRY Link;\r
- EFI_IFR_ONE_OF_OPTION OptionOpCode; // OneOfOption Data\r
- EFI_IMAGE_ID ImageId; // Option ImageId and AnimationId\r
+ //\r
+ // OneOfOption Data\r
+ //\r
+ EFI_IFR_ONE_OF_OPTION *OptionOpCode;\r
+ //\r
+ // Option ImageId and AnimationId\r
+ //\r
+ EFI_IMAGE_ID ImageId;\r
EFI_ANIMATION_ID AnimationId;\r
} DISPLAY_QUESTION_OPTION;\r
\r
#define DISPLAY_QUESTION_OPTION_FROM_LINK(a) CR (a, DISPLAY_QUESTION_OPTION, Link, DISPLAY_QUESTION_OPTION_SIGNATURE)\r
\r
-\r
typedef struct _FORM_DISPLAY_ENGINE_STATEMENT FORM_DISPLAY_ENGINE_STATEMENT;\r
+typedef struct _FORM_DISPLAY_ENGINE_FORM FORM_DISPLAY_ENGINE_FORM;\r
\r
-//\r
-// Attribute for Statement and Form\r
-//\r
-#define HII_DISPLAY_GRAYOUT BIT0\r
-#define HII_DISPLAY_LOCK BIT1\r
-#define HII_DISPLAY_READONLY BIT2\r
-#define HII_DISPLAY_MODAL BIT3\r
+#define STATEMENT_VALID 0x0\r
+#define STATEMENT_INVALID BIT31\r
\r
-#define FORM_DISPLAY_ENGINE_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r
+#define INCOSISTENT_IF_TRUE STATEMENT_INVALID | 0x01\r
+#define WARNING_IF_TRUE STATEMENT_INVALID | 0x02\r
+#define STRING_TOO_LONG STATEMENT_INVALID | 0x03\r
+// ... to be extended.\r
\r
typedef struct {\r
- UINTN Signature;\r
- UINTN Version; // Version for future structure extension\r
- LIST_ENTRY StatementListHead; // Statement List inside of Form\r
- EFI_GUID FormSetGuid; // FormSet information\r
- EFI_HII_HANDLE HiiHandle; // HiiHandle can be used to get String, Image or Animation\r
- UINT16 FormId; // Form ID and Title.\r
- EFI_STRING_ID FormTitle;\r
- UINT32 Attribute; // Form Attributes: Lock, Modal.\r
- BOOLEAN SettingChangedFlag; // Flag to describe whether setting is changed or not.\r
- FORM_DISPLAY_ENGINE_STATEMENT *HighLightedStatement; // Statement to be HighLighted\r
- EFI_GUID *FormRefreshEventGuid; // EventGuid to notify Displayer that FormData is updated to be refreshed.\r
- LIST_ENTRY HotKeyListHead; // Additional Hotkey registered by BrowserEx protocol.\r
- EFI_IMAGE_ID ImageId; // Form ImageId and AnimationId\r
- EFI_ANIMATION_ID AnimationId;\r
-} FORM_DISPLAY_ENGINE_FORM;\r
-\r
-#define FORM_DISPLAY_ENGINE_FORM_FROM_LINK(a) CR (a, FORM_DISPLAY_ENGINE_FORM, Link, FORM_DISPLAY_ENGINE_FORM_SIGNATURE)\r
+ //\r
+ // StringId for INCONSITENT_IF or WARNING_IF\r
+ //\r
+ EFI_STRING_ID StringId;\r
+ //\r
+ // TimeOut for WARNING_IF\r
+ //\r
+ UINT8 TimeOut;\r
+} STATEMENT_ERROR_INFO;\r
\r
/**\r
Perform value check for a question.\r
- \r
+\r
@param Form Form where Statement is in.\r
@param Statement Value will check for it.\r
@param Value New value will be checked.\r
- \r
- @retval TRUE Input Value is valid.\r
- @retval FALSE Input Value is invalid.\r
+\r
+ @retval Status Value Status\r
+\r
**/\r
typedef\r
-BOOLEAN\r
+UINT32\r
(EFIAPI *VALIDATE_QUESTION) (\r
IN FORM_DISPLAY_ENGINE_FORM *Form,\r
IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,\r
- IN EFI_HII_VALUE *Value\r
+ IN EFI_HII_VALUE *Value,\r
+ OUT STATEMENT_ERROR_INFO *ErrorInfo\r
);\r
\r
/**\r
- Perform Password check. \r
+ Perform Password check.\r
Passwork may be encrypted by driver that requires the specific check.\r
- \r
+\r
@param Form Form where Password Statement is in.\r
@param Statement Password statement\r
@param PasswordString Password string to be checked. It may be NULL.\r
- \r
+ NULL means to restore password.\r
+ "" string can be used to checked whether old password does exist.\r
+\r
@return Status Status of Password check.\r
**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *PASSWORD_CHECK) (\r
IN FORM_DISPLAY_ENGINE_FORM *Form,\r
- IN FORM_DISPLAY_ENGINE_STATEMENT *Statement, \r
- IN EFI_STRING *PasswordString OPTIONAL\r
+ IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,\r
+ IN EFI_STRING PasswordString OPTIONAL\r
);\r
\r
#define FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')\r
\r
+//\r
+// Attribute for Statement and Form\r
+//\r
+#define HII_DISPLAY_NONE 0\r
+#define HII_DISPLAY_GRAYOUT BIT0\r
+#define HII_DISPLAY_LOCK BIT1\r
+#define HII_DISPLAY_READONLY BIT2\r
+#define HII_DISPLAY_MODAL BIT3\r
+#define HII_DISPLAY_SUPPRESS BIT4\r
+\r
struct _FORM_DISPLAY_ENGINE_STATEMENT{\r
UINTN Signature;\r
- UINTN Version; // Version for future structure extension\r
- LIST_ENTRY DisplayLink; // link to all the statement which will show in the display form.\r
- EFI_IFR_OP_HEADER *OpCode; // Pointer to statement opcode.\r
- // for Guided Opcode. All buffers will be here if GUIDED opcode scope is set.\r
- EFI_HII_VALUE CurrentValue; // Question CurrentValue\r
- BOOLEAN SettingChangedFlag; // Flag to describe whether setting is changed or not.\r
- // Displayer may depend on it to show it with the different color.\r
- LIST_ENTRY NestStatementList; // nested Statement list inside of EFI_IFR_SUBTITLE\r
- LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r
- UINT32 Attribute; // Statement attributes: GRAYOUT, LOCK and READONLY\r
- VALIDATE_QUESTION ValidateQuestion; // ValidateQuestion to do InconsistIf check\r
- EFI_STRING_ID InConsistentStringId; // InConsistentString popup will be used when ValidateQuestion returns FASLE.\r
- // If this ID is zero, then Display can customize error message for the invalid value.\r
- PASSWORD_CHECK PasswordCheck; // Password additional check. It may be NULL when the additional check is not required.\r
- EFI_IMAGE_ID ImageId; // Statement ImageId and AnimationId\r
+ //\r
+ // Version for future structure extension\r
+ //\r
+ UINTN Version;\r
+ //\r
+ // link to all the statement which will show in the display form.\r
+ //\r
+ LIST_ENTRY DisplayLink;\r
+ //\r
+ // Pointer to statement opcode.\r
+ // for Guided Opcode. All buffers will be here if GUIDED opcode scope is set.\r
+ //\r
+ EFI_IFR_OP_HEADER *OpCode;\r
+ //\r
+ // Question CurrentValue\r
+ //\r
+ EFI_HII_VALUE CurrentValue;\r
+ //\r
+ // Flag to describe whether setting is changed or not.\r
+ // Displayer may depend on it to show it with the different color.\r
+ //\r
+ BOOLEAN SettingChangedFlag;\r
+ //\r
+ // nested Statement list inside of EFI_IFR_SUBTITLE\r
+ //\r
+ LIST_ENTRY NestStatementList;\r
+ //\r
+ // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r
+ //\r
+ LIST_ENTRY OptionListHead;\r
+ //\r
+ // Statement attributes: GRAYOUT, LOCK and READONLY\r
+ //\r
+ UINT32 Attribute;\r
+\r
+ //\r
+ // ValidateQuestion to do InconsistIf check\r
+ // It may be NULL if any value is valid.\r
+ //\r
+ VALIDATE_QUESTION ValidateQuestion;\r
+\r
+ //\r
+ // Password additional check. It may be NULL when the additional check is not required.\r
+ //\r
+ PASSWORD_CHECK PasswordCheck;\r
+\r
+ //\r
+ // Statement ImageId and AnimationId\r
+ //\r
+ EFI_IMAGE_ID ImageId;\r
EFI_ANIMATION_ID AnimationId;\r
};\r
\r
#define FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK(a) CR (a, FORM_DISPLAY_ENGINE_STATEMENT, DisplayLink, FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE)\r
\r
+#define BROWSER_HOT_KEY_SIGNATURE SIGNATURE_32 ('B', 'H', 'K', 'S')\r
+\r
typedef struct {\r
- UINTN Signature;\r
- LIST_ENTRY Link;\r
- EFI_INPUT_KEY KeyData;\r
- UINT32 Action; // Action is Discard, Default, Submit, Reset and Exit.\r
+ UINTN Signature;\r
+ LIST_ENTRY Link;\r
+\r
+ EFI_INPUT_KEY *KeyData;\r
+ //\r
+ // Action is Discard, Default, Submit, Reset and Exit.\r
+ //\r
+ UINT32 Action;\r
UINT16 DefaultId;\r
- EFI_STRING HelpString; // HotKey Help String\r
-} HOTKEY_INFO;\r
+ //\r
+ // HotKey Help String\r
+ //\r
+ EFI_STRING HelpString;\r
+} BROWSER_HOT_KEY;\r
+\r
+#define BROWSER_HOT_KEY_FROM_LINK(a) CR (a, BROWSER_HOT_KEY, Link, BROWSER_HOT_KEY_SIGNATURE)\r
+\r
+#define FORM_DISPLAY_ENGINE_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r
+\r
+struct _FORM_DISPLAY_ENGINE_FORM {\r
+ UINTN Signature;\r
+ //\r
+ // Version for future structure extension\r
+ //\r
+ UINTN Version;\r
+ //\r
+ // Statement List inside of Form\r
+ //\r
+ LIST_ENTRY StatementListHead;\r
+ //\r
+ // Statement List outside of Form\r
+ //\r
+ LIST_ENTRY StatementListOSF;\r
+ //\r
+ // The input screen dimenstions info.\r
+ //\r
+ EFI_SCREEN_DESCRIPTOR *ScreenDimensions;\r
+ //\r
+ // FormSet information\r
+ //\r
+ EFI_GUID FormSetGuid;\r
+ //\r
+ // HiiHandle can be used to get String, Image or Animation\r
+ //\r
+ EFI_HII_HANDLE HiiHandle;\r
+\r
+ //\r
+ // Form ID and Title.\r
+ //\r
+ UINT16 FormId;\r
+ EFI_STRING_ID FormTitle;\r
+ //\r
+ // Form Attributes: Lock, Modal.\r
+ //\r
+ UINT32 Attribute;\r
+ //\r
+ // Flag to describe whether setting is changed or not.\r
+ // Displayer depends on it to show ChangedFlag.\r
+ //\r
+ BOOLEAN SettingChangedFlag;\r
+\r
+ //\r
+ // Statement to be HighLighted\r
+ //\r
+ FORM_DISPLAY_ENGINE_STATEMENT *HighLightedStatement;\r
+ //\r
+ // Event to notify Displayer that FormData is updated to be refreshed.\r
+ //\r
+ EFI_EVENT FormRefreshEvent;\r
+ //\r
+ // Additional Hotkey registered by BrowserEx protocol.\r
+ //\r
+ LIST_ENTRY HotKeyListHead;\r
+\r
+ //\r
+ // Form ImageId and AnimationId\r
+ //\r
+ EFI_IMAGE_ID ImageId;\r
+ EFI_ANIMATION_ID AnimationId;\r
+\r
+ //\r
+ // If Status is error, display needs to handle it.\r
+ //\r
+ UINT32 BrowserStatus;\r
+ //\r
+ // String for error status. It may be NULL.\r
+ //\r
+ EFI_STRING ErrorString;\r
+};\r
+\r
+#define FORM_DISPLAY_ENGINE_FORM_FROM_LINK(a) CR (a, FORM_DISPLAY_ENGINE_FORM, Link, FORM_DISPLAY_ENGINE_FORM_SIGNATURE)\r
\r
typedef struct {\r
FORM_DISPLAY_ENGINE_STATEMENT *SelectedStatement; // Selected Statement and InputValue\r
+\r
EFI_HII_VALUE InputValue;\r
+\r
UINT32 Action; // If SelectedStatement is NULL, Action will be used.\r
// Trig Action (Discard, Default, Submit, Reset and Exit)\r
UINT16 DefaultId;\r
\r
/**\r
Display one form, and return user input.\r
- \r
+\r
@param FormData Form Data to be shown.\r
@param UserInputData User input data.\r
- \r
+\r
@retval EFI_SUCCESS Form Data is shown, and user input is got.\r
**/\r
typedef\r
);\r
\r
/**\r
- Confirm how to handle the changed data. \r
- \r
+ Confirm how to handle the changed data.\r
+\r
@return Action of Submit, Discard and None\r
**/\r
typedef\r
VOID\r
);\r
\r
-struct _FORM_DISPLAY_ENGINE_PROTOCOL {\r
+typedef struct {\r
FORM_DISPLAY FormDisplay;\r
EXIT_DISPLAY ExitDisplay;\r
CONFIRM_DATA_CHANGE ConfirmDataChange;\r
-};\r
+} EDKII_FORM_DISPLAY_ENGINE_PROTOCOL;\r
\r
-extern EFI_GUID gEfiFormDisplayEngineProtocolGuid;\r
+extern EFI_GUID gEdkiiFormDisplayEngineProtocolGuid;\r
#endif\r