[InputDevice] Renaming InputDevice module.
authorLukasz Foniok <l.foniok@samsung.com>
Tue, 12 May 2015 13:10:08 +0000 (15:10 +0200)
committerpius.lee <pius.lee@samsung.com>
Tue, 30 Jun 2015 04:27:33 +0000 (13:27 +0900)
[Verification]
Module input device is now Common module, because of that it is available under tizen.inputdevice

Change-Id: I017c98d10c7414bf57c3254ca7b36b01098c7e62
Signed-off-by: Lukasz Foniok <l.foniok@samsung.com>
12 files changed:
packaging/webapi-plugins.spec
src/inputdevice/inputdevice.gyp [new file with mode: 0644]
src/inputdevice/inputdevice_api.js [new file with mode: 0644]
src/inputdevice/inputdevice_extension.cc [new file with mode: 0644]
src/inputdevice/inputdevice_extension.h [new file with mode: 0644]
src/inputdevice/inputdevice_instance.cc [new file with mode: 0644]
src/inputdevice/inputdevice_instance.h [new file with mode: 0644]
src/inputdevice/inputdevice_key.cc [new file with mode: 0644]
src/inputdevice/inputdevice_key.h [new file with mode: 0644]
src/inputdevice/inputdevice_manager.cc [new file with mode: 0755]
src/inputdevice/inputdevice_manager.h [new file with mode: 0755]
src/tizen-wrt.gyp

index 8fc5bd07212921c0e86f1a012a042d80be8d20c5..bd64c13e36c7e3b7bb4b64a8b7e98db71888095d 100755 (executable)
@@ -110,6 +110,7 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_feature_tvchannel_support           0
 %define tizen_feature_tv_display_support          0
 %define tizen_feature_tvinputdevice_support       0
+%define tizen_feature_inputdevice_support         0
 %define tizen_feature_tvwindow_support            0
 
 %if 0%{?tizen_feature_telephony_support}
@@ -205,6 +206,7 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_feature_tvchannel_support           0
 %define tizen_feature_tv_display_support          0
 %define tizen_feature_tvinputdevice_support       0
+%define tizen_feature_inputdevice_support         0
 %define tizen_feature_tvwindow_support            0
 
 #- telephony related APIs
@@ -273,7 +275,8 @@ Source0:    %{name}-%{version}.tar.gz
 #off for tizen 3.0 (no systeminfo definitions)
 %define tizen_feature_tv_display_support          0
 %define tizen_feature_tvinputdevice_support       1
-%define tizen_feature_tvwindow_support            0
+%define tizen_feature_inputdevice_support         1
+%define tizen_feature_tvwindow_support            1
 
 %endif # tizen_profile_tv
 
@@ -512,6 +515,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvaudio_support=%{?tizen_feature_tvaud
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvchannel_support=%{?tizen_feature_tvchannel_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tv_display_support=%{?tizen_feature_tv_display_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_feature_tvinputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_feature_inputdevice_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvwindow_support=%{?tizen_feature_tvwindow_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_feature_web_setting_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_feature_wi_fi_support}"
diff --git a/src/inputdevice/inputdevice.gyp b/src/inputdevice/inputdevice.gyp
new file mode 100644 (file)
index 0000000..8d5a994
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  'includes':[
+    '../common/common.gypi',
+  ],
+  'targets': [
+    {
+      'target_name': 'tizen_inputdevice',
+      'type': 'loadable_module',
+      'dependencies': [
+        '../common/common.gyp:tizen_common',
+      ],
+      'sources': [
+        'inputdevice_api.js',
+        'inputdevice_extension.cc',
+        'inputdevice_extension.h',
+        'inputdevice_instance.cc',
+        'inputdevice_instance.h',
+        'inputdevice_key.cc',
+        'inputdevice_key.h',
+        'inputdevice_manager.cc',
+        'inputdevice_manager.h'
+      ],
+      'includes': [
+        '../common/pkg-config.gypi',
+      ],
+      'conditions': [
+        ['tizen == 1', {
+          'variables': {
+            'packages': [
+            ]
+          },
+        }],
+      ],
+    },
+  ],
+}
diff --git a/src/inputdevice/inputdevice_api.js b/src/inputdevice/inputdevice_api.js
new file mode 100644 (file)
index 0000000..ba75bbd
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+var native = new xwalk.utils.NativeManager(extension);
+var validator = xwalk.utils.validator;
+var types = validator.Types;
+
+
+function InputDeviceKey(dict) {
+  for (var key in dict) {
+    if (dict.hasOwnProperty(key)) {
+      Object.defineProperty(this, key, {
+        value: dict[key],
+        enumerable: true
+      });
+    }
+  }
+  Object.freeze(this);
+}
+
+
+function dictListToInputDeviceKeyList(list) {
+  var result = [], listLength = list.length;
+  for (var i = 0; i < listLength; ++i) {
+    result.push(new InputDeviceKey(list[i]));
+  }
+  return result;
+}
+
+
+
+/**
+ * This class provides access to the API functionalities through the tizen.tvinputdevice interface.
+ * @constructor
+ */
+function InputDeviceManager() {
+  if (!(this instanceof InputDeviceManager)) {
+    throw new TypeError;
+  }
+}
+
+
+/**
+ * Retrieves the list of keys can be registered with the registerKey() method.
+ * @return {array} Array of keys
+ */
+InputDeviceManager.prototype.getSupportedKeys = function() {
+  var ret = native.callSync('InputDeviceManager_getSupportedKeys');
+  if (native.isFailure(ret)) {
+    throw native.getErrorObject(ret);
+  }
+  return dictListToInputDeviceKeyList(native.getResultObject(ret));
+};
+
+
+/**
+ * Returns information about the key which has the given name.
+ * @param {!string} keyName  The key name
+ * @return {object} Key object
+ */
+InputDeviceManager.prototype.getKey = function(keyName) {
+  var args = validator.validateArgs(arguments, [
+    {name: 'keyName', type: types.STRING}
+  ]);
+
+  var ret = native.callSync('InputDeviceManager_getKey', {
+    keyName: args.keyName
+  });
+
+  if (native.isFailure(ret)) {
+    throw native.getErrorObject(ret);
+  }
+  return native.getResultObject(ret);
+};
+
+
+/**
+ * Registers an input device key to receive DOM keyboard event when it is pressed or released.
+ * @param {!string} keyName  The key name
+ */
+InputDeviceManager.prototype.registerKey = function(keyName) {
+  var args = validator.validateArgs(arguments, [
+    {name: 'keyName', type: types.STRING}
+  ]);
+
+  var ret = native.callSync('InputDeviceManager_registerKey', {
+    keyName: args.keyName
+  });
+
+  if (native.isFailure(ret)) {
+    throw native.getErrorObject(ret);
+  }
+};
+
+
+/**
+ * Unregisters an input device key.
+ * @param {!string} keyName  The key name
+ */
+InputDeviceManager.prototype.unregisterKey = function(keyName) {
+  var args = validator.validateArgs(arguments, [
+    {name: 'keyName', type: types.STRING}
+  ]);
+
+  var ret = native.callSync('InputDeviceManager_unregisterKey', {
+    keyName: args.keyName
+  });
+
+  if (native.isFailure(ret)) {
+    throw native.getErrorObject(ret);
+  }
+};
+
+
+// Exports
+exports = new InputDeviceManager();
diff --git a/src/inputdevice/inputdevice_extension.cc b/src/inputdevice/inputdevice_extension.cc
new file mode 100644 (file)
index 0000000..f078dbe
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "../inputdevice/inputdevice_extension.h"
+
+#include "../inputdevice/inputdevice_instance.h"
+
+// This will be generated from inputdevice_api.js
+extern const char kSource_inputdevice_api[];
+
+namespace extension {
+namespace inputdevice {
+
+InputDeviceExtension::InputDeviceExtension() {
+    SetExtensionName("tizen.inputdevice");
+    SetJavaScriptAPI(kSource_inputdevice_api);
+}
+
+InputDeviceExtension::~InputDeviceExtension() {}
+
+InputDeviceManager& InputDeviceExtension::manager() {
+    // Initialize API on first request
+    return InputDeviceManager::getInstance();
+}
+
+common::Instance* InputDeviceExtension::CreateInstance() {
+    return new InputDeviceInstance;
+}
+
+}  // namespace inputdevice
+}  // namespace extension
+
+common::Extension* CreateExtension() {
+    return new extension::inputdevice::InputDeviceExtension;
+}
diff --git a/src/inputdevice/inputdevice_extension.h b/src/inputdevice/inputdevice_extension.h
new file mode 100644 (file)
index 0000000..0b07f28
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_INPUTDEVICE_INPUTDEVICE_EXTENSION_H_
+#define SRC_INPUTDEVICE_INPUTDEVICE_EXTENSION_H_
+
+#include "../inputdevice/inputdevice_manager.h"
+#include "common/extension.h"
+
+namespace extension {
+namespace inputdevice {
+
+class InputDeviceExtension : public common::Extension {
+ public:
+    InputDeviceExtension();
+    virtual ~InputDeviceExtension();
+
+    InputDeviceManager& manager();
+
+ private:
+    virtual common::Instance* CreateInstance();
+};
+
+}  // namespace inputdevice
+}  // namespace extension
+
+#endif  // SRC_INPUTDEVICE_INPUTDEVICE_EXTENSION_H_
+
diff --git a/src/inputdevice/inputdevice_instance.cc b/src/inputdevice/inputdevice_instance.cc
new file mode 100644 (file)
index 0000000..1d14422
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+#include <functional>
+#include <string>
+#include <vector>
+
+#include "../inputdevice/inputdevice_instance.h"
+#include "../inputdevice/inputdevice_manager.h"
+#include "common/logger.h"
+
+
+namespace extension {
+namespace inputdevice {
+
+InputDeviceInstance::InputDeviceInstance() {
+    LOGD("Enter");
+    using std::placeholders::_1;
+    using std::placeholders::_2;
+    #define REGISTER_SYNC(c, x) \
+    RegisterSyncHandler(c, std::bind(&InputDeviceInstance::x, this, _1, _2));
+    REGISTER_SYNC("TVInputDeviceManager_getSupportedKeys", getSupportedKeys);
+    REGISTER_SYNC("TVInputDeviceManager_getKey", getKey);
+    REGISTER_SYNC("TVInputDeviceManager_registerKey", registerKey);
+    REGISTER_SYNC("TVInputDeviceManager_unregisterKey", unregisterKey);
+    #undef REGISTER_SYNC
+}
+
+InputDeviceInstance::~InputDeviceInstance() {
+    LOGD("Enter");
+}
+
+picojson::value InputDeviceInstance::inputDeviceKeyToJson(
+        const InputDeviceKeyPtr keyPtr) {
+    LOGD("Enter");
+    picojson::value::object keyMap;
+    keyMap.insert(
+        std::make_pair("name",
+        picojson::value(keyPtr->getName())));
+    keyMap.insert(
+        std::make_pair("code",
+        picojson::value(static_cast<double>(keyPtr->getCode()))));
+    return picojson::value(keyMap);
+}
+
+void InputDeviceInstance::getSupportedKeys(const picojson::value& args,
+        picojson::object& out) {
+    LOGD("Enter");
+    std::vector<InputDeviceKeyPtr> inputDeviceKeys =
+            InputDeviceManager::getInstance().getSupportedKeys();
+    picojson::value::array picjsonValuesArray;
+    for (auto it = inputDeviceKeys.begin(); it != inputDeviceKeys.end(); ++it) {
+        picjsonValuesArray.push_back(inputDeviceKeyToJson(*it));
+    }
+    ReportSuccess(picojson::value(picjsonValuesArray), out);
+}
+
+void InputDeviceInstance::getKey(const picojson::value& args,
+        picojson::object& out) {
+    LOGD("Enter");
+    std::string keyName = args.get("keyName").get<std::string>();
+    InputDeviceKeyPtr keyPtr =
+            InputDeviceManager::getInstance().getKey(keyName);
+    ReportSuccess(inputDeviceKeyToJson(keyPtr), out);
+}
+
+void InputDeviceInstance::registerKey(const picojson::value& args,
+        picojson::object& out) {
+    LOGD("Enter");
+    std::string keyName = args.get("keyName").get<std::string>();
+    InputDeviceManager::getInstance().registerKey(keyName);
+    ReportSuccess(out);
+}
+
+void InputDeviceInstance::unregisterKey(const picojson::value& args,
+        picojson::object& out) {
+    LOGD("Enter");
+    std::string keyName = args.get("keyName").get<std::string>();
+    InputDeviceManager::getInstance().unregisterKey(keyName);
+    ReportSuccess(out);
+}
+
+}  // namespace inputdevice
+}  // namespace extension
diff --git a/src/inputdevice/inputdevice_instance.h b/src/inputdevice/inputdevice_instance.h
new file mode 100644 (file)
index 0000000..d8f12b4
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+
+#ifndef SRC_INPUTDEVICE_INPUTDEVICE_INSTANCE_H_
+#define SRC_INPUTDEVICE_INPUTDEVICE_INSTANCE_H_
+
+#include "../inputdevice/inputdevice_manager.h"
+#include "common/picojson.h"
+#include "common/extension.h"
+
+
+namespace extension {
+namespace inputdevice {
+
+class InputDeviceInstance : public common::ParsedInstance {
+ public:
+    InputDeviceInstance();
+    virtual ~InputDeviceInstance();
+
+ private:
+    picojson::value inputDeviceKeyToJson(const InputDeviceKeyPtr keyPtr);
+    void getSupportedKeys(const picojson::value& args, picojson::object& out);
+    void getKey(const picojson::value& args, picojson::object& out);
+    void registerKey(const picojson::value& args, picojson::object& out);
+    void unregisterKey(const picojson::value& args, picojson::object& out);
+};
+
+}  // namespace inputdevice
+}  // namespace extension
+
+#endif  // SRC_INPUTDEVICE_INPUTDEVICE_INSTANCE_H_
diff --git a/src/inputdevice/inputdevice_key.cc b/src/inputdevice/inputdevice_key.cc
new file mode 100644 (file)
index 0000000..0b4332d
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+
+#include "../inputdevice/inputdevice_key.h"
+#include "common/logger.h"
+#include "common/platform_exception.h"
+
+
+namespace extension {
+namespace inputdevice {
+
+InputDeviceKey::InputDeviceKey():
+    m_code(0), m_name("") {
+    LOGD("Enter");
+}
+
+InputDeviceKey::InputDeviceKey(std::string name, int32_t code):
+        m_name(name), m_code(code) {
+    LOGD("Key Name %s", m_name.c_str() );
+}
+
+InputDeviceKey::~InputDeviceKey() {
+    LOGD("Enter");
+}
+
+std::string InputDeviceKey::getName() const {
+    LOGD("Enter");
+    LOGD("Key Name %s", m_name.c_str() );
+    return m_name;
+}
+
+void InputDeviceKey::setName(std::string name) {
+    LOGD("Key Name %s", name.c_str() );
+    m_name = name;
+}
+
+int32_t InputDeviceKey::getCode() const {
+    return m_code;
+}
+
+void InputDeviceKey::setCode(int32_t code) {
+    m_code = code;
+}
+
+
+}  // namespace inputdevice
+}  // namespace extension
diff --git a/src/inputdevice/inputdevice_key.h b/src/inputdevice/inputdevice_key.h
new file mode 100644 (file)
index 0000000..e6111b3
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+
+#ifndef SRC_INPUTDEVICE_INPUTDEVICE_KEY_H_
+#define SRC_INPUTDEVICE_INPUTDEVICE_KEY_H_
+
+#include <sys/types.h>
+#include <string>
+#include <memory>
+
+namespace extension {
+namespace inputdevice {
+
+class InputDeviceKey {
+ public:
+    InputDeviceKey();
+
+    InputDeviceKey(std::string name, int32_t code);
+
+    virtual ~InputDeviceKey();
+
+    std::string getName() const;
+    void setName(std::string name);
+
+    int32_t getCode() const;
+    void setCode(int32_t code);
+
+ private:
+    std::string m_name;
+    int32_t m_code;
+};
+
+typedef std::shared_ptr<InputDeviceKey> InputDeviceKeyPtr;
+
+}  // namespace inputdevice
+}  // namespace extension
+
+#endif  // SRC_INPUTDEVICE_INPUTDEVICE_KEY_H_
diff --git a/src/inputdevice/inputdevice_manager.cc b/src/inputdevice/inputdevice_manager.cc
new file mode 100755 (executable)
index 0000000..74b18a0
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+
+#include "../inputdevice/inputdevice_manager.h"
+#include <sys/types.h>
+#include <algorithm>
+
+#include "common/logger.h"
+#include "common/platform_exception.h"
+
+
+namespace extension {
+namespace inputdevice {
+
+using common::UnknownException;
+using common::InvalidValuesException;
+
+InputDeviceManager::InputDeviceManager() {
+    LOGD("Enter");
+    setSupportedKeys();
+}
+
+InputDeviceManager::~InputDeviceManager() {
+    LOGD("Enter");
+    cleanSupportedKeys();
+}
+
+InputDeviceManager& InputDeviceManager::getInstance() {
+    LOGD("Enter");
+    static InputDeviceManager instance;
+    return instance;
+}
+
+void InputDeviceManager::cleanSupportedKeys() {
+    LOGD("Enter");
+    m_availableKeys.clear();
+}
+
+void InputDeviceManager::setSupportedKeys() {
+    LOGD("Entered");
+    cleanSupportedKeys();
+    InputDeviceKeyPtr key(new InputDeviceKey());
+    m_availableKeys.push_back(key);
+}
+
+InputDeviceKeyPtr InputDeviceManager::getKey(
+        std::string const& keyName) const {
+    LOGD("Enter");
+    auto it = std::find_if(m_availableKeys.begin(), m_availableKeys.end(),
+        [ keyName ](InputDeviceKeyPtr _pKey)->bool{
+            if (_pKey->getName() == keyName) {
+                return true;
+            } else {
+                return false;
+            }
+        });
+
+    if (it != m_availableKeys.end()) {
+      return *it;
+    } else {
+        return NULL;
+    }
+}
+void InputDeviceManager::registerKey(std::string const& keyName) const {
+    LOGD("Enter");
+}
+void InputDeviceManager::unregisterKey(std::string const& keyName) const {
+    LOGD("Enter");
+}
+
+std::vector<InputDeviceKeyPtr> InputDeviceManager::getSupportedKeys() const {
+    LOGD("Enter");
+    return m_availableKeys;
+}
+
+}  // namespace inputdevice
+}  // namespace extension
diff --git a/src/inputdevice/inputdevice_manager.h b/src/inputdevice/inputdevice_manager.h
new file mode 100755 (executable)
index 0000000..05dd76a
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+
+#ifndef SRC_INPUTDEVICE_INPUTDEVICE_MANAGER_H_
+#define SRC_INPUTDEVICE_INPUTDEVICE_MANAGER_H_
+
+#include <vector>
+#include <string>
+
+#include "../inputdevice/inputdevice_key.h"
+
+namespace extension {
+namespace inputdevice {
+
+class InputDeviceManager {
+ public:
+    InputDeviceKeyPtr getKey(std::string const& keyName) const;
+
+    void registerKey(std::string const& keyName) const;
+
+    void unregisterKey(std::string const& keyName) const;
+
+    std::vector<InputDeviceKeyPtr> getSupportedKeys() const;
+
+    static InputDeviceManager& getInstance();
+
+    virtual ~InputDeviceManager();
+
+ private:
+    InputDeviceManager();
+
+    void setSupportedKeys();
+    std::vector<InputDeviceKeyPtr> m_availableKeys;
+
+    void cleanSupportedKeys();
+};
+
+}  // namespace inputdevice
+}  // namespace extension
+
+#endif  // SRC_INPUTDEVICE_INPUTDEVICE_MANAGER_H_
index 7e2d64f3d4ebfe7995f16fb646fe2c35b8ccbe98..d305aaf1bc419fa47f0a8972a201bf15994614ad 100755 (executable)
             ],
           },
         ],
+        [
+          'tizen_feature_inputdevice_support==1', {
+            'dependencies': [
+              'inputdevice/inputdevice.gyp:*'
+            ],
+          },
+        ],
         [
           'tizen_feature_tvchannel_support==1', {
             'dependencies': [