epoc32/include/app/miuthdr.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/app/miuthdr.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/app/miuthdr.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,15 @@
    1.16  // Contributors:
    1.17  //
    1.18  // Description:
    1.19 +// MIUTHDR.H
    1.20  //
    1.21  
    1.22 +/**
    1.23 + * @file 
    1.24 + * @publishedAll
    1.25 + * @released
    1.26 + */
    1.27 +
    1.28  #ifndef __MIUTHDR_H__
    1.29  #define __MIUTHDR_H__
    1.30  
    1.31 @@ -22,69 +29,36 @@
    1.32  #include <msvstd.h>
    1.33  #include <msvids.h>			// KMsvNullIndexEntryId
    1.34  #include <miutstd.hrh>			// KUidMsvEmailTextEntryValue
    1.35 -
    1.36 -// IMail-specific stream type within an IMail file store for CImHeader
    1.37 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS  
    1.38 +#include "timrfc822datefield.h"
    1.39 +#endif
    1.40 +/** 
    1.41 + * IMail-specific stream type within an IMail file store for CImHeader
    1.42 + * @publishedAll
    1.43 + * @released
    1.44 + */
    1.45  const TUid KUidMsgFileMimeHeader	= {0x1000160F};		// 268441103 decimal
    1.46 -// IMail-specific stream type within an IMail file store for CImMimeHeader
    1.47 +/** 
    1.48 + * IMail-specific stream type within an IMail file store for CImMimeHeader
    1.49 + * @publishedAll
    1.50 + * @released
    1.51 + */
    1.52  const TUid KUidMsgFileIMailHeader	= {0x100001D8};		// 268435928 decimal
    1.53  
    1.54 -// Identifies which version of CImHeader has been stored in stream
    1.55 -const TUint16 KImHeaderVersion = 2; 
    1.56 -
    1.57 -const TUid KUidMsvEmailTextEntry			= {KUidMsvEmailTextEntryValue};
    1.58 -const TUid KUidMsvEmailHtmlEntry			= {KUidMsvEmailHtmlEntryValue};
    1.59 -const TUid KUidMsvEmailExternalBodyEntry	= {KUidMsvEmailExternalBodyEntryValue};
    1.60 -const TUid KUidMsvEmailRtfEntry				= {KUidMsvEmailRtfEntryValue};
    1.61 -
    1.62 -
    1.63 -_LIT8(KMiutDateFormat, " %S, %2d %S %04d %02d:%02d:%02d ");
    1.64 -_LIT8(KMiutMonthNames, "JanFebMarAprMayJunJulAugSepOctNovDec");
    1.65 -_LIT8(KMiutDayNames, "MonTueWedThuFriSatSun");
    1.66 -_LIT8(KMiutTimeZoneNeg, "-%02d%02d");
    1.67 -_LIT8(KMiutTimeZonePos, "+%02d%02d");
    1.68 -
    1.69 -_LIT8(KMiutBase64String, "Base64");
    1.70 -_LIT8(KMiutQPString, "quoted-printable");
    1.71 -_LIT8(KMiut7BitString, "7bit");
    1.72 -_LIT8(KMiut8BitString, "8bit");
    1.73 -_LIT8(KMiutBinaryString, "binary");
    1.74 -_LIT8(KMiutUUString, "uuencode");
    1.75 -
    1.76 -_LIT8(KMiutWildcardBase64, "*base64*");
    1.77 -_LIT8(KMiutWildcardQP, "*quoted-printable*");
    1.78 -_LIT8(KMiutWildcard7Bit, "*7bit*");
    1.79 -_LIT8(KMiutWildcard8Bit, "*8bit*");
    1.80 -_LIT8(KMiutWildcardBinary, "*binary*");
    1.81 -_LIT8(KMiutWildcardUU, "*uu*");
    1.82 -
    1.83 -#define KMiutEmptyString KNullDesC
    1.84 -
    1.85 -_LIT(KMiutFormatString, "%S");
    1.86 -_LIT(KImEngineResourceFile, "\\resource\\messaging\\imcm.rsc");
    1.87 -
    1.88 -const TInt KMiutDateStringLength	= 32;
    1.89 -const TInt KCenturyThreshold		= 100;
    1.90 -const TInt KCenturyOffset			= 70;
    1.91 -const TInt KThisCentury				= 1900;	// as defined in 1998
    1.92 -const TInt KNextCentury				= 2000;
    1.93 -
    1.94 +/** 
    1.95 + * @publishedAll
    1.96 + * @released
    1.97 + */
    1.98  class CMsvStore;
    1.99  class TMsvEntry;
   1.100  class RMsvReadStream;
   1.101  class RMsvWriteStream;
   1.102 -class CImConvertHeader;
   1.103 +/** 
   1.104 + * @internalTechnology
   1.105 + * @released
   1.106 + */
   1.107  class CImEncodedHeader;
   1.108  
   1.109 -void CopyArrayL(const CDesCArray& aSource, CDesCArray& aDestination);
   1.110 -
   1.111 -// Maximum size for descriptors stored in HBufC members of CImHeader = 1000 chars
   1.112 -const TInt KMaxImHeaderStringLength = 1000;
   1.113 -const TInt KMaxImMimeFieldLength	= 1000;
   1.114 -const TInt KImMailMaxBufferSize		= 1000;	// 1000 is defined by the SMTP spec as max space
   1.115 -const TInt KSmtpMaxBufferExcludingCRLF = 979; // Line length limit is 1000 chars per line including CRLF (RFC2822, Section 2.1.1)
   1.116 -                                              // 1000 chars including "Field name: "+"Field body"+CRLF (here "Resent-Message-ID: " is largest field)
   1.117 -
   1.118 -
   1.119  /** Defines how emails will be encoded when they are sent.
   1.120  
   1.121  MIME standards are defined in RFC 2045, RFC 2046 and RFC 2047. 
   1.122 @@ -260,6 +234,7 @@
   1.123  	IMPORT_C void StoreL  (CMsvStore& aMessageStore) const;
   1.124  	IMPORT_C void StoreWithoutCommitL(CMsvStore& aMessageStore) const;
   1.125  
   1.126 +
   1.127  	// the bulk of the member functions are accessors & mutators so we can use
   1.128  	// objects of the class as data repositories during the data-marshalling stage
   1.129  	// of getting imail headers to/from the internet
   1.130 @@ -372,6 +347,14 @@
   1.131  	//finds the duplicate recipients in To and Cc list
   1.132  	TBool IsRecipientPresent(CImHeader& aCImHeader, TPtrC16 newRecipient);
   1.133  
   1.134 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
   1.135 +	void ReStoreDBL(CMsvStore& aMessageStore);
   1.136 +	void StoreDBL  (CMsvStore& aMessageStore) const;
   1.137 +	void CreateImHeaderArrayListL(TDesC16& aStr, CDesCArray& aRecipients);
   1.138 +	void CreateEncodingInfoL(TDesC16& aEncodingStr);
   1.139 +	HBufC16* Convert8to16L(const TDesC8& aStr) const;
   1.140 +	void CreateBufferL( RBuf16& aBuf, CDesCArray& aRecipients)const;
   1.141 +#endif 
   1.142  private:
   1.143  	TUint16 iVersion;
   1.144  
   1.145 @@ -405,24 +388,11 @@
   1.146  	TUint							i822HeaderCharset; 
   1.147  
   1.148  	CImEncodedHeader* iEncodedHeader;
   1.149 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
   1.150 +	friend class CTestEmailHeaderStoreReStore;
   1.151 +#endif 
   1.152  	};
   1.153  
   1.154 -class TImRfc822DateField
   1.155 -/**
   1.156 -@internalTechnology
   1.157 -@released
   1.158 -*/
   1.159 -	{
   1.160 -public:
   1.161 -	IMPORT_C TInt ParseDateField(const TDesC8& aRfc822DateField, TTime& rTime);
   1.162 -	IMPORT_C void SetDate(const TTime& aTimeDate, TDes8& rOutputLine);	// NB assumes that "Date: " string has already been inserted into  rOutputLine
   1.163 -
   1.164 -private:
   1.165 -	TBool GetMonth( const TDesC8& name, TMonth& month );
   1.166 -	TBool GetTimezone( const TDesC8& name, TInt& minsOffset );
   1.167 -	};
   1.168 -
   1.169 -
   1.170  /** Folder type flags.
   1.171  
   1.172  The flags correspond to the MIME multipart subtype. 
   1.173 @@ -724,9 +694,10 @@
   1.174  	// streaming operations
   1.175  	IMPORT_C void InternalizeL( RMsvReadStream& aReadStream );
   1.176  	IMPORT_C void ExternalizeL( RMsvWriteStream& aWriteStream ) const;
   1.177 +	IMPORT_C void StoreWithoutCommitL(CMsvStore& aMessageStore) const;
   1.178  	IMPORT_C void RestoreL( CMsvStore& aMessageStore );
   1.179  	IMPORT_C void StoreL  ( CMsvStore& aMessageStore ) const;
   1.180 -	IMPORT_C void StoreWithoutCommitL(CMsvStore& aMessageStore) const;
   1.181 +
   1.182  
   1.183  	/** Sets the Content-Type field value (e.g. "text" in Content-Type:text/plain). 
   1.184  	
   1.185 @@ -815,6 +786,12 @@
   1.186  	void ConstructL();
   1.187  	TBool ArrayEntryExists(CDesCArray& aArray, TInt aField);
   1.188  
   1.189 +#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
   1.190 +	void ReStoreMimeDBL(CMsvStore& aMessageStore);
   1.191 +	void StoreMimeDBL  (CMsvStore& aMessageStore) const;
   1.192 +	void CreateMimeArrayListL(TPtrC16 astr1 ,TInt ai);
   1.193 +	TInt BufSize() const;
   1.194 +#endif 
   1.195  private:
   1.196  	TUint16 iVersion;
   1.197  	HBufC8* iRelativePath;
   1.198 @@ -844,6 +821,37 @@
   1.199  
   1.200  
   1.201  
   1.202 +/**
   1.203 + * Convert16to8L()
   1.204 + *
   1.205 + * Convert the 16 bit descripter to 8 bit.
   1.206 + * @param astr A descripter to be convert into 8 bit discripter.
   1.207 + * @return HBufC16* A 8 bit discripter.
   1.208 + */
   1.209 +static inline HBufC8* Convert16to8L(TDesC16& aStr)//const
   1.210 +	{
   1.211 +	HBufC8* newFrom1 = HBufC8::NewL(aStr.Length());
   1.212 +	newFrom1->Des().Copy(aStr);
   1.213 +	return newFrom1;
   1.214 +	}
   1.215 +
   1.216 +
   1.217 +/**
   1.218 + * ConvertToTInt()
   1.219 + * 
   1.220 + * Converts a string to an integer.
   1.221 + * @param aStr A string to make Integer.
   1.222 + * @return TInt A integer value 
   1.223 + */
   1.224 +static inline TInt ConvertToTInt(TDesC16& aStr)
   1.225 +	{
   1.226 +	TLex string(aStr);
   1.227 +	TInt32 stringIntValue;
   1.228 +	string.Val(stringIntValue);
   1.229 +	return stringIntValue;
   1.230 +	}
   1.231 +
   1.232 +
   1.233  #include <miuthdr.inl>
   1.234  
   1.235  #endif // #defined __MIUTHDR_H__