|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Instance of this class catches key inputs when it is activated |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCAINPUTABSORBER_H |
|
21 #define CCAINPUTABSORBER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <coecntrl.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CEikAppUi; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Instance of this class catches key events when instance is activated |
|
33 * Activation is handled by pushing control to view stack |
|
34 * |
|
35 * @lib chat.app |
|
36 * @since 1.2 |
|
37 */ |
|
38 class CCAInputAbsorber : public CCoeControl |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CCAInputAbsorber* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CCAInputAbsorber(); |
|
51 |
|
52 public: // New functions |
|
53 |
|
54 /** |
|
55 * Starts capturing events |
|
56 */ |
|
57 void CaptureEventsL(); |
|
58 |
|
59 /** |
|
60 * Stops capturing events |
|
61 */ |
|
62 void Release(); |
|
63 |
|
64 /** |
|
65 * Are events captured now |
|
66 * @return Are events captured now |
|
67 */ |
|
68 TBool IsCaptured() const; |
|
69 |
|
70 public: // Functions from base classes |
|
71 |
|
72 /** |
|
73 * @see CCoeControl |
|
74 */ |
|
75 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
76 |
|
77 /** |
|
78 * @see CCoeControl |
|
79 */ |
|
80 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * C++ default constructor. |
|
86 */ |
|
87 CCAInputAbsorber(); |
|
88 |
|
89 /** |
|
90 * By default Symbian 2nd phase constructor is private. |
|
91 */ |
|
92 void ConstructL(); |
|
93 |
|
94 private: //data |
|
95 // Doesn't own. Handle to EikAppUi |
|
96 CEikAppUi* iAppUi; |
|
97 // Event capturing status |
|
98 TBool iIsCaptured; |
|
99 |
|
100 }; |
|
101 |
|
102 #endif // CCAINPUTABSORBER_H |
|
103 |
|
104 // End of File |