|
1 /* |
|
2 * Copyright (c) 2005 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 * CPostcardOperation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __POSTCARDOPERATION_H |
|
22 #define __POSTCARDOPERATION_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <f32file.h> |
|
28 #include <cmsvattachment.h> |
|
29 |
|
30 #include "PostcardDocument.h" |
|
31 #include "PostcardAppUi.h" |
|
32 |
|
33 // CONSTANTS |
|
34 |
|
35 // MACROS |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CMmsClientMtm; |
|
39 class CMsvStore; |
|
40 class MMsvAttachmentManager; |
|
41 class CMsvMimeHeaders; |
|
42 |
|
43 // DATA TYPES |
|
44 |
|
45 // FUNCTION PROTOTYPES |
|
46 |
|
47 // CLASS DECLARATION |
|
48 |
|
49 /** |
|
50 * CPostcardOperation |
|
51 * |
|
52 * @lib postcard.exe |
|
53 * @since 3.0 |
|
54 */ |
|
55 class CPostcardOperation : public CActive |
|
56 { |
|
57 public: // New methods |
|
58 |
|
59 /** |
|
60 * Destructor |
|
61 * |
|
62 * @since 3.0 |
|
63 */ |
|
64 virtual ~CPostcardOperation( ); |
|
65 |
|
66 /** |
|
67 * Returns the error code set by the operation |
|
68 */ |
|
69 virtual TInt GetError( ); |
|
70 |
|
71 /** |
|
72 * Sets iStore and iManager |
|
73 */ |
|
74 void InitL( ); |
|
75 |
|
76 /** |
|
77 * Checks the attas of the current entry |
|
78 * and marks the number of different attachs in iNumOf.. members |
|
79 * Returns error code if error was found |
|
80 */ |
|
81 TInt CheckAttasL( ); |
|
82 |
|
83 /** |
|
84 * Deletes iStore and commits iManager if iCommit is set |
|
85 */ |
|
86 void UnInitL( ); |
|
87 |
|
88 /** |
|
89 * Pure virtual. All operations are started by using this function. |
|
90 */ |
|
91 virtual void Start( TInt aArgument ) = 0; |
|
92 |
|
93 /** |
|
94 * Returns the index of attactment aId |
|
95 */ |
|
96 TInt TMsvIdToIndexL( TMsvAttachmentId& aId ); |
|
97 |
|
98 protected: // From base classes |
|
99 |
|
100 |
|
101 /** |
|
102 * Constructor. |
|
103 * |
|
104 * @since 3.0 |
|
105 */ |
|
106 CPostcardOperation( |
|
107 MPostcardOperationObserver& aOperationObserver, |
|
108 CPostcardDocument& aDocument, |
|
109 CPostcardAppUi& aAppUi, |
|
110 RFs& aFs ); |
|
111 |
|
112 /** |
|
113 * CompleteSelf |
|
114 * |
|
115 * @since 3.0 |
|
116 */ |
|
117 void CompleteSelf( TInt aError ); |
|
118 |
|
119 /** |
|
120 * Set error code |
|
121 * @param TInt error code |
|
122 */ |
|
123 void SetError( TInt aError ); |
|
124 |
|
125 /** |
|
126 * Resets error code |
|
127 */ |
|
128 void ResetError( ); |
|
129 |
|
130 /** |
|
131 * Recognises the file type according to mime type |
|
132 */ |
|
133 TPostcardFileType RecogniseFileType( const TDataType& aMimeType ); |
|
134 |
|
135 protected: // data |
|
136 |
|
137 MPostcardOperationObserver& iObserver; |
|
138 CPostcardDocument& iDocument; |
|
139 CPostcardAppUi& iAppUi; |
|
140 RFs& iFs; |
|
141 TInt iError; |
|
142 |
|
143 MMsvAttachmentManager* iManager; |
|
144 CMsvAttachment* iAttachment; |
|
145 CMsvStore* iStore; |
|
146 CMsvMimeHeaders* iHeaders; |
|
147 |
|
148 TMsvAttachmentId iImage; |
|
149 TMsvAttachmentId iText; |
|
150 TMsvAttachmentId iRecipient; |
|
151 TMsvAttachmentId iSmil; |
|
152 TInt iLaunchState; |
|
153 |
|
154 TBool iCommit; // If set, commits iManager in UnInitL |
|
155 |
|
156 }; |
|
157 |
|
158 #endif // __POSTCARDOPERATION_H |