1.1 --- a/epoc32/include/app/imcvcodc.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/app/imcvcodc.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,9 +1,9 @@
1.4 // Copyright (c) 1999-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 @@ -12,7 +12,11 @@
1.16 //
1.17 // Description:
1.18 //
1.19 -
1.20 +/**
1.21 + * @file
1.22 + * @publishedAll
1.23 + * @released
1.24 + */
1.25
1.26 #if !defined(__IMCVCODC_H__)
1.27 #define __IMCVCODC_H__
1.28 @@ -32,75 +36,12 @@
1.29 #define KBase64 _L("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")
1.30 #define KCharFormat _L("%c")
1.31
1.32 - // Maximum length allowed for an 'encoded-word' rfc2047
1.33 -const TInt KEncodedWordMaxLength = 75;
1.34 -
1.35 -// All encoding information except data and charset name length. =?B?=? => 7
1.36 -const TInt KMaxEncodedInformationLength = 7;
1.37 -
1.38 -// Length of the field name, eg "Subject: ". This may change as other fields are processed.
1.39 -const TInt KMaxHeaderFieldNameLength = 12;
1.40 -
1.41 -const TInt KImCvFinished=(-1);
1.42 -const TInt KImCvAdvance=(1);
1.43 -
1.44 -
1.45 -// error states involved in sending attachments etc.
1.46 -/**
1.47 -@internalComponent
1.48 -@deprecated
1.49 -*/
1.50 -enum TIattErrorCode
1.51 - {
1.52 - KImAttNoError = 0,
1.53 - KImAttFinished = 1
1.54 - };
1.55 -
1.56 -
1.57 -/**
1.58 -@internalComponent
1.59 -@released
1.60 -*/
1.61 -enum TImBodyConvAlgorithm
1.62 - {
1.63 - ENoAlgorithm,
1.64 - EQPEncode,
1.65 - EQPDecode,
1.66 - EBase64Encode,
1.67 - EBase64Decode,
1.68 - EUUEncode,
1.69 - EUUDecode
1.70 - };
1.71 -
1.72 -// Used in CImSendConvert
1.73 -/**
1.74 -@internalComponent
1.75 -@deprecated
1.76 -*/
1.77 -enum TImSendEncoding
1.78 - {
1.79 - ESendNoAlgorithm,
1.80 - ESendMimeAlgorithm
1.81 - };
1.82 -
1.83 -struct SAttachmentInfo
1.84 -/**
1.85 -@internalComponent
1.86 -@released
1.87 -*/
1.88 - {
1.89 - TInt iSize;
1.90 - TFileName iName;
1.91 - TFileName iPath;
1.92 - TBool iComplete;
1.93 - };
1.94 -
1.95 // Shared implementation code
1.96 //----------------------------------------------------------------------------------------
1.97 class TImCodec
1.98 //----------------------------------------------------------------------------------------
1.99 /**
1.100 -@internalAll
1.101 +@publishedAll
1.102 @released
1.103 */
1.104 {
1.105 @@ -124,7 +65,7 @@
1.106 class TImFileCodec : public TImCodec
1.107 //----------------------------------------------------------------------------------------
1.108 /**
1.109 -@internalAll
1.110 +@publishedAll
1.111 @released
1.112 */
1.113 {
1.114 @@ -143,7 +84,7 @@
1.115 class TImCodecNull : public TImFileCodec
1.116 //----------------------------------------------------------------------------------------
1.117 /**
1.118 -@internalComponent
1.119 +@publishedAll
1.120 @released
1.121 */
1.122 {
1.123 @@ -158,7 +99,7 @@
1.124 class TImCodecQP : public TImFileCodec
1.125 //----------------------------------------------------------------------------------------
1.126 /**
1.127 -@internalAll
1.128 +@publishedAll
1.129 @released
1.130 */
1.131 {
1.132 @@ -224,16 +165,9 @@
1.133 TInt iMaskShiftStored;
1.134 };
1.135
1.136 -class TImCodecB64WithLineBreaks : public TImCodecB64
1.137 -/**
1.138 -@internalComponent
1.139 -@released
1.140 -*/
1.141 - {
1.142 -public:
1.143 - TInt Encode(const TDesC8& aSrcString, TDes8& rDestString);
1.144 - };
1.145 -
1.146 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.147 +#include "cimconvertheader.h"
1.148 +#endif
1.149
1.150 // UU coding/decoding
1.151
1.152 @@ -268,93 +202,5 @@
1.153
1.154 };
1.155
1.156 +#endif
1.157
1.158 -
1.159 -
1.160 -// For converting a text string to/from encoded form
1.161 -// Note: 'Word' here has special meaning derived from the one defined in rfc2047.
1.162 -// It refers to one encoding instance.
1.163 -
1.164 -//----------------------------------------------------------------------------------------
1.165 -class CImConvertHeader : public CBase
1.166 -//----------------------------------------------------------------------------------------
1.167 -/**
1.168 -@internalTechnology
1.169 -@released
1.170 -*/
1.171 - {
1.172 -public:
1.173 - IMPORT_C static CImConvertHeader* NewL(CImConvertCharconv& aConverter);
1.174 - ~CImConvertHeader();
1.175 -
1.176 - IMPORT_C void SetMessageType(TBool aIsMIME);
1.177 - IMPORT_C void DecodeAllHeaderFieldsL(CImHeader& rHeader);
1.178 -
1.179 - // Functions for decoding & converting descriptors
1.180 -
1.181 - IMPORT_C void DecodeNonMIMEHeaderFieldL(const TDesC8& aBufIn, TDes& aBufOut);
1.182 - IMPORT_C void DecodeHeaderFieldL(const TDesC8& aBufIn, TDes& aBufOut);
1.183 - IMPORT_C void DecodeHeaderFieldL(const TDesC16& aBufIn, TDes& aBufOut);
1.184 - IMPORT_C void ConvertHeaderFieldL(const TDesC16& aBufIn, RBuf8& aBufOut, TBool aIsAddressField);
1.185 -
1.186 - // Header needed for retrieving encoding information, used in Send code.
1.187 - IMPORT_C void EncodeHeaderFieldL(const TDesC& aBufIn, RBuf8& aBufOut,
1.188 - CArrayFix<TImHeaderEncodingInfo>* aInfoArray, TInt aState, TInt aArrayVal = 0);
1.189 -
1.190 - IMPORT_C void EncodeHeaderFieldL(const TDesC& aBufIn, RBuf8& aBufOut,
1.191 - const TUint aCharset, const TImHeaderEncodingInfo::TEncodingType aType, TBool aIsAddressField);
1.192 -
1.193 - IMPORT_C TBool FindEncodedWord(TPtrC8& aData, TInt& aInit,TInt& rStart, TInt& rEnd);
1.194 -
1.195 - void Append(TDes& aBuffer, const TDesC8& aAddition);
1.196 - inline CImConvertCharconv& CharConv();
1.197 -
1.198 - IMPORT_C TUint OverrideCharset() const;
1.199 - IMPORT_C void SetOverrideCharset(TUint aCharset);
1.200 -
1.201 -private:
1.202 - void ConstructL();
1.203 - CImConvertHeader(CImConvertCharconv&);
1.204 - // Functions dealing only with single 'encoded-word's
1.205 - void GetCharsetAndEncodeDataL(const TDesC& aBufIn, RBuf8& aBufOut, TImHeaderEncodingInfo& aInfo);
1.206 - void EncodeWordL(const TDesC& aBufIn, RBuf8& aBufOut, TImHeaderEncodingInfo& aInfo,
1.207 - const TDesC8& aCharsetName, RBuf8& aEncodedWord);
1.208 -
1.209 - TBool DecodeWordL(const TDesC8& aBufIn, TDes& aBufOut, TInt rRemainder);
1.210 - void DecodeRecipientListL( CDesCArray& aArray);
1.211 - void DecodeFieldL(const TDesC& aField);
1.212 -
1.213 - TBool DoCharsetConversionL(const TDesC& aDataToConvert, RBuf8& aEncodedWord);
1.214 -
1.215 - void DoEncodingL(RBuf8& aEncodedWord, TImHeaderEncodingInfo& aInfo);
1.216 -
1.217 - TInt AddEncodedWordInfoL(const TDesC8& aEncodedWord, RBuf8& aBufOut,
1.218 - TImHeaderEncodingInfo& aInfo, const TDesC8& aCharsetName);
1.219 -
1.220 - TBool IsAscii( TUint aChar ) const;
1.221 - TBool ExtractTextToEncode(const TDesC& aBufIn, TInt& rStart, TInt& rEnd, TBool aIsAddressField);
1.222 - void Insert(TDes8& aBuffer, const TDesC16& aInsert);
1.223 -
1.224 -private:
1.225 - TImHeaderEncodingInfo iEncodingInfo;
1.226 - CImConvertCharconv& iCharConv;
1.227 -
1.228 - // Get access to QP/ Base64 encoding/decoding functions
1.229 - TImCodecB64 iB64Codec;
1.230 - TImCodecQP iQPCodec;
1.231 -
1.232 - // Need in the narrow build, to check if possible to convert to/from
1.233 - // the machines character set.
1.234 - TUint iCharacterSetId;
1.235 -
1.236 - CImHeader* iHeader;
1.237 -
1.238 - // Converted static variables used in EncodeWordL()
1.239 - TBool isMIMEMessageHeader;
1.240 - TUint iOverrideCharset;
1.241 - };
1.242 -
1.243 -
1.244 -#include <imcvcodc.inl>
1.245 -
1.246 -#endif