[Tizen] Adding deviceClass to KeyEvent Integ
[platform/core/uifw/dali-core.git] / dali / integration-api / events / key-event-integ.h
index db544df..d98970d 100644 (file)
@@ -1,27 +1,30 @@
 #ifndef __DALI_INTEGRATION_KEY_EVENT_H__
 #define __DALI_INTEGRATION_KEY_EVENT_H__
 
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // EXTERNAL INCLUDES
 #include <string>
 
 // 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
 {
@@ -57,15 +60,25 @@ struct KeyEvent : public Event
    * @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]  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
    */
   KeyEvent(const std::string& keyName,
            const std::string& keyString,
            int keyCode,
            int keyModifier,
            unsigned long timeStamp,
-           const State& keyState);
+           const State& keyState,
+           const std::string deviceName,
+           const DevelKeyEvent::DeviceClass::Type deviceClass );
+
+  /*
+   * Constructor, creates a Integration::KeyEvent from a Dali::KeyEvent
+   * @param[in] event Dali::KeyEvent to convert from
+   */
+  explicit KeyEvent( const Dali::KeyEvent& event );
 
   /**
    * Virtual destructor
@@ -105,6 +118,15 @@ struct KeyEvent : public Event
    */
   State state;
 
+  /**
+   * Name of device KeyEvent originated from
+   */
+  std::string deviceName;
+
+  /**
+   * Class of device KeyEvent originated from
+   */
+  DevelKeyEvent::DeviceClass::Type deviceClass;
 };
 
 } // namespace Integration