|
1 /* |
|
2 * Copyright (c) 2009 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: Class implementing CCCAppViewPluginAknContainer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCAPPMYCARDCONTAINER_H |
|
20 #define CCAPPMYCARDCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <eiklbo.h> |
|
24 #include <ccappviewpluginakncontainer.h> |
|
25 #include "ccappmycard.h" |
|
26 #include "ccappmycardimageloader.h" |
|
27 #include <mpbk2contactuicontrol.h> |
|
28 #include "ccappmycardheadercontrol.h" |
|
29 |
|
30 #include "ccappstatuscontrol.h" |
|
31 |
|
32 class CCCAppMyCardPlugin; |
|
33 class CCCAppMyCardHeaderControl; |
|
34 class CAknsBasicBackgroundControlContext; |
|
35 class CAknFormDoubleGraphicStyleListBox; |
|
36 class CCCAppMyCardListBoxModel; |
|
37 class CCCAppStatusControl; |
|
38 class CPbk2ApplicationServices; |
|
39 class CSpbContentProvider; |
|
40 class MCCAViewLauncher; |
|
41 class CCCAExtensionFactory; |
|
42 class CCCaFactoryExtensionNotifier; |
|
43 |
|
44 /** |
|
45 * Class implementing CCAppMyCard -container for UI controls |
|
46 * |
|
47 * |
|
48 * @lib ccappmycardplugin.dll |
|
49 * @since S60 9.2 |
|
50 */ |
|
51 class CCCAppMyCardContainer : |
|
52 public CCCAppViewPluginAknContainer, |
|
53 public MMyCardObserver, |
|
54 public MMyCardImageLoaderObserver, |
|
55 public MEikListBoxObserver, |
|
56 public MPbk2ContactUiControl, |
|
57 public MCCAStatusControlObserver, |
|
58 public MMyCardHeaderControlObserver |
|
59 { |
|
60 public: // constructor and destructor |
|
61 |
|
62 /** |
|
63 * CCCAppMyCardContainer. |
|
64 * |
|
65 * @param aPlugin reference |
|
66 */ |
|
67 CCCAppMyCardContainer( |
|
68 CCCAppMyCardPlugin& aPlugin ); |
|
69 |
|
70 /** |
|
71 * ~CCCAppMyCardContainer |
|
72 */ |
|
73 ~CCCAppMyCardContainer(); |
|
74 |
|
75 public: // Functions from base classes |
|
76 |
|
77 /** |
|
78 * From CCoeControl |
|
79 * (see details from baseclass ) |
|
80 */ |
|
81 void Draw( const TRect& aRect ) const; |
|
82 |
|
83 /** |
|
84 * From CCoeControl |
|
85 * (see details from baseclass ) |
|
86 */ |
|
87 void SizeChanged(); |
|
88 |
|
89 /** |
|
90 * From CCoeControl |
|
91 * (see details from baseclass ) |
|
92 */ |
|
93 TInt CountComponentControls() const; |
|
94 |
|
95 /** |
|
96 * From CCoeControl |
|
97 * (see details from baseclass ) |
|
98 */ |
|
99 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
100 |
|
101 /** |
|
102 * From CCoeControl |
|
103 * (see details from baseclass ) |
|
104 */ |
|
105 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
106 |
|
107 /** |
|
108 * From CCoeControl |
|
109 */ |
|
110 TKeyResponse OfferKeyEventL( |
|
111 const TKeyEvent& aKeyEvent, |
|
112 TEventCode aType ); |
|
113 |
|
114 /** |
|
115 * From MMyCardObserver |
|
116 */ |
|
117 void MyCardEventL( MMyCardObserver::TEvent aEvent ); |
|
118 |
|
119 /** |
|
120 * From MMyCardImageLoaderObserver |
|
121 */ |
|
122 void ThumbnailReady( CFbsBitmap* aThumbnail ); |
|
123 |
|
124 /** |
|
125 * From MMyCardImageLoaderObserver |
|
126 */ |
|
127 void ThumbnailLoadError( TInt aError ); |
|
128 |
|
129 /** |
|
130 * From MEikListBoxObserver |
|
131 */ |
|
132 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
133 |
|
134 /** |
|
135 * From MCCAStatusControlObserver |
|
136 */ |
|
137 void StatusClickedL(); |
|
138 |
|
139 /* |
|
140 * From MMyCardHeaderControlObserver |
|
141 */ |
|
142 void MyCardHeaderControlClickL( TPoint aPos ); |
|
143 |
|
144 public: // New |
|
145 |
|
146 /** |
|
147 * Getter for plugin reference. |
|
148 * |
|
149 * @return Plugin reference |
|
150 * @since S60 v5.0 |
|
151 */ |
|
152 CCCAppMyCardPlugin& Plugin(); |
|
153 |
|
154 |
|
155 public: // From MPbk2ContactUiControl |
|
156 |
|
157 MPbk2ContactUiControl* ParentControl() const; |
|
158 TInt NumberOfContacts() const; |
|
159 const MVPbkBaseContact* FocusedContactL() const; |
|
160 const MVPbkViewContact* FocusedViewContactL() const; |
|
161 const MVPbkStoreContact* FocusedStoreContact() const; |
|
162 void SetFocusedContactL( |
|
163 const MVPbkBaseContact& aContact ); |
|
164 void SetFocusedContactL( |
|
165 const MVPbkContactBookmark& aContactBookmark ); |
|
166 void SetFocusedContactL( |
|
167 const MVPbkContactLink& aContactLink ); |
|
168 TInt FocusedContactIndex() const; |
|
169 void SetFocusedContactIndexL( |
|
170 TInt aIndex ); |
|
171 TInt NumberOfContactFields() const; |
|
172 const MVPbkBaseContactField* FocusedField() const; |
|
173 TInt FocusedFieldIndex() const; |
|
174 void SetFocusedFieldIndex( |
|
175 TInt aIndex ); |
|
176 TBool ContactsMarked() const; |
|
177 MVPbkContactLinkArray* SelectedContactsL() const; |
|
178 MVPbkContactLinkArray* SelectedContactsOrFocusedContactL() const; |
|
179 MPbk2ContactLinkIterator* SelectedContactsIteratorL() const; |
|
180 CArrayPtr<MVPbkContactStore>* SelectedContactStoresL() const; |
|
181 void ClearMarks(); |
|
182 void SetSelectedContactL( |
|
183 TInt aIndex, |
|
184 TBool aSelected ); |
|
185 void SetSelectedContactL( |
|
186 const MVPbkContactBookmark& aContactBookmark, |
|
187 TBool aSelected ); |
|
188 void SetSelectedContactL( |
|
189 const MVPbkContactLink& aContactLink, |
|
190 TBool aSelected ); |
|
191 void DynInitMenuPaneL( |
|
192 TInt aResourceId, |
|
193 CEikMenuPane* aMenuPane ) const; |
|
194 void UpdateAfterCommandExecution(); |
|
195 TInt GetMenuFilteringFlagsL() const; |
|
196 CPbk2ViewState* ControlStateL() const; |
|
197 void RestoreControlStateL( |
|
198 CPbk2ViewState* aState ); |
|
199 const TDesC& FindTextL(); |
|
200 void ResetFindL(); |
|
201 void ShowThumbnail(); |
|
202 void HideThumbnail(); |
|
203 void SetBlank( |
|
204 TBool aBlank ); |
|
205 void RegisterCommand( |
|
206 MPbk2Command* aCommand ); |
|
207 void SetTextL( |
|
208 const TDesC& aText ); |
|
209 TAny* ContactUiControlExtension(TUid aExtensionUid ); |
|
210 void ProcessCommandL( TInt aCommandId ) const; |
|
211 |
|
212 /* |
|
213 * Checks the ecom implementations available and lauches the first |
|
214 * with correct UID |
|
215 */ |
|
216 MCCAViewLauncher* CreateViewLauncherL( ); |
|
217 |
|
218 private: // Constructors |
|
219 |
|
220 /** |
|
221 * ConstructL |
|
222 */ |
|
223 void ConstructL(); |
|
224 |
|
225 /** |
|
226 * Sets the name to mycard header control in correct format |
|
227 */ |
|
228 void SetNameForHeaderControlL(); |
|
229 |
|
230 /* |
|
231 * Sets the correct place for Image selection popup menu |
|
232 */ |
|
233 void PosToScreenCoordinates( CCoeControl* aControl, TPoint& aPos ); |
|
234 |
|
235 /* |
|
236 * Gets called when ExtensionFactory plugin is installed/removed |
|
237 */ |
|
238 static TInt CheckExtensionFactoryL(TAny* aPtr); |
|
239 |
|
240 /* |
|
241 * Hides/shows the status control based on Extensionfactory plugins |
|
242 * availability. |
|
243 */ |
|
244 void DoCheckExtensionFactoryL(); |
|
245 |
|
246 inline void ResolveNameOrderL(); |
|
247 |
|
248 private: // Data |
|
249 |
|
250 /** |
|
251 * Ref to plugin. |
|
252 * Not own. |
|
253 */ |
|
254 CCCAppMyCardPlugin& iPlugin; |
|
255 |
|
256 /** |
|
257 * Background for skinning |
|
258 * Own. |
|
259 */ |
|
260 CAknsBasicBackgroundControlContext* iBackground; |
|
261 |
|
262 /** |
|
263 * Header UI control of MyCard view |
|
264 * Own. |
|
265 */ |
|
266 CCCAppMyCardHeaderControl* iHeaderCtrl; |
|
267 |
|
268 /** |
|
269 * Details list UI control of MyCard view |
|
270 * Own. |
|
271 */ |
|
272 CAknFormDoubleGraphicStyleListBox* iListBox; |
|
273 |
|
274 /** |
|
275 * Reference to listbox model |
|
276 * Not own. |
|
277 */ |
|
278 CCCAppMyCardListBoxModel* iModel; |
|
279 |
|
280 /** |
|
281 * Contact image loader |
|
282 * Own. |
|
283 */ |
|
284 CCCAppMyCardImageLoader* iImageLoader; |
|
285 |
|
286 /// Ref: command in execution |
|
287 MPbk2Command* iCommand; |
|
288 |
|
289 /** |
|
290 * Used for launching the Ecom plugins |
|
291 * Own. |
|
292 */ |
|
293 MCCAViewLauncher* iViewLauncher; |
|
294 |
|
295 TBool iControlLink; |
|
296 |
|
297 /** |
|
298 * Contact image selection stylus popup menu |
|
299 * Own. |
|
300 */ |
|
301 CAknStylusPopUpMenu* iImageSelectionPopup; |
|
302 |
|
303 /* |
|
304 * Flag for checking whether or not an user image is set to MyCard |
|
305 */ |
|
306 TBool iMyCardImageSet; |
|
307 |
|
308 /* |
|
309 * Used for hiding/showing the StatusControl |
|
310 * Own. |
|
311 */ |
|
312 CCCaFactoryExtensionNotifier* iFactoryExtensionNotifier; |
|
313 |
|
314 TInt iNameOrder; |
|
315 }; |
|
316 |
|
317 #endif // CCAPPMYCARDCONTAINER_H |
|
318 |
|
319 // End of File |