1 /* |
|
2 * Copyright (c) 2007 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: Async-Sync utility class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LOCKAPPWAIT_H |
|
20 #define __LOCKAPPWAIT_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <eikappui.h> |
|
26 #include <coecntrl.h> |
|
27 |
|
28 // CLASS DEFINITIONS |
|
29 class CWait : public CActive |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * Creates instance of the CWait class. |
|
34 * |
|
35 * @return Returns the instance just created. |
|
36 */ |
|
37 static CWait* NewL( ); |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 */ |
|
42 ~CWait( ); |
|
43 |
|
44 /** |
|
45 * Starts waiting for aReqStatus. |
|
46 */ |
|
47 TInt WaitForRequestL( ); |
|
48 |
|
49 /** |
|
50 * Sets active request type. |
|
51 */ |
|
52 void SetRequestType(TInt aRequestType ); |
|
53 |
|
54 /** |
|
55 * Gets active request type. |
|
56 */ |
|
57 TInt GetRequestType( ); |
|
58 |
|
59 private: |
|
60 |
|
61 /** |
|
62 * C++ default constructor. |
|
63 */ |
|
64 CWait( ); |
|
65 |
|
66 /** |
|
67 * Symbian OS constructor. |
|
68 */ |
|
69 void ConstructL( ); |
|
70 |
|
71 private: // from CActive |
|
72 |
|
73 /** @see CActive::RunL() */ |
|
74 void RunL( ); |
|
75 |
|
76 /** @see CActive::DoCancel() */ |
|
77 void DoCancel( ); |
|
78 |
|
79 private: // data |
|
80 |
|
81 RTimer iTimer; |
|
82 |
|
83 CActiveSchedulerWait iWait; |
|
84 |
|
85 // Used if there is a need to cancel an active request; |
|
86 // namely in situations where destructor is called when Wait |
|
87 // is active. |
|
88 TInt iRequestType; |
|
89 }; |
|
90 |
|
91 // ---------------------------------------------------------- |
|
92 // CWaitAbsorbingControl |
|
93 // absorbs all the key presses. |
|
94 // ---------------------------------------------------------- |
|
95 // |
|
96 class CWaitAbsorbingControl : public CCoeControl |
|
97 { |
|
98 public: |
|
99 |
|
100 /** |
|
101 * Creates instance of the CWaitAbsorbingControl class. |
|
102 * |
|
103 * @return Returns the instance just created. |
|
104 */ |
|
105 static CWaitAbsorbingControl* NewLC( ); |
|
106 |
|
107 /** |
|
108 * Destructor. |
|
109 */ |
|
110 virtual ~CWaitAbsorbingControl( ); |
|
111 |
|
112 private: |
|
113 |
|
114 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/); |
|
115 |
|
116 private: |
|
117 |
|
118 CWaitAbsorbingControl( ); |
|
119 |
|
120 void ConstructL( ); |
|
121 |
|
122 private: // data |
|
123 |
|
124 CEikAppUi* iAppUi; |
|
125 |
|
126 }; |
|
127 |
|
128 #endif |
|
129 |
|
130 // End of file |
|