1.1 --- a/epoc32/include/mw/msvstore.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/mw/msvstore.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,9 +1,9 @@
1.4 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 // All rights reserved.
1.6 // This component and the accompanying materials are made available
1.7 -// 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
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 // which accompanies this distribution, and is available
1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 //
1.13 // Initial Contributors:
1.14 // Nokia Corporation - initial contribution.
1.15 @@ -11,8 +11,13 @@
1.16 // Contributors:
1.17 //
1.18 // Description:
1.19 +// MSVSTORE.H
1.20 //
1.21 -
1.22 +/**
1.23 + * @file
1.24 + * @publishedAll
1.25 + * @released
1.26 + */
1.27 #if !defined(__MSVSTORE_H__)
1.28 #define __MSVSTORE_H__
1.29
1.30 @@ -71,31 +76,18 @@
1.31
1.32 /*
1.33 Uid which are not needed to be known outside CMsvStore
1.34 -@internalComponent
1.35 -@deprecated
1.36 +@publishedAll
1.37 +@released
1.38 */
1.39 const TUid KMsvEntryRichTextBody={0x10000F70};
1.40
1.41 -
1.42 -/**
1.43 -UId for the 16-bit chunk storage mechanism.
1.44 -@internalTechnology
1.45 -@prototype
1.46 -*/
1.47 -const TUid KMsvPlainBodyText16={0x10000F90};
1.48 -
1.49 -/**
1.50 -UId for the 8-bit chunk storage mechanism.
1.51 -@internalTechnology
1.52 -@prototype
1.53 -*/
1.54 -const TUid KMsvPlainBodyText8={0x10000F80};
1.55 -
1.56 class MMsvAttachmentManager;
1.57 class MMsvAttachmentManagerSync;
1.58 class CMsvAttachmentManager;
1.59 class MMsvStoreManager;
1.60 class CMsvPlainBodyText;
1.61 +
1.62 +
1.63 class CMsvStore : public CBase
1.64 /** Provides an interface over the message store that is associated with a message
1.65 entry. It is similar to the dictionary store in supporting the concept of
1.66 @@ -140,7 +132,12 @@
1.67 IMPORT_C void RevertL();
1.68 IMPORT_C TInt Commit();
1.69 IMPORT_C void CommitL();
1.70 -
1.71 +
1.72 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
1.73 + IMPORT_C TBool IsDbStore();
1.74 + void CommitHeaderL();
1.75 +#endif
1.76 +
1.77 // Attachment Management
1.78 IMPORT_C MMsvAttachmentManager& AttachmentManagerL();
1.79 IMPORT_C MMsvAttachmentManagerSync& AttachmentManagerExtensionsL();
1.80 @@ -149,24 +146,26 @@
1.81 IMPORT_C CMsvPlainBodyText* InitialisePlainBodyTextForWriteL(TBool aIs8Bit, TUint aCharsetId, TUint aDefaultCharsetId);
1.82 IMPORT_C CMsvPlainBodyText* InitialisePlainBodyTextForReadL(TInt aChunkLength);
1.83
1.84 - /**
1.85 - @internalTechnology
1.86 - @released
1.87 - */
1.88 IMPORT_C void CreateShareProtectedAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, CMsvAttachment* aAttachmentInfo);
1.89 void Restore8BitBodyTextL(RFileReadStream& aInputStream);
1.90 -
1.91 protected:
1.92 -
1.93 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
1.94 + IMPORT_C static CMsvStore* OpenForReadL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId, TUid aMtmId);
1.95 + IMPORT_C static CMsvStore* OpenForWriteL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId, TUid aMtmId);
1.96 +#endif
1.97 IMPORT_C CMsvStore(MMsvStoreObserver& aObserver, RFs& aFs, TMsvId aId, MMsvStoreManager& aStoreManager);
1.98 IMPORT_C static CMsvStore* OpenForReadL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId);
1.99 IMPORT_C static CMsvStore* OpenForWriteL(MMsvStoreObserver& aObserver, RFs& aFs, MMsvStoreManager& aStoreManager, TMsvId aId);
1.100 -
1.101 +
1.102 private:
1.103
1.104 -
1.105 void ConstructL(TBool aReadOnly);
1.106 -
1.107 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
1.108 + void ConstructDbL(TUid aMtmId,TBool aReadOnly);
1.109 + void RestoreL();
1.110 + void LoadHeaderEntryL(const TUid aMtmId, TBool aUid);
1.111 +#endif
1.112 +
1.113 //Methods to handle plain bodytext.
1.114 void RestorePlainBodyTextL(CRichText& aRichText, TUint aCharsetOverride);
1.115 void GetRichTextFrom8BitL(RFile& aBodyTextFile, CRichText& aRichText, TUint aCharSet, TUint aDefaultCharSet);
1.116 @@ -195,6 +194,10 @@
1.117 friend class CMsvServerEntry;
1.118 friend class RMsvReadStream;
1.119 friend class RMsvWriteStream;
1.120 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
1.121 +friend class TMsvWriteStore;
1.122 +friend class TMsvReadStore;
1.123 +#endif
1.124 };
1.125
1.126
1.127 @@ -243,4 +246,53 @@
1.128
1.129
1.130
1.131 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
1.132 +
1.133 +/** Accesses the message store with write access, or creates new header entry.
1.134 +Before it is used, a CMsvStore must have been opened on the message store
1.135 +with write access.
1.136 +
1.137 +This class is intended for use by MTM implementations to store MTM-specific
1.138 +information. Message client applications access the store through the higher-level
1.139 +functions provided by Client-side and User Interface MTMs.
1.140 +
1.141 +@publishedAll
1.142 +@released
1.143 +*/
1.144 +class TMsvWriteStore
1.145 + {
1.146 +public:
1.147 + IMPORT_C TMsvWriteStore(CMsvStore& aMsvStore);
1.148 + IMPORT_C void AssignL(CHeaderFields* aHeaderFields);
1.149 + IMPORT_C void CommitL();
1.150 +public:
1.151 + CMsvStore& iMsvStore;
1.152 + };
1.153 +
1.154 +/** Accesses the a message store with read access.
1.155 +
1.156 +Before it is used,
1.157 +a CMsvStore must have been opened on the message store with read or read/write
1.158 +access.
1.159 +
1.160 +This class is intended for use by MTM implementations to store MTM-specific
1.161 +information. Message client applications access the store through the higher-level
1.162 +functions provided by Client-side and User Interface MTMs.
1.163 +
1.164 +@publishedAll
1.165 +@released
1.166 +*/
1.167 +
1.168 +class TMsvReadStore
1.169 + {
1.170 +public:
1.171 + IMPORT_C TMsvReadStore(CMsvStore& aMsvStore, TUid aUid);
1.172 + IMPORT_C void LoadL(CHeaderFields*& aHeaderFields);
1.173 + IMPORT_C void ReadL(CHeaderFields*& aHeaderFields);
1.174 +public:
1.175 + CMsvStore& iMsvStore;
1.176 + TUid iUid;
1.177 + };
1.178 #endif
1.179 +
1.180 +#endif