1 // Copyright 2017 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_EXTERNAL_DEVICE_EXTERNAL_INPUT_DEVICE_CONTROLLER_TIZEN_H_
6 #define BASE_EXTERNAL_DEVICE_EXTERNAL_INPUT_DEVICE_CONTROLLER_TIZEN_H_
8 #include <Ecore_Input.h>
9 #include <Ecore_Wayland.h>
11 #include "base/callback.h"
12 #include "base/memory/singleton.h"
15 class RenderFrameHost;
20 extern std::string voiceKey;
21 extern std::string voiceKey_BTPlay;
22 extern std::string voiceKey_BTPause;
24 typedef Callback<void(int, const char*)> OnKeyDown;
26 class ExternalInputDeviceController {
28 static ExternalInputDeviceController* GetInstance();
29 ~ExternalInputDeviceController();
31 void SetCallback(const OnKeyDown& callback) { callback_ = callback; };
33 void GrabMediaKey(int player_id, Ecore_Wl_Window* evas);
34 void UnGrabMediaKey(Ecore_Wl_Window* evas);
37 friend struct base::DefaultSingletonTraits<ExternalInputDeviceController>;
39 ExternalInputDeviceController();
40 // Media button press event callback
41 static Eina_Bool MediaToggleCallback(void* data, int type, void* event);
45 Ecore_Event_Handler* handler_;
46 Ecore_Wl_Window* wayland_window_;