|
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: ESMR imap calendar entry retriever definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRIMAPICALRETRIEVER_H |
|
20 #define CESMRIMAPICALRETRIEVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 //<cmail> |
|
24 #include "mesmragnimportobserver.h" |
|
25 #include "CFSMailCommon.h" |
|
26 //</cmail> |
|
27 #include "cesmricalviewerasynccommand.h" |
|
28 |
|
29 class CFSMailClient; |
|
30 class CCalEntry; |
|
31 class CESMRAgnExternalInterface; |
|
32 class CFSMailMessagePart; |
|
33 class CESMRImapMailFetcherCmd; |
|
34 class TESMRInputParams; |
|
35 class CESMRAttachmentInfo; |
|
36 |
|
37 /** |
|
38 * CESMRImapIcalRetriever is responsible for parsing iCal information |
|
39 * from email message and importing it to calendar entry. |
|
40 */ |
|
41 NONSHARABLE_CLASS( CESMRImapIcalRetrieverCmd ) : |
|
42 public CESMRIcalViewerAsyncCommand, |
|
43 public MESMRAgnImportObserver, |
|
44 public MESMRIcalViewerObserver |
|
45 { |
|
46 public: // Construction and destruction |
|
47 /** |
|
48 * Creates and initializes new CESMRInfoIcalRetriever object. Ownership |
|
49 * is transferred to caller. |
|
50 * @param aCalSession Reference to calendar database session. |
|
51 * @param aMailClient Reference to mail client. |
|
52 * @param aInputParametes Reference to input parameter structure. |
|
53 * @return Pointer to CESMRInfoIcalRetriever object. |
|
54 */ |
|
55 static CESMRImapIcalRetrieverCmd* NewL( |
|
56 CCalSession& aCalSession, |
|
57 CFSMailClient& aMailClient, |
|
58 TESMRInputParams& aInputParameters ); |
|
59 |
|
60 /** |
|
61 * C++ destructor. |
|
62 */ |
|
63 ~CESMRImapIcalRetrieverCmd(); |
|
64 |
|
65 public: // From MESMRIcalViewerAsyncCommand |
|
66 void ExecuteAsyncCommandL(); |
|
67 void CancelAsyncCommand(); |
|
68 |
|
69 public: // From MAgnImportObserver |
|
70 MESMRAgnImportObserver::TImpResponse AgnImportErrorL( |
|
71 MESMRAgnImportObserver::TImpError aType, |
|
72 const TDesC8& aUid, |
|
73 const TDesC& aContext); |
|
74 |
|
75 public: // From MESMRAgnImportObserver |
|
76 void OperationCompleted( |
|
77 MESMRIcalViewerObserver::TIcalViewerOperationResult aResult ); |
|
78 void OperationError( |
|
79 MESMRIcalViewerObserver::TIcalViewerOperationResult aResult ); |
|
80 |
|
81 private: // Implementation |
|
82 CESMRImapIcalRetrieverCmd( |
|
83 CCalSession& aCalSession, |
|
84 CFSMailClient& aMailClient, |
|
85 TESMRInputParams& aInputParameters ); |
|
86 void ConstructL(); |
|
87 void CreateEntryL( |
|
88 CFSMailMessagePart& aMessagePart, |
|
89 CFSMailMessage& aMsg); |
|
90 void CheckAttachmentDataL( |
|
91 CFSMailMessage& message ); |
|
92 void HandleMailContentL(); |
|
93 |
|
94 private: // Data |
|
95 /// Own: Calendar entry object |
|
96 CCalEntry* iConvertedEntry; |
|
97 /// Own: ICal importer object |
|
98 CESMRAgnExternalInterface* iCalImporter; |
|
99 /// Own: Mail fetcher |
|
100 CESMRImapMailFetcherCmd* iMailFetcher; |
|
101 /// Ref: Reference to mail client object |
|
102 CFSMailClient& iMailClient; |
|
103 /// Ref: Reference to input parameter structure |
|
104 TESMRInputParams& iInputParameters; |
|
105 /// Own: Command result |
|
106 MESMRIcalViewerObserver::TIcalViewerOperationResult iResult; |
|
107 /// Own: ICS filename |
|
108 HBufC* iIcsFilename; |
|
109 /// Own: Calendar part message id |
|
110 TFSMailMsgId iCalendarPartId; |
|
111 /// Own |
|
112 CESMRAttachmentInfo* iAttachmentInfo; |
|
113 }; |
|
114 |
|
115 #endif // CESMRIMAPICALRETRIEVER_H |
|
116 |
|
117 // EOF |