]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/SimpleTextInEx.h
MdePkg/SimpleTextInEx.h: Fix comments alignment
[mirror_edk2.git] / MdePkg / Include / Protocol / SimpleTextInEx.h
index ab09be1a7231b10dd7736a532b8022a075ad0c29..ffc11c601e1304e3ee283d4675a4a633dc4bd571 100644 (file)
@@ -1,23 +1,26 @@
 /** @file\r
-  The file defines the protocol to obtain input from the\r
-  ConsoleIn device. The EFI specification requires that the\r
-  EFI_SIMPLE_TEXT_INPUT_PROTOCOL supports the same languages as\r
-  the corresponding\r
+  Simple Text Input Ex protocol from the UEFI 2.0 specification.\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
+  This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r
+  which exposes much more state and modifier information from the input device,\r
+  also allows one to register a notification for a particular keystroke.\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) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  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
 \r
 **/\r
 \r
 #ifndef __SIMPLE_TEXT_IN_EX_H__\r
 #define __SIMPLE_TEXT_IN_EX_H__\r
 \r
+#include <Protocol/SimpleTextIn.h>\r
+\r
 #define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \\r
   {0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } }\r
 \r
@@ -35,9 +38,7 @@ typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTO
   this specification and is left up to the platform firmware or\r
   driver to implement.\r
 \r
-  @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX\r
-              instance. Type EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX\r
-              is defined in this section.\r
+  @param This                 A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.\r
 \r
   @param ExtendedVerification Indicates that the driver may\r
                               perform a more exhaustive\r
@@ -45,87 +46,117 @@ typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTO
                               device during reset.\r
 \r
 \r
-  @retval EFI_SUCCESS The device was reset.\r
-  \r
+  @retval EFI_SUCCESS       The device was reset.\r
+\r
   @retval EFI_DEVICE_ERROR  The device is not functioning\r
                             correctly and could not be reset.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_INPUT_RESET_EX) (\r
-  IN CONST  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
-  IN CONST  BOOLEAN                           ExtendedVerification\r
+(EFIAPI *EFI_INPUT_RESET_EX)(\r
+  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
+  IN BOOLEAN                           ExtendedVerification\r
 );\r
 \r
 \r
-//\r
-// EFI_KEY_TOGGLE_STATE\r
-//\r
-typedef UINT8   EFI_KEY_TOGGLE_STATE;\r
-#define TOGGLE_STATE_VALID    0x80\r
-#define SCROLL_LOCK_ACTIVE    0x01\r
-#define NUM_LOCK_ACTIVE       0x02\r
-#define CAPS_LOCK_ACTIVE      0x04\r
-\r
-/**\r
-  Definition of EFI_KEY_STATE\r
+///\r
+/// EFI_KEY_TOGGLE_STATE. The toggle states are defined.\r
+/// They are: EFI_TOGGLE_STATE_VALID, EFI_SCROLL_LOCK_ACTIVE\r
+/// EFI_NUM_LOCK_ACTIVE, EFI_CAPS_LOCK_ACTIVE\r
+///\r
+typedef UINT8 EFI_KEY_TOGGLE_STATE;\r
 \r
-  @param KeyShiftState  Reflects the currently pressed shift\r
-                        modifiers for the input device. The\r
-                        returned value is valid only if the high\r
-                        order bit has been set.\r
-\r
-  @param KeyToggleState Reflects the current internal state of\r
-                        various toggled attributes. The returned\r
-                        value is valid only if the high order\r
-                        bit has been set.\r
-\r
-**/\r
 typedef struct _EFI_KEY_STATE {\r
+  ///\r
+  /// Reflects the currently pressed shift\r
+  /// modifiers for the input device. The\r
+  /// returned value is valid only if the high\r
+  /// order bit has been set.\r
+  ///\r
   UINT32                KeyShiftState;\r
+  ///\r
+  /// Reflects the current internal state of\r
+  /// various toggled attributes. The returned\r
+  /// value is valid only if the high order\r
+  /// bit has been set.\r
+  ///\r
   EFI_KEY_TOGGLE_STATE  KeyToggleState;\r
 } EFI_KEY_STATE;\r
 \r
-/**\r
-  Definition of EFI_KEY_DATA.\r
-\r
-  @param Key  The EFI scan code and Unicode value returned from\r
-              the input device.\r
-\r
-  @param KeyState The current state of various toggled\r
-                  attributes as well as input modifier values.\r
-\r
-**/\r
 typedef struct {\r
+  ///\r
+  /// The EFI scan code and Unicode value returned from the input device.\r
+  ///\r
   EFI_INPUT_KEY   Key;\r
+  ///\r
+  /// The current state of various toggled attributes as well as input modifier values.\r
+  ///\r
   EFI_KEY_STATE   KeyState;\r
 } EFI_KEY_DATA;\r
 \r
-//\r
-// Shift State.\r
 //\r
 // Any Shift or Toggle State that is valid should have\r
 // high order bit set.\r
 //\r
-#define SHIFT_STATE_VALID     0x80000000\r
-#define RIGHT_SHIFT_PRESSED   0x00000001\r
-#define LEFT_SHIFT_PRESSED    0x00000002\r
-#define RIGHT_CONTROL_PRESSED 0x00000004\r
-#define LEFT_CONTROL_PRESSED  0x00000008\r
-#define RIGHT_ALT_PRESSED     0x00000010\r
-#define LEFT_ALT_PRESSED      0x00000020\r
-#define RIGHT_LOGO_PRESSED    0x00000040\r
-#define LEFT_LOGO_PRESSED     0x00000080\r
-#define MENU_KEY_PRESSED      0x00000100\r
-#define SYS_REQ_PRESSED       0x00000200\r
+// Shift state\r
+//\r
+#define EFI_SHIFT_STATE_VALID     0x80000000\r
+#define EFI_RIGHT_SHIFT_PRESSED   0x00000001\r
+#define EFI_LEFT_SHIFT_PRESSED    0x00000002\r
+#define EFI_RIGHT_CONTROL_PRESSED 0x00000004\r
+#define EFI_LEFT_CONTROL_PRESSED  0x00000008\r
+#define EFI_RIGHT_ALT_PRESSED     0x00000010\r
+#define EFI_LEFT_ALT_PRESSED      0x00000020\r
+#define EFI_RIGHT_LOGO_PRESSED    0x00000040\r
+#define EFI_LEFT_LOGO_PRESSED     0x00000080\r
+#define EFI_MENU_KEY_PRESSED      0x00000100\r
+#define EFI_SYS_REQ_PRESSED       0x00000200\r
+\r
+//\r
+// Toggle state\r
+//\r
+#define EFI_TOGGLE_STATE_VALID    0x80\r
+#define EFI_KEY_STATE_EXPOSED     0x40\r
+#define EFI_SCROLL_LOCK_ACTIVE    0x01\r
+#define EFI_NUM_LOCK_ACTIVE       0x02\r
+#define EFI_CAPS_LOCK_ACTIVE      0x04\r
+\r
+//\r
+// EFI Scan codes\r
+//\r
+#define SCAN_F11                  0x0015\r
+#define SCAN_F12                  0x0016\r
+#define SCAN_PAUSE                0x0048\r
+#define SCAN_F13                  0x0068\r
+#define SCAN_F14                  0x0069\r
+#define SCAN_F15                  0x006A\r
+#define SCAN_F16                  0x006B\r
+#define SCAN_F17                  0x006C\r
+#define SCAN_F18                  0x006D\r
+#define SCAN_F19                  0x006E\r
+#define SCAN_F20                  0x006F\r
+#define SCAN_F21                  0x0070\r
+#define SCAN_F22                  0x0071\r
+#define SCAN_F23                  0x0072\r
+#define SCAN_F24                  0x0073\r
+#define SCAN_MUTE                 0x007F\r
+#define SCAN_VOLUME_UP            0x0080\r
+#define SCAN_VOLUME_DOWN          0x0081\r
+#define SCAN_BRIGHTNESS_UP        0x0100\r
+#define SCAN_BRIGHTNESS_DOWN      0x0101\r
+#define SCAN_SUSPEND              0x0102\r
+#define SCAN_HIBERNATE            0x0103\r
+#define SCAN_TOGGLE_DISPLAY       0x0104\r
+#define SCAN_RECOVERY             0x0105\r
+#define SCAN_EJECT                0x0106\r
 \r
 /**\r
   The function reads the next keystroke from the input device. If\r
   there is no pending keystroke the function returns\r
   EFI_NOT_READY. If there is a pending keystroke, then\r
   KeyData.Key.ScanCode is the EFI scan code defined in Error!\r
-  Reference source not found.. The KeyData.Key.UnicodeChar is the\r
+  Reference source not found. The KeyData.Key.UnicodeChar is the\r
   actual printable character or is zero if the key does not\r
   represent a printable character (control key, function key,\r
   etc.). The KeyData.KeyState is shift state for the character\r
@@ -151,45 +182,39 @@ typedef struct {
   state information, and in those cases the high order bit in the\r
   respective Toggle and Shift state fields should not be active.\r
 \r
-  \r
-  @param This   A pointer to the\r
-                EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX instance.\r
+\r
+  @param This     A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.\r
 \r
   @param KeyData  A pointer to a buffer that is filled in with\r
                   the keystroke state data for the key that was\r
                   pressed.\r
 \r
-  \r
-  @retval EFI_SUCCESS     The keystroke information was\r
-                          returned.\r
-  \r
-  @retval EFI_NOT_READY   There was no keystroke data available.\r
-                          EFI_DEVICE_ERROR The keystroke\r
-                          information was not returned due to\r
-                          hardware errors.\r
+\r
+  @retval EFI_SUCCESS      The keystroke information was returned.\r
+  @retval EFI_NOT_READY    There was no keystroke data available.\r
+  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to\r
+                           hardware errors.\r
 \r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_INPUT_READ_KEY_EX) (\r
-  IN CONST  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
-  OUT       EFI_KEY_DATA                      *KeyData\r
+(EFIAPI *EFI_INPUT_READ_KEY_EX)(\r
+  IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
+  OUT EFI_KEY_DATA                      *KeyData\r
 );\r
 \r
 /**\r
   The SetState() function allows the input device hardware to\r
   have state settings adjusted.\r
-  \r
-  @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX\r
-              instance. Type EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX\r
-              is defined in this section.\r
-  \r
+\r
+  @param This           A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.\r
+\r
   @param KeyToggleState Pointer to the EFI_KEY_TOGGLE_STATE to\r
                         set the state for the input device.\r
-  \r
-  \r
-  @retval EFI_SUCCESS The device state was set appropriately.\r
+\r
+\r
+  @retval EFI_SUCCESS       The device state was set appropriately.\r
 \r
   @retval EFI_DEVICE_ERROR  The device is not functioning\r
                             correctly and could not have the\r
@@ -201,42 +226,41 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_SET_STATE) (\r
-  IN CONST  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
-  IN CONST  EFI_KEY_TOGGLE_STATE              *KeyToggleState\r
+(EFIAPI *EFI_SET_STATE)(\r
+  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
+  IN EFI_KEY_TOGGLE_STATE              *KeyToggleState\r
 );\r
 \r
-//\r
-// EFI_KEY_NOTIFY\r
-//\r
+///\r
+/// The function will be called when the key sequence is typed specified by KeyData.\r
+///\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) (\r
-  IN CONST  EFI_KEY_DATA *KeyData\r
+(EFIAPI *EFI_KEY_NOTIFY_FUNCTION)(\r
+  IN EFI_KEY_DATA *KeyData\r
 );\r
 \r
 /**\r
   The RegisterKeystrokeNotify() function registers a function\r
   which will be called when a specified keystroke will occur.\r
-  \r
-  @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX\r
-              instance. Type EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX\r
-              is defined in this section.\r
-  \r
-  @param KeyData  A pointer to a buffer that is filled in with\r
-                  the keystroke information for the key that was\r
-                  pressed.\r
-  \r
-  @param KeyNotificationFunction  Points to the function to be\r
-                                  called when the key sequence\r
-                                  is typed specified by KeyData.\r
-  \r
-  \r
-  @param NotifyHandle Points to the unique handle assigned to\r
-                      the registered notification.\r
-  \r
-  @retval EFI_SUCCESS           The device state was set\r
-                                appropriately.\r
+\r
+  @param This                     A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.\r
+\r
+  @param KeyData                  A pointer to a buffer that is filled in with\r
+                                  the keystroke information for the key that was\r
+                                  pressed. If KeyData.Key, KeyData.KeyState.KeyToggleState\r
+                                  and KeyData.KeyState.KeyShiftState are 0, then any incomplete\r
+                                  keystroke will trigger a notification of the KeyNotificationFunction.\r
+\r
+  @param KeyNotificationFunction  Points to the function to be called when the key sequence\r
+                                  is typed specified by KeyData. This notification function\r
+                                  should be called at <=TPL_CALLBACK.\r
+\r
+\r
+  @param NotifyHandle             Points to the unique handle assigned to\r
+                                  the registered notification.\r
+\r
+  @retval EFI_SUCCESS           Key notify was registered successfully.\r
 \r
   @retval EFI_OUT_OF_RESOURCES  Unable to allocate necessary\r
                                 data structures.\r
@@ -244,65 +268,48 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) (\r
-  IN CONST  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
-  IN CONST  EFI_KEY_DATA            *KeyData,\r
-  IN CONST  EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r
-  OUT       EFI_HANDLE              *NotifyHandle\r
+(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)(\r
+  IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
+  IN  EFI_KEY_DATA                      *KeyData,\r
+  IN  EFI_KEY_NOTIFY_FUNCTION           KeyNotificationFunction,\r
+  OUT VOID                              **NotifyHandle\r
 );\r
 \r
 /**\r
   The UnregisterKeystrokeNotify() function removes the\r
   notification which was previously registered.\r
-  \r
-  @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX\r
-              instance.\r
-  \r
+\r
+  @param This               A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.\r
+\r
   @param NotificationHandle The handle of the notification\r
                             function being unregistered.\r
-  \r
-  @retval EFI_SUCCESS The device state was set appropriately.\r
-  \r
+\r
+  @retval EFI_SUCCESS           Key notify was unregistered successfully.\r
+\r
   @retval EFI_INVALID_PARAMETER The NotificationHandle is\r
                                 invalid.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) (\r
-IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
-IN EFI_HANDLE NotificationHandle\r
+(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)(\r
+  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
+  IN VOID                               *NotificationHandle\r
 );\r
 \r
 \r
-/**\r
-  The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn\r
-  device. It is an extension to the Simple Text Input protocol\r
-  which allows a variety of extended shift state information to be\r
-  returned.\r
-\r
-  @param Reset  Reset the ConsoleIn device. See Reset().\r
-\r
-  @param ReadKeyStrokeEx  Returns the next input character. See\r
-                          ReadKeyStrokeEx().\r
-\r
-  @param WaitForKeyEx   Event to use with WaitForEvent() to wait\r
-                        for a key to be available.\r
-\r
-  @param SetState   Set the EFI_KEY_TOGGLE_STATE state settings\r
-                    for the input device.\r
-\r
-  @param RegisterKeyNotify  Register a notification function to\r
-                            be called when a given key sequence\r
-                            is hit.\r
-\r
-  @param UnregisterKeyNotifyRemoves   A specific notification\r
-                                      function.\r
-\r
-**/\r
+///\r
+/// The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn\r
+/// device. It is an extension to the Simple Text Input protocol\r
+/// which allows a variety of extended shift state information to be\r
+/// returned.\r
+///\r
 struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL{\r
   EFI_INPUT_RESET_EX              Reset;\r
   EFI_INPUT_READ_KEY_EX           ReadKeyStrokeEx;\r
+  ///\r
+  /// Event to use with WaitForEvent() to wait for a key to be available.\r
+  ///\r
   EFI_EVENT                       WaitForKeyEx;\r
   EFI_SET_STATE                   SetState;\r
   EFI_REGISTER_KEYSTROKE_NOTIFY   RegisterKeyNotify;\r