|
1 /* |
|
2 * Copyright (c) 2007 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: CMnActiveCallback class implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 #include "mnmapimage.h" |
|
22 #include "mnmapimageserviceclient.h" |
|
23 #include "mnactivecallback.h" |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 CMnActiveCallback::CMnActiveCallback( |
|
29 CMnMapImage& aOwner, |
|
30 RMnMapImageServiceClient& aSession ) |
|
31 : CActive( CActive::EPriorityStandard ), |
|
32 iOwner( aOwner ), |
|
33 iSession( aSession ) |
|
34 { |
|
35 CActiveScheduler::Add( this ); |
|
36 } |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 CMnActiveCallback* CMnActiveCallback::NewL( |
|
42 CMnMapImage& aOwner, |
|
43 RMnMapImageServiceClient& aSession ) |
|
44 { |
|
45 CMnActiveCallback* self = new (ELeave) CMnActiveCallback( aOwner, aSession ); |
|
46 return self; |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 void CMnActiveCallback::StartL( |
|
53 CFbsBitmap& aBitmap, |
|
54 MMnMapImageRenderCallback& aCallback ) |
|
55 { |
|
56 ASSERT( !IsActive() ); |
|
57 iCallback = &aCallback; |
|
58 iOwner.RenderL( aBitmap, iStatus ); |
|
59 SetActive(); |
|
60 } |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 void CMnActiveCallback::RunL() |
|
66 { |
|
67 ASSERT( iCallback ); |
|
68 iCallback->HandleRenderingCompletedL( iStatus.Int(), iOwner ); |
|
69 } |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 void CMnActiveCallback::DoCancel() |
|
75 { |
|
76 iSession.Cancel(); |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 TInt CMnActiveCallback::RunError( TInt /*aError*/ ) |
|
83 { |
|
84 return KErrNone; |
|
85 } |