|
1 /** |
|
2 * ==================================================================== |
|
3 * capturer.h |
|
4 * Copyright (c) 2006 Nokia Corporation |
|
5 * |
|
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 |
|
9 * |
|
10 * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 * |
|
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. |
|
17 * ==================================================================== |
|
18 */ |
|
19 |
|
20 |
|
21 #include "Python.h" |
|
22 #include "symbian_python_ext_util.h" |
|
23 |
|
24 #include <w32std.h> |
|
25 #include <e32base.h> |
|
26 #include <apgwgnam.h> |
|
27 #include <coedef.h> |
|
28 |
|
29 |
|
30 #ifndef EKA2 |
|
31 class CCapturer : public CActive |
|
32 #else |
|
33 NONSHARABLE_CLASS(CCapturer) : public CActive |
|
34 #endif |
|
35 { |
|
36 public: |
|
37 ~CCapturer(); |
|
38 static CCapturer* NewL(PyObject* callback); |
|
39 TInt32 SetKeyToBeCapturedL(TInt32 keyCode); |
|
40 void RemoveKey(TInt32 keyId); |
|
41 void StartCapturing(); |
|
42 void RunL(); |
|
43 void DoCancel(); |
|
44 TInt32 LastCapturedKey(); |
|
45 void SetForwarding(TInt forwarding); |
|
46 private: |
|
47 CCapturer(PyObject* aCallback = NULL); |
|
48 void ConstructL(); |
|
49 RWsSession* iSession; |
|
50 RWindowGroup* iWinGroup; |
|
51 CApaWindowGroupName* iWinGroupName; |
|
52 PyObject* iCallback; |
|
53 TInt32 iLastCapturedKey; |
|
54 TBool iCallbackRunning; |
|
55 TBool iForwarding; |
|
56 TBool iRunning; |
|
57 }; |
|
58 |