|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Wrapper class for active objects |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef IPSPLGSINGLEOPWATCHER_H |
|
19 #define IPSPLGSINGLEOPWATCHER_H |
|
20 |
|
21 |
|
22 |
|
23 // FORWARD DECLARATIONS |
|
24 class CMsvOperation; |
|
25 class MIpsPlgSingleOpWatcher; |
|
26 class CIpsPlgBaseOperation; |
|
27 class CIpsPlgImap4MoveRemoteOpObserver; |
|
28 |
|
29 /** |
|
30 * CMsvOperation watcher class. |
|
31 */ |
|
32 class CIpsPlgSingleOpWatcher : public CActive |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 */ |
|
38 IMPORT_C static CIpsPlgSingleOpWatcher* NewLC( |
|
39 MIpsPlgSingleOpWatcher& aObserver ); |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 IMPORT_C static CIpsPlgSingleOpWatcher* NewL( |
|
45 MIpsPlgSingleOpWatcher& aObserver ); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 IMPORT_C ~CIpsPlgSingleOpWatcher(); |
|
51 |
|
52 /** |
|
53 * Sets operation |
|
54 * Must only be called once during the |
|
55 * lifetime of a CIpsPlgSingleOpWatcher |
|
56 * object. |
|
57 */ |
|
58 IMPORT_C void SetOperation( CMsvOperation* aOperation ); |
|
59 |
|
60 |
|
61 void SetOperation( CIpsPlgBaseOperation* aBaseOperation ); |
|
62 |
|
63 /** |
|
64 * Sets request observer. |
|
65 */ |
|
66 void SetRequestObserver( CIpsPlgImap4MoveRemoteOpObserver* aObserver ); |
|
67 |
|
68 /** |
|
69 * Returns reference to the operation |
|
70 */ |
|
71 IMPORT_C CMsvOperation& Operation() const; |
|
72 |
|
73 const CIpsPlgBaseOperation* BaseOperation( ) const; |
|
74 |
|
75 private: |
|
76 /** |
|
77 * C++ constructor |
|
78 */ |
|
79 CIpsPlgSingleOpWatcher( MIpsPlgSingleOpWatcher& aObserver ); |
|
80 |
|
81 /** |
|
82 * Symbian OS constructor |
|
83 */ |
|
84 void ConstructL(); |
|
85 |
|
86 /** |
|
87 * From CActive |
|
88 */ |
|
89 virtual void DoCancel(); |
|
90 |
|
91 /** |
|
92 * From CActive |
|
93 */ |
|
94 virtual void RunL(); |
|
95 |
|
96 private: |
|
97 MIpsPlgSingleOpWatcher& iObserver; |
|
98 CMsvOperation *iOperation; |
|
99 CIpsPlgBaseOperation* iBaseOperation; |
|
100 CIpsPlgImap4MoveRemoteOpObserver* iRequestObserver; |
|
101 }; |
|
102 |
|
103 |
|
104 /** |
|
105 * Mixin class MIpsPlgSingleOpWatcher |
|
106 * |
|
107 * Function OpCompleted is called when operation is completed. |
|
108 */ |
|
109 class MIpsPlgSingleOpWatcher |
|
110 { |
|
111 public: |
|
112 virtual void OpCompleted( |
|
113 CIpsPlgSingleOpWatcher& aOpWatcher, |
|
114 TInt aCompletionCode ) = 0; |
|
115 }; |
|
116 |
|
117 |
|
118 /** |
|
119 * Class CIpsPlgSingleOpWatcherArray |
|
120 * |
|
121 * Use this define when we want to use an array |
|
122 * of CIpsPlgSingleOpWatcher objects. |
|
123 */ |
|
124 |
|
125 //typedef CArrayPtrFlat<CIpsPlgSingleOpWatcher> CIpsPlgSingleOpWatcherArray; |
|
126 |
|
127 |
|
128 #endif // IPSPLGSINGLEOPWATCHER_H |
|
129 |
|
130 // End of file |