2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Jan Olszak <j.olszak@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
21 * @author Jan Olszak (j.olszak@samsung.com)
22 * @brief C++ wrapper for glib input monitor
25 #ifndef SERVER_INPUT_MONITOR_HPP
26 #define SERVER_INPUT_MONITOR_HPP
28 #include "input-monitor-config.hpp"
29 #include "ipc/epoll/event-poll.hpp"
31 #include <linux/input.h>
45 InputMonitor(ipc::epoll::EventPoll& eventPoll,
46 const InputConfig& inputConfig,
47 ZonesManager* zonesManager);
53 typedef std::mutex Mutex;
56 ZonesManager* mZonesManager;
58 ipc::epoll::EventPoll& mEventPoll;
59 std::list<struct timeval> mEventTimes;
60 std::string mDevicePath;
63 std::string getDevicePath() const;
64 void setHandler(const std::string& devicePath);
65 void handleInternal(int fd, ipc::epoll::Events events);
67 bool isExpectedEventSequence(const struct input_event&);
73 #endif // SERVER_INPUT_MONITOR_HPP