|
1 /* |
|
2 * Copyright (c) 2006 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: |
|
15 * Class implementation file |
|
16 * |
|
17 */ |
|
18 |
|
19 #include <MTMStore.h> |
|
20 |
|
21 #include "SmtpPreCreationOpBase.h" |
|
22 #include "EmailPreCreation.h" |
|
23 #include "ImumMtmLogging.h" |
|
24 |
|
25 |
|
26 |
|
27 CSmtpPreCreationOpBase::~CSmtpPreCreationOpBase() |
|
28 { |
|
29 IMUM_CONTEXT( CSmtpPreCreationOpBase::~CSmtpPreCreationOpBase, 0, KImumMtmLog ); |
|
30 IMUM_IN(); |
|
31 |
|
32 Cancel(); |
|
33 delete iOperation; |
|
34 delete iPreCreate; |
|
35 delete iMtmStore; |
|
36 delete iMailboxApi; |
|
37 iMailboxApi = NULL; |
|
38 IMUM_OUT(); |
|
39 } |
|
40 |
|
41 |
|
42 const TDesC8& CSmtpPreCreationOpBase::ProgressL() |
|
43 { |
|
44 IMUM_CONTEXT( CSmtpPreCreationOpBase::ProgressL, 0, KImumMtmLog ); |
|
45 IMUM_IN(); |
|
46 |
|
47 if(iOperation) |
|
48 { |
|
49 IMUM_OUT(); |
|
50 return iOperation->ProgressL(); |
|
51 } |
|
52 IMUM_OUT(); |
|
53 return iProgress; |
|
54 } |
|
55 |
|
56 |
|
57 void CSmtpPreCreationOpBase::DoCancel() |
|
58 { |
|
59 IMUM_CONTEXT( CSmtpPreCreationOpBase::DoCancel, 0, KImumMtmLog ); |
|
60 IMUM_IN(); |
|
61 |
|
62 if(iOperation) |
|
63 { |
|
64 iOperation->Cancel(); |
|
65 } |
|
66 // complete observer and itself |
|
67 TRequestStatus* status = &iObserverRequestStatus; |
|
68 User::RequestComplete(status, KErrCancel); |
|
69 status = &iStatus; |
|
70 if( ( *status ) == KRequestPending ) |
|
71 { |
|
72 User::RequestComplete(status, KErrCancel); |
|
73 } |
|
74 IMUM_OUT(); |
|
75 |
|
76 } |
|
77 |
|
78 |
|
79 void CSmtpPreCreationOpBase::CompleteObserver() |
|
80 { |
|
81 IMUM_CONTEXT( CSmtpPreCreationOpBase::CompleteObserver, 0, KImumMtmLog ); |
|
82 IMUM_IN(); |
|
83 |
|
84 TRequestStatus* status = &iObserverRequestStatus; |
|
85 User::RequestComplete(status, KErrNone); |
|
86 IMUM_OUT(); |
|
87 } |
|
88 |
|
89 |
|
90 void CSmtpPreCreationOpBase::CompleteThis() |
|
91 { |
|
92 IMUM_CONTEXT( CSmtpPreCreationOpBase::CompleteThis, 0, KImumMtmLog ); |
|
93 IMUM_IN(); |
|
94 |
|
95 TRequestStatus* status = &iStatus; |
|
96 User::RequestComplete(status, KErrNone); |
|
97 IMUM_OUT(); |
|
98 } |
|
99 |
|
100 |
|
101 CSmtpPreCreationOpBase::CSmtpPreCreationOpBase(CMsvSession& aMsvSession, TInt aPriority, TRequestStatus& aObserverRequestStatus) |
|
102 : CMsvOperation(aMsvSession, aPriority, aObserverRequestStatus) |
|
103 { |
|
104 IMUM_CONTEXT( CSmtpPreCreationOpBase::CSmtpPreCreationOpBase, 0, KImumMtmLog ); |
|
105 IMUM_IN(); |
|
106 |
|
107 CActiveScheduler::Add(this); |
|
108 IMUM_OUT(); |
|
109 } |
|
110 |
|
111 |
|
112 void CSmtpPreCreationOpBase::ConstructL() |
|
113 { |
|
114 IMUM_CONTEXT( CSmtpPreCreationOpBase::ConstructL, 0, KImumMtmLog ); |
|
115 IMUM_IN(); |
|
116 |
|
117 iMailboxApi = CreateEmailApiL( &iMsvSession ); |
|
118 iPreCreate = CEmailPreCreation::NewL( *iMailboxApi ); |
|
119 iMtmStore = CMtmStore::NewL(iMsvSession); |
|
120 iObserverRequestStatus = KRequestPending; |
|
121 IMUM_OUT(); |
|
122 } |
|
123 |
|
124 |
|
125 |