1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 #ifndef KeyCaptureTestApp_H |
|
23 #define KEYCAPTUREMAINWINDOW_H |
|
24 |
|
25 #include <QMainWindow> |
|
26 #include <QMap> |
|
27 #include <XQKeyCapture> |
|
28 |
|
29 #include "mapping.h" |
|
30 |
|
31 class QPlainTextEdit; |
|
32 class QAction; |
|
33 class QWidget; |
|
34 class QMenu; |
|
35 class CaptureRequest; |
|
36 |
|
37 class KeyCaptureTestApp : public QMainWindow |
|
38 { |
|
39 Q_OBJECT |
|
40 public: |
|
41 KeyCaptureTestApp(QWidget *parent = 0); |
|
42 ~KeyCaptureTestApp(); |
|
43 void addTextLine(QString); |
|
44 |
|
45 bool event(QEvent *event); |
|
46 bool eventFilter(QObject *, QEvent *); |
|
47 public slots: |
|
48 void triggered(QAction* aAction); |
|
49 void cleanLog(); |
|
50 |
|
51 void enableRemBasic(bool); |
|
52 void enableRemCallHandlingEx(bool); |
|
53 void enableRemoteExtEvents(bool); |
|
54 |
|
55 void remoteAll(bool enable); |
|
56 void remoteNone(bool enable); |
|
57 |
|
58 private: |
|
59 void procesAction(CaptureRequest request); |
|
60 void processEvent(QEvent *event); |
|
61 private: |
|
62 QPlainTextEdit *mTextArea; |
|
63 |
|
64 XQKeyCapture *mKeyCapture; |
|
65 |
|
66 QAction *toggleRemoteBasic; |
|
67 QAction *toggleRemoteCallHandlingEx; |
|
68 QAction *toggleRemoteExtEvents; |
|
69 |
|
70 QAction *remoteAllOn; |
|
71 QAction *remoteAllOff; |
|
72 |
|
73 QMap<QString, Qt::Key> mKeysMap; |
|
74 QMenu* mKeysMenu; |
|
75 |
|
76 QMap<QString, XQKeyCapture::LongFlags> mLongFlagsMap; |
|
77 QMenu* mLongFlagsMenu; |
|
78 |
|
79 Mapping *mappingPtr; |
|
80 }; |
|
81 |
|
82 #endif // KEYCAPTUREMAINWINDOW_H |
|