1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
12 // |
12 // |
13 // Description: |
13 // Description: |
14 // |
14 // MSVSTORE.H |
15 |
15 // |
|
16 /** |
|
17 * @file |
|
18 * @publishedAll |
|
19 * @released |
|
20 */ |
16 #if !defined(__MSVSTORE_H__) |
21 #if !defined(__MSVSTORE_H__) |
17 #define __MSVSTORE_H__ |
22 #define __MSVSTORE_H__ |
18 |
23 |
19 #include <e32base.h> |
24 #include <e32base.h> |
20 #include <s32file.h> |
25 #include <s32file.h> |
69 // The entry structure that the client uses |
74 // The entry structure that the client uses |
70 // |
75 // |
71 |
76 |
72 /* |
77 /* |
73 Uid which are not needed to be known outside CMsvStore |
78 Uid which are not needed to be known outside CMsvStore |
74 @internalComponent |
79 @publishedAll |
75 @deprecated |
80 @released |
76 */ |
81 */ |
77 const TUid KMsvEntryRichTextBody={0x10000F70}; |
82 const TUid KMsvEntryRichTextBody={0x10000F70}; |
78 |
|
79 |
|
80 /** |
|
81 UId for the 16-bit chunk storage mechanism. |
|
82 @internalTechnology |
|
83 @prototype |
|
84 */ |
|
85 const TUid KMsvPlainBodyText16={0x10000F90}; |
|
86 |
|
87 /** |
|
88 UId for the 8-bit chunk storage mechanism. |
|
89 @internalTechnology |
|
90 @prototype |
|
91 */ |
|
92 const TUid KMsvPlainBodyText8={0x10000F80}; |
|
93 |
83 |
94 class MMsvAttachmentManager; |
84 class MMsvAttachmentManager; |
95 class MMsvAttachmentManagerSync; |
85 class MMsvAttachmentManagerSync; |
96 class CMsvAttachmentManager; |
86 class CMsvAttachmentManager; |
97 class MMsvStoreManager; |
87 class MMsvStoreManager; |
98 class CMsvPlainBodyText; |
88 class CMsvPlainBodyText; |
|
89 |
|
90 |
99 class CMsvStore : public CBase |
91 class CMsvStore : public CBase |
100 /** Provides an interface over the message store that is associated with a message |
92 /** Provides an interface over the message store that is associated with a message |
101 entry. It is similar to the dictionary store in supporting the concept of |
93 entry. It is similar to the dictionary store in supporting the concept of |
102 streams referenced by UID. |
94 streams referenced by UID. |
103 |
95 |
138 IMPORT_C void RemoveL(TUid aUid); |
130 IMPORT_C void RemoveL(TUid aUid); |
139 IMPORT_C void Revert(); |
131 IMPORT_C void Revert(); |
140 IMPORT_C void RevertL(); |
132 IMPORT_C void RevertL(); |
141 IMPORT_C TInt Commit(); |
133 IMPORT_C TInt Commit(); |
142 IMPORT_C void CommitL(); |
134 IMPORT_C void CommitL(); |
143 |
135 |
|
136 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB) |
|
137 IMPORT_C TBool IsDbStore(); |
|
138 void CommitHeaderL(); |
|
139 #endif |
|
140 |
144 // Attachment Management |
141 // Attachment Management |
145 IMPORT_C MMsvAttachmentManager& AttachmentManagerL(); |
142 IMPORT_C MMsvAttachmentManager& AttachmentManagerL(); |
146 IMPORT_C MMsvAttachmentManagerSync& AttachmentManagerExtensionsL(); |
143 IMPORT_C MMsvAttachmentManagerSync& AttachmentManagerExtensionsL(); |
147 |
144 |
148 // APIs to get the CMsvPlainBodyText interface. |
145 // APIs to get the CMsvPlainBodyText interface. |
149 IMPORT_C CMsvPlainBodyText* InitialisePlainBodyTextForWriteL(TBool aIs8Bit, TUint aCharsetId, TUint aDefaultCharsetId); |
146 IMPORT_C CMsvPlainBodyText* InitialisePlainBodyTextForWriteL(TBool aIs8Bit, TUint aCharsetId, TUint aDefaultCharsetId); |
150 IMPORT_C CMsvPlainBodyText* InitialisePlainBodyTextForReadL(TInt aChunkLength); |
147 IMPORT_C CMsvPlainBodyText* InitialisePlainBodyTextForReadL(TInt aChunkLength); |
151 |
148 |
152 /** |
|
153 @internalTechnology |
|
154 @released |
|
155 */ |
|
156 IMPORT_C void CreateShareProtectedAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, CMsvAttachment* aAttachmentInfo); |
149 IMPORT_C void CreateShareProtectedAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, CMsvAttachment* aAttachmentInfo); |
157 void Restore8BitBodyTextL(RFileReadStream& aInputStream); |
150 void Restore8BitBodyTextL(RFileReadStream& aInputStream); |
158 |
|
159 protected: |
151 protected: |
160 |
152 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB) |
|
153 IMPORT_C static CMsvStore* OpenForReadL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId, TUid aMtmId); |
|
154 IMPORT_C static CMsvStore* OpenForWriteL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId, TUid aMtmId); |
|
155 #endif |
161 IMPORT_C CMsvStore(MMsvStoreObserver& aObserver, RFs& aFs, TMsvId aId, MMsvStoreManager& aStoreManager); |
156 IMPORT_C CMsvStore(MMsvStoreObserver& aObserver, RFs& aFs, TMsvId aId, MMsvStoreManager& aStoreManager); |
162 IMPORT_C static CMsvStore* OpenForReadL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId); |
157 IMPORT_C static CMsvStore* OpenForReadL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId); |
163 IMPORT_C static CMsvStore* OpenForWriteL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId); |
158 IMPORT_C static CMsvStore* OpenForWriteL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId); |
164 |
159 |
165 private: |
160 private: |
166 |
161 |
167 |
|
168 void ConstructL(TBool aReadOnly); |
162 void ConstructL(TBool aReadOnly); |
169 |
163 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB) |
|
164 void ConstructDbL(TUid aMtmId,TBool aReadOnly); |
|
165 void RestoreL(); |
|
166 void LoadHeaderEntryL(const TUid aMtmId, TBool aUid); |
|
167 #endif |
|
168 |
170 //Methods to handle plain bodytext. |
169 //Methods to handle plain bodytext. |
171 void RestorePlainBodyTextL(CRichText& aRichText, TUint aCharsetOverride); |
170 void RestorePlainBodyTextL(CRichText& aRichText, TUint aCharsetOverride); |
172 void GetRichTextFrom8BitL(RFile& aBodyTextFile, CRichText& aRichText, TUint aCharSet, TUint aDefaultCharSet); |
171 void GetRichTextFrom8BitL(RFile& aBodyTextFile, CRichText& aRichText, TUint aCharSet, TUint aDefaultCharSet); |
173 void GetRichTextFrom16BitL(RFile& aBodyTextFile, CRichText& aRichText); |
172 void GetRichTextFrom16BitL(RFile& aBodyTextFile, CRichText& aRichText); |
174 void Convert8BitToRichTextL(RFile& aBodyTextFile, CRichText& aRichText, TUint aCharSet, TUint aDefaultCharSet); |
173 void Convert8BitToRichTextL(RFile& aBodyTextFile, CRichText& aRichText, TUint aCharSet, TUint aDefaultCharSet); |
241 void AssignLC(CMsvCachedStore &aStore, TUid aUid); |
244 void AssignLC(CMsvCachedStore &aStore, TUid aUid); |
242 }; |
245 }; |
243 |
246 |
244 |
247 |
245 |
248 |
246 #endif |
249 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB) |
|
250 |
|
251 /** Accesses the message store with write access, or creates new header entry. |
|
252 Before it is used, a CMsvStore must have been opened on the message store |
|
253 with write access. |
|
254 |
|
255 This class is intended for use by MTM implementations to store MTM-specific |
|
256 information. Message client applications access the store through the higher-level |
|
257 functions provided by Client-side and User Interface MTMs. |
|
258 |
|
259 @publishedAll |
|
260 @released |
|
261 */ |
|
262 class TMsvWriteStore |
|
263 { |
|
264 public: |
|
265 IMPORT_C TMsvWriteStore(CMsvStore& aMsvStore); |
|
266 IMPORT_C void AssignL(CHeaderFields* aHeaderFields); |
|
267 IMPORT_C void CommitL(); |
|
268 public: |
|
269 CMsvStore& iMsvStore; |
|
270 }; |
|
271 |
|
272 /** Accesses the a message store with read access. |
|
273 |
|
274 Before it is used, |
|
275 a CMsvStore must have been opened on the message store with read or read/write |
|
276 access. |
|
277 |
|
278 This class is intended for use by MTM implementations to store MTM-specific |
|
279 information. Message client applications access the store through the higher-level |
|
280 functions provided by Client-side and User Interface MTMs. |
|
281 |
|
282 @publishedAll |
|
283 @released |
|
284 */ |
|
285 |
|
286 class TMsvReadStore |
|
287 { |
|
288 public: |
|
289 IMPORT_C TMsvReadStore(CMsvStore& aMsvStore, TUid aUid); |
|
290 IMPORT_C void LoadL(CHeaderFields*& aHeaderFields); |
|
291 IMPORT_C void ReadL(CHeaderFields*& aHeaderFields); |
|
292 public: |
|
293 CMsvStore& iMsvStore; |
|
294 TUid iUid; |
|
295 }; |
|
296 #endif |
|
297 |
|
298 #endif |