1 /* |
|
2 * Copyright (c) 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: CMSPropertyWatcher class defition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __MSPROPERTYWATCHER_H__ |
|
21 #define __MSPROPERTYWATCHER_H__ |
|
22 |
|
23 |
|
24 // Include Files |
|
25 #include <e32base.h> |
|
26 #include <e32property.h> |
|
27 #include "cmcommon.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MMSPropertyObserver; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * Active object class for MSEngine |
|
35 * @since S60 5.1 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CMSPropertyWatcher ): public CActive |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CMSPropertyWatcher* NewL(); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CMSPropertyWatcher* NewLC(); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CMSPropertyWatcher(); |
|
56 |
|
57 /** |
|
58 * Sets property observer |
|
59 * @since S60 5.1 |
|
60 * @param aObserver, property observer |
|
61 * @return None |
|
62 */ |
|
63 void SetObserver( MMSPropertyObserver* aObserver ); |
|
64 |
|
65 /** |
|
66 * Starts listening property |
|
67 * @since S60 5.1 |
|
68 * @param None |
|
69 * @return None |
|
70 */ |
|
71 void StartL(); |
|
72 |
|
73 /** |
|
74 * Stops listening property |
|
75 * @since S60 5.1 |
|
76 * @param None |
|
77 * @return None |
|
78 */ |
|
79 void Stop(); |
|
80 |
|
81 protected: |
|
82 |
|
83 // From base class CActive |
|
84 |
|
85 /** |
|
86 * From CActive |
|
87 * See base class definition |
|
88 */ |
|
89 virtual void RunL(); |
|
90 |
|
91 /** |
|
92 * From CActive |
|
93 * See base class definition |
|
94 */ |
|
95 virtual void DoCancel(); |
|
96 |
|
97 /** |
|
98 * From CActive |
|
99 * See base class definition |
|
100 */ |
|
101 TInt RunError( TInt aError ); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * Performs the first phase of two phase construction. |
|
107 */ |
|
108 CMSPropertyWatcher(); |
|
109 |
|
110 /** |
|
111 * Performs the second phase construction. |
|
112 */ |
|
113 void ConstructL(); |
|
114 |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * property |
|
120 */ |
|
121 RProperty iProgressInfo; |
|
122 /** |
|
123 * property observer |
|
124 */ |
|
125 MMSPropertyObserver* iObserver; // not owned |
|
126 |
|
127 }; |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 /** |
|
133 * Property observer |
|
134 * @since Series 60 3.1 |
|
135 */ |
|
136 class MMSPropertyObserver |
|
137 { |
|
138 public: |
|
139 |
|
140 /** |
|
141 * Informs about property changes |
|
142 * @param aService, completed service |
|
143 * @param aError, error code |
|
144 * @since S60 5.1 |
|
145 */ |
|
146 virtual void PropertyChangedL( TCmService aService, |
|
147 TInt aTotalItems, |
|
148 TInt aProcessedItems, |
|
149 TInt aItemsToBeProcessed ) = 0; |
|
150 }; |
|
151 |
|
152 #endif // __MSPROPERTYWATCHER_H__ |
|
153 |
|
154 // End of file |
|