equal
deleted
inserted
replaced
20 #define CCAPPSTATUSCONTROL_H_ |
20 #define CCAPPSTATUSCONTROL_H_ |
21 |
21 |
22 // INCLUDES |
22 // INCLUDES |
23 #include <coecntrl.h> |
23 #include <coecntrl.h> |
24 #include <spbcontentprovider.h> |
24 #include <spbcontentprovider.h> |
|
25 #include <ccaextensionfactory.h> |
|
26 |
25 |
27 |
26 // FORWARD DECLARATIONS |
28 // FORWARD DECLARATIONS |
27 class CEikImage; |
29 class CEikImage; |
28 class CEikLabel; |
30 class CEikLabel; |
29 class CFbsBitmap; |
31 class CFbsBitmap; |
53 * @lib ccapputil.lib |
55 * @lib ccapputil.lib |
54 * @since S60 9.2 |
56 * @since S60 9.2 |
55 */ |
57 */ |
56 NONSHARABLE_CLASS( CCCAppStatusControl ) : |
58 NONSHARABLE_CLASS( CCCAppStatusControl ) : |
57 public CCoeControl, |
59 public CCoeControl, |
58 public MSpbContentProviderObserver |
60 public MSpbContentProviderObserver, |
|
61 public MCCAStatusProviderObserver |
59 { |
62 { |
60 public: // Construction & destruction |
63 public: // Construction & destruction |
|
64 |
|
65 enum TContactType |
|
66 { |
|
67 ENormalContact = 0x01, |
|
68 EMyCardContact = 0x02 |
|
69 }; |
|
70 |
61 /** |
71 /** |
62 * Two-phased constructor. |
72 * Two-phased constructor. |
63 */ |
73 */ |
64 IMPORT_C static CCCAppStatusControl* NewL( |
74 IMPORT_C static CCCAppStatusControl* NewL( |
65 CSpbContentProvider& aContentProvider, |
75 CSpbContentProvider& aContentProvider, |
66 MCCAStatusControlObserver& aObserver ); |
76 MCCAStatusControlObserver& aObserver, |
|
77 CCCAppStatusControl::TContactType aContactType ); |
67 |
78 |
68 /** |
79 /** |
69 * Destructor. |
80 * Destructor. |
70 */ |
81 */ |
71 ~CCCAppStatusControl(); |
82 ~CCCAppStatusControl(); |
72 |
83 |
73 public: // New implementation |
84 public: // New implementation |
74 |
85 |
75 /** |
86 /** |
76 * Sets the link object |
87 * Sets the link object |
98 * Set the default status text |
109 * Set the default status text |
99 * |
110 * |
100 * @aDefaultStatusText Default status text |
111 * @aDefaultStatusText Default status text |
101 */ |
112 */ |
102 IMPORT_C void SetDefaultStatusTextL( HBufC* aDefaultStatusText ); |
113 IMPORT_C void SetDefaultStatusTextL( HBufC* aDefaultStatusText ); |
103 |
114 |
|
115 /** |
|
116 * Set the CCA statusprovider |
|
117 * |
|
118 * @aCCAStatusProvider ECom status provider |
|
119 */ |
|
120 IMPORT_C void SetStatusProvider( MCCAStatusProvider* aCCAStatusProvider ); |
|
121 |
104 public: // From CCoeControl |
122 public: // From CCoeControl |
105 |
123 |
106 /** |
124 /** |
107 * From CCoeControl |
125 * From CCoeControl |
108 */ |
126 */ |
140 */ |
158 */ |
141 void ContentUpdated( |
159 void ContentUpdated( |
142 MVPbkContactLink& aLink, |
160 MVPbkContactLink& aLink, |
143 MSpbContentProviderObserver::TSpbContentEvent aEvent ); |
161 MSpbContentProviderObserver::TSpbContentEvent aEvent ); |
144 |
162 |
|
163 public: // From MCCAStatusProviderObserver |
|
164 |
|
165 /* |
|
166 * From MCCAStatusProviderObserver |
|
167 */ |
|
168 void StatusEvent( |
|
169 MCCAStatusProviderObserver::TCCAStatusProviderObserverEvent aEvent, |
|
170 const MVPbkContactLink* aLink = NULL ); |
|
171 |
145 private: // New functions |
172 private: // New functions |
146 |
173 |
147 /** |
174 /** |
148 * Wraps the status text to fit into the space allocated for it. |
175 * Wraps the status text to fit into the space allocated for it. |
149 */ |
176 */ |
162 */ |
189 */ |
163 void DoStatusUpdateL( |
190 void DoStatusUpdateL( |
164 MVPbkContactLink& aLink, |
191 MVPbkContactLink& aLink, |
165 MSpbContentProviderObserver::TSpbContentEvent aEvent ); |
192 MSpbContentProviderObserver::TSpbContentEvent aEvent ); |
166 |
193 |
|
194 /* |
|
195 * Update contact status from ECom plugin |
|
196 * @param aLink contact which has the status updated |
|
197 */ |
|
198 void UpdateCCAStatusL( MVPbkContactLink* aLink ); |
|
199 |
167 void SetVariableLayouts( TInt aOption ); |
200 void SetVariableLayouts( TInt aOption ); |
168 |
201 |
169 inline void RewrapStatusTextToArrayL( |
202 inline void RewrapStatusTextToArrayL( |
170 TDes& aStatusText, |
203 TDes& aStatusText, |
171 CArrayFix<TPtrC>& aTxtArray ); |
204 CArrayFix<TPtrC>& aTxtArray ); |
175 /** |
208 /** |
176 * Constructor for performing 1st stage construction |
209 * Constructor for performing 1st stage construction |
177 */ |
210 */ |
178 CCCAppStatusControl( |
211 CCCAppStatusControl( |
179 CSpbContentProvider& aContentProvider, |
212 CSpbContentProvider& aContentProvider, |
180 MCCAStatusControlObserver& aObserver ); |
213 MCCAStatusControlObserver& aObserver, |
|
214 CCCAppStatusControl::TContactType aContactType ); |
181 |
215 |
182 /** |
216 /** |
183 * Constructor for performing 2nd stage construction |
217 * Constructor for performing 2nd stage construction |
184 */ |
218 */ |
185 void ConstructL(); |
219 void ConstructL(); |
265 |
299 |
266 /* |
300 /* |
267 * Current control state. |
301 * Current control state. |
268 */ |
302 */ |
269 TStatusControlState iState; |
303 TStatusControlState iState; |
|
304 |
|
305 // Own. ECOM plugin tatus provider |
|
306 MCCAStatusProvider* iCCAStatusProvider; |
|
307 |
|
308 // Current contact type. |
|
309 CCCAppStatusControl::TContactType iContactType; |
270 }; |
310 }; |
271 |
311 |
272 #endif // CCAPPSTATUSCONTROL_H_ |
312 #endif // CCAPPSTATUSCONTROL_H_ |