use modern construct 'override' in the derive class.
[platform/core/uifw/dali-core.git] / dali / integration-api / events / key-event-integ.h
old mode 100644 (file)
new mode 100755 (executable)
index 536d3ef..31a8dfd
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTEGRATION_KEY_EVENT_H__
-#define __DALI_INTEGRATION_KEY_EVENT_H__
+#ifndef DALI_INTEGRATION_KEY_EVENT_H
+#define DALI_INTEGRATION_KEY_EVENT_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,9 +24,8 @@
 // INTERNAL INCLUDES
 #include <dali/integration-api/events/event.h>
 #include <dali/public-api/events/key-event.h>
-#include <dali/devel-api/events/key-event-devel.h>
 
-namespace Dali DALI_IMPORT_API
+namespace Dali
 {
 
 namespace Integration
@@ -37,16 +36,14 @@ namespace Integration
  * the Dali core.
  *
  */
-struct KeyEvent : public Event
+struct DALI_CORE_API KeyEvent : public Event
 {
   // Enumerations
   // Specifies the state of the key event.
   enum State
   {
-    Down,        /**< Key down */
-    Up,          /**< Key up */
-
-    Last
+    DOWN,        /**< Key down */
+    UP,          /**< Key up */
   };
 
   /**
@@ -56,60 +53,64 @@ struct KeyEvent : public Event
 
   /**
    * Constructor
-   * @param[in]  keyName       The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
-   * @param[in]  keyString     A string of input characters or key pressed
-   * @param[in]  keyCode       The unique key code for the key pressed.
-   * @param[in]  keyModifier   The key modifier for special keys like shift and alt
-   * @param[in]  timeStamp     The time (in ms) that the key event occurred.
-   * @param[in]  keyState      The state of the key event.
-   * @param[in]  deviceName    Name of device KeyEvent originated from
-   * @param[in]  deviceClass   Class of device KeyEvent originated from
+   * @param[in]  keyName         The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
+   * @param[in]  logicalKey      The logical key symbol (eg. shift + 1 == "exclamation")
+   * @param[in]  keyString       The string of input characters or key pressed
+   * @param[in]  keyCode         The unique key code for the key pressed.
+   * @param[in]  keyModifier     The key modifier for special keys like shift and alt
+   * @param[in]  timeStamp       The time (in ms) that the key event occurred.
+   * @param[in]  keyState        The state of the key event.
+   * @param[in]  compose         The key compose
+   * @param[in]  deviceName      The name of device KeyEvent originated from
+   * @param[in]  deviceClass     The class of device KeyEvent originated from
+   * @param[in]  deviceSubclass  The subclass of device KeyEvent originated from
    */
   KeyEvent(const std::string& keyName,
+           const std::string& logicalKey,
            const std::string& keyString,
            int keyCode,
            int keyModifier,
            unsigned long timeStamp,
            const State& keyState,
-           const std::string deviceName,
-           const DevelDevice::Class::Type deviceClass,
-           const DevelDevice::Subclass::Type deviceSubclass );
-
-  /*
-   * Constructor, creates a Integration::KeyEvent from a Dali::KeyEvent
-   * @param[in] event Dali::KeyEvent to convert from
-   */
-  explicit KeyEvent( const Dali::KeyEvent& event );
+           const std::string& compose,
+           const std::string& deviceName,
+           const Device::Class::Type deviceClass,
+           const Device::Subclass::Type deviceSubclass );
 
   /**
    * Virtual destructor
    */
-  virtual ~KeyEvent();
+  ~KeyEvent() override;
 
   // Data
 
   /**
-   *@copydoc Dali::KeyEvent::keyPressedName
+   * The name of the key pressed or command from the IMF
    */
   std::string keyName;
 
   /**
-   *@copydoc Dali::KeyEvent::keyPressed
+   * The logical key symbol
+   */
+  std::string logicalKey;
+
+  /**
+   * The string of input characters or key pressed
    */
   std::string keyString;
 
   /**
-   * @copydoc Dali::KeyEvent::keyCode
+   * The unique key code for the key pressed.
    */
   int  keyCode;
 
   /**
-   *@copydoc Dali::KeyEvent::keyModifier
+   * The key modifier for special keys like shift and alt
    */
   int  keyModifier;
 
   /**
-   *@copydoc Dali::KeyEvent::time
+   * The time (in ms) that the key event occurred.
    */
   unsigned long time;
 
@@ -120,23 +121,28 @@ struct KeyEvent : public Event
   State state;
 
   /**
-   * Name of device KeyEvent originated from
+   * If this keystroke has modified a string in the middle of being composed - this string replaces the previous one.
+   */
+  std::string compose;
+
+  /**
+   * The name of device KeyEvent originated from
    */
   std::string deviceName;
 
   /**
-   * Class of device KeyEvent originated from
+   * The class of device KeyEvent originated from
    */
-  DevelDevice::Class::Type deviceClass;
+  Device::Class::Type deviceClass;
 
   /**
-   * Subclass of device KeyEvent originated from
+   * The subclass of device KeyEvent originated from
    */
-  DevelDevice::Subclass::Type deviceSubclass;
+  Device::Subclass::Type deviceSubclass;
 };
 
 } // namespace Integration
 
 } // namespace Dali
 
-#endif // __DALI_INTEGRATION_KEY_EVENT_H__
+#endif // DALI_INTEGRATION_KEY_EVENT_H