|
1 /* |
|
2 * Copyright (c) 2007-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: Resolve meeting request method sync command |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "emailtrace.h" |
|
19 #include "cesmricalvieweremailsynccmd.h" |
|
20 //<cmail> |
|
21 #include "esmricalvieweropcodes.hrh" |
|
22 //</cmail> |
|
23 #include <calentry.h> |
|
24 |
|
25 /// Unnamed namespace for local definitions |
|
26 namespace { |
|
27 #ifdef _DEBUG |
|
28 |
|
29 // Panic literal |
|
30 _LIT( KSMRIcalViewerEmailSyncCmd, "SMRIcalViewerEmailSyncCmd" ); |
|
31 |
|
32 /** Panic codes */ |
|
33 enum TSMRIcalViewerEmailSyncCmdPanic |
|
34 { |
|
35 EInvalidCommandId = 0 //Invalid command id |
|
36 }; |
|
37 |
|
38 void Panic( TSMRIcalViewerEmailSyncCmdPanic aPanic ) |
|
39 { |
|
40 User::Panic( KSMRIcalViewerEmailSyncCmd, aPanic ); |
|
41 } |
|
42 |
|
43 #endif // _DEBUG |
|
44 |
|
45 } // namespace |
|
46 |
|
47 // ======== MEMBER FUNCTIONS ======== |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CESMRIcalViewerEmailSyncCmd::CESMRIcalViewerEmailSyncCmd |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 CESMRIcalViewerEmailSyncCmd::CESMRIcalViewerEmailSyncCmd( |
|
54 TESMRIcalViewerOperationType aOperation, |
|
55 CCalSession& aCalSession, |
|
56 MESMRIcalViewerCallback& aCallback ) |
|
57 : CESMRIcalViewerCommandBase( |
|
58 EESMREmailCommand, |
|
59 aCalSession ), |
|
60 iCallback( aCallback), |
|
61 iOperation( aOperation ) |
|
62 { |
|
63 FUNC_LOG; |
|
64 //do nothing |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CESMRIcalViewerEmailSyncCmd::~CESMRIcalViewerEmailSyncCmd |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CESMRIcalViewerEmailSyncCmd::~CESMRIcalViewerEmailSyncCmd() |
|
72 { |
|
73 FUNC_LOG; |
|
74 CancelCommand(); |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CESMRIcalViewerResolveMRMethodSyncCmd::NewL |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 CESMRIcalViewerEmailSyncCmd* CESMRIcalViewerEmailSyncCmd::NewL( |
|
82 TESMRIcalViewerOperationType aOperation, |
|
83 CCalSession& aCalSession, |
|
84 MESMRIcalViewerCallback& aCallback ) |
|
85 { |
|
86 FUNC_LOG; |
|
87 CESMRIcalViewerEmailSyncCmd* self = |
|
88 new (ELeave) CESMRIcalViewerEmailSyncCmd( |
|
89 aOperation, |
|
90 aCalSession, |
|
91 aCallback ); |
|
92 |
|
93 CleanupStack::PushL( self ); |
|
94 self->ConstructL(); |
|
95 CleanupStack::Pop( self ); |
|
96 |
|
97 return self; |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CESMRIcalViewerEmailSyncCmd::ConstructL |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 void CESMRIcalViewerEmailSyncCmd::ConstructL() |
|
105 { |
|
106 FUNC_LOG; |
|
107 BaseConstructL(); |
|
108 } |
|
109 |
|
110 // ----------------------------------------------------------------------------- |
|
111 // CESMRIcalViewerResolveMRMethodSyncCmd::ExecuteCommandL |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 void CESMRIcalViewerEmailSyncCmd::ExecuteCommandL( |
|
115 CFSMailMessage& aMessage, |
|
116 MESMRIcalViewerObserver& aObserver ) |
|
117 { |
|
118 FUNC_LOG; |
|
119 SetObserver( &aObserver ); |
|
120 SetMessage( &aMessage ); |
|
121 |
|
122 switch ( iOperation ) |
|
123 { |
|
124 case EESMRCmdMailFlagMessage://fallthrough |
|
125 case EESMRCmdMailMarkUnread://fallthrough |
|
126 case EESMRCmdMailMarkRead: |
|
127 { |
|
128 iCallback.ProcessSyncCommandL( |
|
129 iOperation, |
|
130 *Message() ); |
|
131 } |
|
132 break; |
|
133 |
|
134 default: |
|
135 __ASSERT_DEBUG( EFalse, Panic(EInvalidCommandId) ); |
|
136 break; |
|
137 } |
|
138 |
|
139 iResult.iOpType = iOperation; |
|
140 iResult.iMessage = Message(); |
|
141 iResult.iResultCode = KErrNone; |
|
142 |
|
143 Observer()->OperationCompleted( iResult ); |
|
144 } |
|
145 |
|
146 // ----------------------------------------------------------------------------- |
|
147 // CESMRIcalViewerResolveMRMethodSyncCmd::CancelCommand |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 void CESMRIcalViewerEmailSyncCmd::CancelCommand() |
|
151 { |
|
152 FUNC_LOG; |
|
153 // No cancellation needed because command was forced synchronised |
|
154 } |
|
155 |
|
156 // EOF |
|
157 |