|
1 /* |
|
2 * Copyright (c) 2008-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: The header part control(s) of the commlauncher plugin UI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCCAPPCOMMLAUNCHERHEADERCONTROL_H |
|
20 #define CCCAPPCOMMLAUNCHERHEADERCONTROL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <eikmobs.h> |
|
24 #include "ccappcommlauncherheaders.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CEikImage; |
|
28 class CEikLabel; |
|
29 class CCCAppCommLauncherImageDecoding; |
|
30 class CCCAppCommLauncherHeaderTextOrder; |
|
31 class CAknStylusPopUpMenu; |
|
32 class CCCAppCommLauncherPbkCmd; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 /** |
|
36 * Class implementing the header part control of commlauncherplugin |
|
37 * |
|
38 * @code |
|
39 * ?good_class_usage_example(s) |
|
40 * @endcode |
|
41 * |
|
42 * @lib ccappcommlauncherplugin.dll |
|
43 * @since S60 v5.0 |
|
44 */ |
|
45 class CCCAppCommLauncherHeaderControl : public CCoeControl, public MEikMenuObserver |
|
46 { |
|
47 public: |
|
48 // Construction & destruction |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CCCAppCommLauncherHeaderControl* NewL( CCCAppCommLauncherPlugin& aPlugin ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CCCAppCommLauncherHeaderControl(); |
|
58 |
|
59 // Functions from base classes |
|
60 /** |
|
61 * From CCoeControl |
|
62 * Component control handling (compound control) |
|
63 */ |
|
64 TInt CountComponentControls() const; |
|
65 |
|
66 /** |
|
67 * From CCoeControl |
|
68 * Component control handling (compound control) |
|
69 */ |
|
70 CCoeControl* ComponentControl(TInt aIndex) const; |
|
71 |
|
72 /** |
|
73 * From CoeControl |
|
74 * Called by framework when the view size is changed. |
|
75 */ |
|
76 void SizeChanged(); |
|
77 |
|
78 /** |
|
79 * From CoeControl |
|
80 * Overridden to set the container window for child controls |
|
81 */ |
|
82 void SetContainerWindowL(const CCoeControl& aContainer); |
|
83 |
|
84 /** |
|
85 * From CoeControl |
|
86 * Overridden to receive pointer events |
|
87 */ |
|
88 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
89 |
|
90 /** |
|
91 * Contact data info is given through this |
|
92 */ |
|
93 void ContactInfoFetchedNotifyL( |
|
94 const CCmsContactFieldInfo& aContactFieldInfo ); |
|
95 |
|
96 /** |
|
97 * Contact data is given through this |
|
98 */ |
|
99 void ContactFieldFetchedNotifyL( |
|
100 const CCmsContactField& aContactField ); |
|
101 |
|
102 /** |
|
103 * Notification of completed fetching is given through this |
|
104 */ |
|
105 void ContactFieldFetchingCompletedL(); |
|
106 |
|
107 /** |
|
108 * Sets the bitmap shown in the header image |
|
109 * Ownership is transferred |
|
110 * |
|
111 * @param aBmp The bitmap |
|
112 */ |
|
113 void SetBitmap(CFbsBitmap* aBmp); |
|
114 |
|
115 /** |
|
116 * Clears the texts & the image |
|
117 */ |
|
118 void ClearL(); |
|
119 |
|
120 /** |
|
121 * Set contact store information |
|
122 * @param aContactStore the contact store |
|
123 */ |
|
124 void SetContactStoreL(TCmsContactStore aContactStore); |
|
125 |
|
126 /** |
|
127 * From CCoeControl |
|
128 * (see details from baseclass ) |
|
129 */ |
|
130 TKeyResponse OfferKeyEventL( |
|
131 const TKeyEvent& aKeyEvent, TEventCode aType); |
|
132 |
|
133 public: // MEikMenuObserver |
|
134 virtual void ProcessCommandL(TInt aCommandId); |
|
135 virtual void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis); |
|
136 |
|
137 private: |
|
138 |
|
139 /** |
|
140 * Constructor for performing 1st stage construction |
|
141 */ |
|
142 CCCAppCommLauncherHeaderControl( CCCAppCommLauncherPlugin& aPlugin ); |
|
143 |
|
144 /** |
|
145 * Constructor for performing 2nd stage construction |
|
146 */ |
|
147 void ConstructL(); |
|
148 |
|
149 /** |
|
150 * Helper function for the leaving part of changing labels size |
|
151 */ |
|
152 void LabelsSizeChangedL(); |
|
153 |
|
154 /** |
|
155 * Updates the number/address popup |
|
156 */ |
|
157 void UpdatePopupL(); |
|
158 |
|
159 /** |
|
160 * Converts point's relative coordinaters into absolute screen coordinates |
|
161 */ |
|
162 void PosToScreenCoordinates( CCoeControl* aControl, TPoint& aPos ); |
|
163 |
|
164 /** |
|
165 * Launches contact image selection stylus popup menu |
|
166 */ |
|
167 void LaunchStylusPopupL( const TPointerEvent& aPointerEvent ); |
|
168 |
|
169 /** |
|
170 * Launches view image command |
|
171 */ |
|
172 void DoViewImageCmdL(); |
|
173 |
|
174 /** |
|
175 * Launches change image command |
|
176 */ |
|
177 void DoChangeImageCmdL(); |
|
178 |
|
179 /** |
|
180 * Launches remove image command |
|
181 */ |
|
182 void DoRemoveImageCmdL(); |
|
183 |
|
184 /** |
|
185 * Launches add image command |
|
186 */ |
|
187 void DoAddImageCmdL(); |
|
188 |
|
189 /** |
|
190 * Does the configuration contain phone memory |
|
191 */ |
|
192 TBool IsPhoneMemoryInConfigurationL(); |
|
193 |
|
194 /** |
|
195 * Displays contact image if available |
|
196 */ |
|
197 void ProcessContactImageDisplayL(); |
|
198 |
|
199 /** |
|
200 * The image control |
|
201 * Own. |
|
202 */ |
|
203 CEikImage* iImage; |
|
204 |
|
205 /** |
|
206 * The bitmap |
|
207 * Own. |
|
208 */ |
|
209 CFbsBitmap* iBitmap; |
|
210 CFbsBitmap* iMask; |
|
211 |
|
212 /** |
|
213 * The label controls |
|
214 * Own. |
|
215 */ |
|
216 RPointerArray<CEikLabel> iLabels; |
|
217 |
|
218 /** |
|
219 * Active listener to make asynchronic operation synchronic |
|
220 * Own. |
|
221 */ |
|
222 CCCAppCommLauncherImageDecoding* iImageDecoding; |
|
223 |
|
224 /** |
|
225 * Helper for ordering the texts |
|
226 * Own. |
|
227 */ |
|
228 CCCAppCommLauncherHeaderTextOrder* iTextOrder; |
|
229 |
|
230 /** |
|
231 * Contact image selection stylus popup menu |
|
232 * Own. |
|
233 */ |
|
234 CAknStylusPopUpMenu* iImageSelectionPopup; |
|
235 |
|
236 /** |
|
237 * Contact image selection stylus popup menu position |
|
238 * |
|
239 */ |
|
240 TPoint iPos; |
|
241 |
|
242 /** |
|
243 * Contact has an image |
|
244 * |
|
245 */ |
|
246 TBool iHasContactImage; |
|
247 |
|
248 /** |
|
249 * Command launcher to start Pbk commands |
|
250 * Own |
|
251 */ |
|
252 CCCAppCommLauncherPbkCmd* iPbkCmd; |
|
253 |
|
254 /** |
|
255 * Ref to plugin. |
|
256 * Not own. |
|
257 */ |
|
258 CCCAppCommLauncherPlugin& iPlugin; |
|
259 |
|
260 /** |
|
261 * Pointers to contact fields. |
|
262 * Pointed contact fields not own. |
|
263 */ |
|
264 RArray<CCmsContactField> iCmsContactFields; |
|
265 |
|
266 /** |
|
267 * Contact image size |
|
268 */ |
|
269 TSize iContactImageSize; |
|
270 |
|
271 /** |
|
272 * Contact image path |
|
273 * Own |
|
274 */ |
|
275 HBufC* iContactImageFullName; |
|
276 |
|
277 /** |
|
278 * Contact thumbnail data |
|
279 * Own |
|
280 */ |
|
281 HBufC8* iContactThumbnailData; |
|
282 }; |
|
283 |
|
284 #endif // CCCAPPCOMMLAUNCHERHEADERCONTROL_H |