First version
[staging/HomeScreen.git] / src / inputeventdistributor.cpp
1 /*
2  * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "inputeventdistributor.h"
18 #include <QEvent>
19
20 InputEventDistributor::InputEventDistributor(QObject *parent) :
21     QObject(parent),
22     mp_inputEventAdaptor(0)
23 {
24     // publish dbus popup interface
25     mp_inputEventAdaptor = new InputeventAdaptor((QObject*)this);
26     QDBusConnection dbus = QDBusConnection::sessionBus();
27     dbus.registerObject("/InputEventDistributor", this);
28     dbus.registerService("org.agl.main");
29 }
30
31 InputEventDistributor::~InputEventDistributor()
32 {
33     delete mp_inputEventAdaptor;
34 }
35
36 void InputEventDistributor::keyEvent(int type, int zone, int key)
37 {
38     qDebug("InputEventDistributor::keyEvent type 0x%x, key 0x%x", type, key);
39
40     //QEvent *event;
41     switch (type)
42     {
43     case SystemInputEvent::INPUTEVENTTYPE_KEY_PRESSED:
44
45         break;
46     default:
47         qDebug("InputEventDistributor::keyEvent: Type 0x%x undefined", type);
48     }
49
50 }