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 KEYCAPTUREPRIVATE_S60_H |
|
23 #define KEYCAPTUREPRIVATE_S60_H |
|
24 |
|
25 #include <qnamespace.h> |
|
26 #include <QString> |
|
27 #include <QList> |
|
28 #include "capturerequest_s60.h" |
|
29 |
|
30 class RWindowGroup; |
|
31 class RWsSession; |
|
32 class TargetWrapper; |
|
33 |
|
34 class QKeyMapper; |
|
35 #ifdef _XQKEYCAPTURE_UNITTEST_ |
|
36 class MyTestWindowGroup; |
|
37 #endif |
|
38 |
|
39 class KeyCapturePrivate |
|
40 { |
|
41 |
|
42 public: |
|
43 KeyCapturePrivate(); |
|
44 ~KeyCapturePrivate(); |
|
45 |
|
46 bool initRemote(XQKeyCapture::CapturingFlags flags); |
|
47 |
|
48 bool closeRemote(XQKeyCapture::CapturingFlags flags); |
|
49 |
|
50 QString errorString() const; |
|
51 |
|
52 int errorId() const; |
|
53 |
|
54 private: |
|
55 static int mRemoteEventType_KeyPress; |
|
56 static int mRemoteEventType_KeyRelease; |
|
57 |
|
58 private: |
|
59 bool doCapture(TUint aKey, Qt::KeyboardModifiers aModifiersMask, |
|
60 Qt::KeyboardModifiers aModifier, |
|
61 CaptureRequest::CaptureRequestType type, |
|
62 XQKeyCapture::LongFlags aLongType = |
|
63 XQKeyCapture::LongWaitNotApplicable); |
|
64 |
|
65 bool doCancelCapture(TUint aKey, Qt::KeyboardModifiers aModifiersMask, |
|
66 Qt::KeyboardModifiers aModifier, |
|
67 CaptureRequest::CaptureRequestType type, |
|
68 XQKeyCapture::LongFlags aLongType = |
|
69 XQKeyCapture::LongWaitNotApplicable); |
|
70 |
|
71 void regenerateError(); |
|
72 |
|
73 private: |
|
74 int mLastError; |
|
75 QString mLastErrorString; |
|
76 #ifndef _XQKEYCAPTURE_UNITTEST_ |
|
77 RWindowGroup& mWindowGroup; //not owned |
|
78 #else |
|
79 MyTestWindowGroup& mWindowGroup; //not owned |
|
80 #endif |
|
81 QList<CaptureRequest*> *mRequestsList; |
|
82 QKeyMapper* mMapper; |
|
83 |
|
84 TargetWrapper *tgWrapper; |
|
85 |
|
86 friend class XQKeyCapture; |
|
87 friend class XqKeyCapture; |
|
88 }; |
|
89 |
|
90 #endif /* KEYCAPTUREPRIVATE_S60_H */ |
|