143 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdAssignDefault |
147 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdAssignDefault |
144 // --------------------------------------------------------------------------- |
148 // --------------------------------------------------------------------------- |
145 // |
149 // |
146 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdAssignDefaultL( const TDesC8& aContact ) |
150 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdAssignDefaultL( const TDesC8& aContact ) |
147 { |
151 { |
148 iCommandInProgress = ETrue; |
152 TCCAppCommandState& cmdState( iPlugin.CommandState() ); |
149 |
153 if ( !cmdState.IsRunning() ) |
150 iPbk2CommandId = EPbk2CmdDefaultSettings; |
154 { |
151 |
155 cmdState.SetRunningAndPushCleanupL(); |
152 if( iLinks ) |
156 |
153 { |
157 iPbk2CommandId = EPbk2CmdDefaultSettings; |
154 delete iLinks; |
158 |
155 iLinks = NULL; |
159 if( iLinks ) |
156 } |
160 { |
157 |
161 delete iLinks; |
158 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
162 iLinks = NULL; |
159 |
163 } |
160 if ( iLinks && iLinks->Count() > 0 ) |
164 |
161 { |
165 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
162 // operation completes by StoreReady, |
166 |
163 // StoreUnavailable or HandleStoreEventL |
167 if ( iLinks && iLinks->Count() > 0 ) |
164 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
168 { |
165 } |
169 // operation completes by StoreReady, |
166 |
170 // StoreUnavailable or HandleStoreEventL |
167 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
171 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
172 } |
|
173 |
|
174 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
175 cmdState.PopCleanup(); |
|
176 } |
168 } |
177 } |
169 |
178 |
170 // --------------------------------------------------------------------------- |
179 // --------------------------------------------------------------------------- |
171 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdViewImageL |
180 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdViewImageL |
172 // --------------------------------------------------------------------------- |
181 // --------------------------------------------------------------------------- |
173 // |
182 // |
174 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdViewImageL( const TDesC8& aContact ) |
183 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdViewImageL( const TDesC8& aContact ) |
175 { |
184 { |
176 iCommandInProgress = ETrue; |
185 TCCAppCommandState& cmdState( iPlugin.CommandState() ); |
177 |
186 if ( !cmdState.IsRunning() ) |
178 iPbk2CommandId = EPbk2CmdViewImage; |
187 { |
179 |
188 cmdState.SetRunningAndPushCleanupL(); |
180 if( iLinks ) |
189 |
181 { |
190 iPbk2CommandId = EPbk2CmdViewImage; |
182 delete iLinks; |
191 |
183 iLinks = NULL; |
192 if( iLinks ) |
184 } |
193 { |
185 |
194 delete iLinks; |
186 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
195 iLinks = NULL; |
187 |
196 } |
188 if ( iLinks && iLinks->Count() > 0 ) |
197 |
189 { |
198 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
190 // operation completes by StoreReady, |
199 |
191 // StoreUnavailable or HandleStoreEventL |
200 if ( iLinks && iLinks->Count() > 0 ) |
192 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
201 { |
193 } |
202 // operation completes by StoreReady, |
194 |
203 // StoreUnavailable or HandleStoreEventL |
195 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
204 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
205 } |
|
206 |
|
207 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
208 cmdState.PopCleanup(); |
|
209 } |
196 } |
210 } |
197 |
211 |
198 // --------------------------------------------------------------------------- |
212 // --------------------------------------------------------------------------- |
199 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdChangeImageL |
213 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdChangeImageL |
200 // --------------------------------------------------------------------------- |
214 // --------------------------------------------------------------------------- |
201 // |
215 // |
202 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdChangeImageL( const TDesC8& aContact ) |
216 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdChangeImageL( const TDesC8& aContact ) |
203 { |
217 { |
204 iCommandInProgress = ETrue; |
218 TCCAppCommandState& cmdState( iPlugin.CommandState() ); |
205 |
219 if ( !cmdState.IsRunning() ) |
206 iPbk2CommandId = EPbk2CmdChangeImage; |
220 { |
207 |
221 cmdState.SetRunningAndPushCleanupL(); |
208 if( iLinks ) |
222 |
209 { |
223 iPbk2CommandId = EPbk2CmdChangeImage; |
210 delete iLinks; |
224 |
211 iLinks = NULL; |
225 if( iLinks ) |
212 } |
226 { |
213 |
227 delete iLinks; |
214 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
228 iLinks = NULL; |
215 |
229 } |
216 if ( iLinks && iLinks->Count() > 0 ) |
230 |
217 { |
231 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
218 // operation completes by StoreReady, |
232 |
219 // StoreUnavailable or HandleStoreEventL |
233 if ( iLinks && iLinks->Count() > 0 ) |
220 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
234 { |
221 } |
235 // operation completes by StoreReady, |
222 |
236 // StoreUnavailable or HandleStoreEventL |
223 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
237 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
238 } |
|
239 |
|
240 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
241 cmdState.PopCleanup(); |
|
242 } |
224 } |
243 } |
225 |
244 |
226 // --------------------------------------------------------------------------- |
245 // --------------------------------------------------------------------------- |
227 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdRemoveImageL |
246 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdRemoveImageL |
228 // --------------------------------------------------------------------------- |
247 // --------------------------------------------------------------------------- |
229 // |
248 // |
230 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdRemoveImageL( const TDesC8& aContact ) |
249 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdRemoveImageL( const TDesC8& aContact ) |
231 { |
250 { |
232 iCommandInProgress = ETrue; |
251 TCCAppCommandState& cmdState( iPlugin.CommandState() ); |
233 |
252 if ( !cmdState.IsRunning() ) |
234 iPbk2CommandId = EPbk2CmdRemoveImage; |
253 { |
235 |
254 cmdState.SetRunningAndPushCleanupL(); |
236 if( iLinks ) |
255 |
237 { |
256 iPbk2CommandId = EPbk2CmdRemoveImage; |
238 delete iLinks; |
257 |
239 iLinks = NULL; |
258 if( iLinks ) |
240 } |
259 { |
241 |
260 delete iLinks; |
242 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
261 iLinks = NULL; |
243 |
262 } |
244 if ( iLinks && iLinks->Count() > 0 ) |
263 |
245 { |
264 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
246 // operation completes by StoreReady, |
265 |
247 // StoreUnavailable or HandleStoreEventL |
266 if ( iLinks && iLinks->Count() > 0 ) |
248 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
267 { |
249 } |
268 // operation completes by StoreReady, |
250 |
269 // StoreUnavailable or HandleStoreEventL |
251 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
270 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
271 } |
|
272 |
|
273 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
274 cmdState.PopCleanup(); |
|
275 } |
252 } |
276 } |
253 |
277 |
254 // --------------------------------------------------------------------------- |
278 // --------------------------------------------------------------------------- |
255 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdAddImageL |
279 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdAddImageL |
256 // --------------------------------------------------------------------------- |
280 // --------------------------------------------------------------------------- |
257 // |
281 // |
258 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdAddImageL( const TDesC8& aContact ) |
282 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdAddImageL( const TDesC8& aContact ) |
259 { |
283 { |
260 iCommandInProgress = ETrue; |
284 TCCAppCommandState& cmdState( iPlugin.CommandState() ); |
261 |
285 if ( !cmdState.IsRunning() ) |
262 iPbk2CommandId = EPbk2CmdAddImage; |
286 { |
263 |
287 cmdState.SetRunningAndPushCleanupL(); |
264 if( iLinks ) |
288 |
265 { |
289 iPbk2CommandId = EPbk2CmdAddImage; |
266 delete iLinks; |
290 |
267 iLinks = NULL; |
291 if( iLinks ) |
268 } |
292 { |
269 |
293 delete iLinks; |
270 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
294 iLinks = NULL; |
271 |
295 } |
272 if ( iLinks && iLinks->Count() > 0 ) |
296 |
273 { |
297 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
274 // operation completes by StoreReady, |
298 |
275 // StoreUnavailable or HandleStoreEventL |
299 if ( iLinks && iLinks->Count() > 0 ) |
276 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
300 { |
277 } |
301 // operation completes by StoreReady, |
278 |
302 // StoreUnavailable or HandleStoreEventL |
279 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
303 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
304 } |
|
305 |
|
306 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
307 cmdState.PopCleanup(); |
|
308 } |
280 } |
309 } |
281 |
310 |
282 // --------------------------------------------------------------------------- |
311 // --------------------------------------------------------------------------- |
283 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdShowOnMapL |
312 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdShowOnMapL |
284 // --------------------------------------------------------------------------- |
313 // --------------------------------------------------------------------------- |
285 // |
314 // |
286 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdShowMapL( const HBufC8* aContact, |
315 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdShowMapL( const HBufC8* aContact, |
287 TPbk2CommandId aCommandId ) |
316 TPbk2CommandId aCommandId ) |
288 { |
317 { |
289 iCommandInProgress = ETrue; |
318 TCCAppCommandState& cmdState( iPlugin.CommandState() ); |
290 |
319 if ( !cmdState.IsRunning() ) |
291 iPbk2CommandId = aCommandId; |
320 { |
292 |
321 cmdState.SetRunningAndPushCleanupL(); |
293 if( iLinks ) |
322 |
294 { |
323 iPbk2CommandId = aCommandId; |
295 delete iLinks; |
324 |
296 iLinks = NULL; |
325 if( iLinks ) |
297 } |
326 { |
298 |
327 delete iLinks; |
299 iLinks = iAppServices->ContactManager().CreateLinksLC( *aContact ); |
328 iLinks = NULL; |
300 |
329 } |
301 if ( iLinks->Count() > 0 ) |
330 |
302 { |
331 iLinks = iAppServices->ContactManager().CreateLinksLC( *aContact ); |
303 // operation completes by StoreReady, |
332 |
304 // StoreUnavailable or HandleStoreEventL |
333 if ( iLinks->Count() > 0 ) |
305 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
334 { |
306 } |
335 // operation completes by StoreReady, |
307 |
336 // StoreUnavailable or HandleStoreEventL |
308 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
337 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
338 } |
|
339 |
|
340 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
341 cmdState.PopCleanup(); |
|
342 } |
309 } |
343 } |
310 |
344 |
311 // --------------------------------------------------------------------------- |
345 // --------------------------------------------------------------------------- |
312 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdDeleteL |
346 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdDeleteL |
313 // --------------------------------------------------------------------------- |
347 // --------------------------------------------------------------------------- |
314 // |
348 // |
315 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdDeleteL( const TDesC8& aContact ) |
349 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdDeleteL( const TDesC8& aContact ) |
316 { |
350 { |
317 iCommandInProgress = ETrue; |
351 TCCAppCommandState& cmdState( iPlugin.CommandState() ); |
318 |
352 if ( !cmdState.IsRunning() ) |
319 iPbk2CommandId = EPbk2CmdDeleteMe; |
353 { |
320 |
354 cmdState.SetRunningAndPushCleanupL(); |
321 if( iLinks ) |
355 |
322 { |
356 iPbk2CommandId = EPbk2CmdDeleteMe; |
323 delete iLinks; |
357 |
324 iLinks = NULL; |
358 if( iLinks ) |
325 } |
359 { |
326 |
360 delete iLinks; |
327 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
361 iLinks = NULL; |
328 |
362 } |
329 if ( iLinks->Count() > 0 ) |
363 |
330 { |
364 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
331 // operation completes by StoreReady, |
365 |
332 // StoreUnavailable or HandleStoreEventL |
366 if ( iLinks->Count() > 0 ) |
333 ( iLinks->At( 0 ) ).ContactStore().OpenL( *this ); |
367 { |
334 } |
368 // operation completes by StoreReady, |
335 |
369 // StoreUnavailable or HandleStoreEventL |
336 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
370 ( iLinks->At( 0 ) ).ContactStore().OpenL( *this ); |
|
371 } |
|
372 |
|
373 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
374 cmdState.PopCleanup(); |
|
375 } |
337 } |
376 } |
338 |
377 |
339 // --------------------------------------------------------------------------- |
378 // --------------------------------------------------------------------------- |
340 // CCCAppCommLauncherMenuHandler::HandleError |
379 // CCCAppCommLauncherMenuHandler::HandleError |
341 // --------------------------------------------------------------------------- |
380 // --------------------------------------------------------------------------- |
342 // |
381 // |
343 void CCCAppCommLauncherPbkCmd::HandleError( TInt aError ) |
382 void CCCAppCommLauncherPbkCmd::HandleError( TInt aError ) |
344 { |
383 { |
|
384 iPlugin.CommandState().SetNotRunning(); |
|
385 |
345 if( KErrNotSupported == aError && |
386 if( KErrNotSupported == aError && |
346 (TPbk2CommandId)EPbk2ExtensionShowOnMap == iPbk2CommandId ) |
387 (TPbk2CommandId)EPbk2ExtensionShowOnMap == iPbk2CommandId ) |
347 { |
388 { |
348 // Show maps specifix error note |
389 // Show maps specifix error note |
349 HBufC* prompt = StringLoader::LoadLC( R_QTN_CCA_ERROR_NOTE_MAPS_NOT_FOUND ); |
390 HBufC* prompt = StringLoader::LoadLC( R_QTN_CCA_ERROR_NOTE_MAPS_NOT_FOUND ); |