epoc32/include/imcvcodc.inl
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/imcvcodc.inl	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,161 +0,0 @@
     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 -// which accompanies this distribution, and is available
     1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 -//
    1.11 -// Initial Contributors:
    1.12 -// Nokia Corporation - initial contribution.
    1.13 -//
    1.14 -// Contributors:
    1.15 -//
    1.16 -// Description:
    1.17 -//
    1.18 -
    1.19 -
    1.20 -//----------------------------------------------------------------------------------------
    1.21 -LOCAL_C inline TInt BlankLine(TDes8& rOutputLine, TInt& rPaddingCount)
    1.22 -//----------------------------------------------------------------------------------------
    1.23 -	{
    1.24 -	rOutputLine = KNullDesC8;
    1.25 -	rPaddingCount = KNullDesC8().Length();
    1.26 -	return 1;
    1.27 -	}
    1.28 -
    1.29 -
    1.30 -// function for adding 8 bit descriptor onto a 16bit descritpr.
    1.31 -//----------------------------------------------------------------------------------------
    1.32 -LOCAL_C inline void Append(TDes& aBuffer, const TDesC8& aAddition)
    1.33 -//----------------------------------------------------------------------------------------
    1.34 -	{
    1.35 -	TInt addLen = aAddition.Length();
    1.36 -	TInt  bufLen = aBuffer.Length();
    1.37 -
    1.38 -	aBuffer.SetLength(bufLen+addLen);
    1.39 -	for(TInt i = 0; i < addLen; i++)
    1.40 -		aBuffer[bufLen+i] = aAddition[i];
    1.41 -	}
    1.42 -
    1.43 -//----------------------------------------------------------------------------------------
    1.44 -LOCAL_C inline void Append(TDes& aBuffer, const TDesC16& aAddition)
    1.45 -//----------------------------------------------------------------------------------------
    1.46 -	{
    1.47 -	TInt addLen = aAddition.Length();
    1.48 -	TInt  bufLen = aBuffer.Length();
    1.49 -
    1.50 -	aBuffer.SetLength(bufLen+addLen);
    1.51 -	for(TInt i = 0; i < addLen; i++)
    1.52 -		aBuffer[bufLen+i] = aAddition[i];
    1.53 -	}
    1.54 -
    1.55 -
    1.56 -//----------------------------------------------------------------------------------------
    1.57 -inline TBool TImCodecQP::IsPlain( TChar aChar )
    1.58 -//----------------------------------------------------------------------------------------
    1.59 -	{
    1.60 -	TLex8 lex(iEncodeCharList);
    1.61 -	while(!lex.Eos())
    1.62 -		if ( aChar==lex.Get() ) 
    1.63 -			return EFalse;
    1.64 -
    1.65 -	if ( ((aChar >= 33) && (aChar <= 60)) || ((aChar >= 62) && (aChar <= 126)) )
    1.66 -		return ETrue;
    1.67 -
    1.68 -	lex = iPlainCharList;
    1.69 -	while(!lex.Eos())
    1.70 -		if ( aChar==lex.Get() ) 
    1.71 -			return ETrue;
    1.72 -
    1.73 -	return EFalse;
    1.74 -	}
    1.75 -
    1.76 -//----------------------------------------------------------------------------------------
    1.77 -void TImCodecQP::AddSoftLineBreak( TDes8& aPtr, TInt& aPadding, TInt& aWritten)
    1.78 -//----------------------------------------------------------------------------------------  
    1.79 -	{
    1.80 -	__ASSERT_ALWAYS( aPtr.Length()+4< aPtr.MaxLength(), gPanic(KPanicDescriptorToSmall) );
    1.81 -	aPtr.Append(KImcvSP);
    1.82 -	aPtr.Append(iQPCharacter);
    1.83 -	aPtr.Append(KImcvCRLF);
    1.84 -	aWritten+=4;
    1.85 -	aPadding+=3;
    1.86 -	}
    1.87 -
    1.88 -//----------------------------------------------------------------------------------------
    1.89 -void TImCodecQP::AddSoftLineBreak(const TUint8* apEnd, TUint8* aPtr, TInt& aPadding, TInt& aWritten)
    1.90 -//----------------------------------------------------------------------------------------  
    1.91 -	{
    1.92 -	__ASSERT_ALWAYS( aPtr+3<apEnd, gPanic(KPanicDescriptorToSmall) );
    1.93 -	*aPtr = KImcvSP;
    1.94 -	*aPtr = iQPCharacter;
    1.95 -	*aPtr = KImcvCR;
    1.96 -	*aPtr = KImcvLF;
    1.97 -	*aPtr+=4;
    1.98 -	aWritten+=4;
    1.99 -	aPadding+=3;
   1.100 -	}
   1.101 -
   1.102 -
   1.103 -//----------------------------------------------------------------------------------------
   1.104 -inline TBool TImCodec::IsDigit( TChar aChar )
   1.105 -//----------------------------------------------------------------------------------------
   1.106 -	{
   1.107 -	return ( (aChar >= '0') && (aChar <= '9') );
   1.108 -	}
   1.109 -
   1.110 -//----------------------------------------------------------------------------------------
   1.111 -inline TUint8 TImCodecQP::ReplacementChar( TChar aControlChar )
   1.112 -//----------------------------------------------------------------------------------------
   1.113 -	{
   1.114 -	if (aControlChar==CEditableText::ETabCharacter)
   1.115 -		return KImcvTab;
   1.116 -
   1.117 -	if (aControlChar==CEditableText::ENonBreakingHyphen)
   1.118 -		return KImcvHyphen;
   1.119 -
   1.120 -	if (aControlChar==CEditableText::ENonBreakingSpace)
   1.121 -		return KImcvSP;
   1.122 -
   1.123 -	return 0;
   1.124 -	}
   1.125 -
   1.126 -//----------------------------------------------------------------------------------------
   1.127 -inline void TImCodecQP::AddPlainChar( const TDesC8& aCharList )
   1.128 -//----------------------------------------------------------------------------------------
   1.129 -	{
   1.130 -	iPlainCharList.Set(aCharList);
   1.131 -	}
   1.132 -	
   1.133 -	
   1.134 -//----------------------------------------------------------------------------------------
   1.135 -inline void TImCodecQP::AddEncodeChar( const TDesC8& aCharList )
   1.136 -//----------------------------------------------------------------------------------------
   1.137 -	{
   1.138 -	iEncodeCharList.Set(aCharList);
   1.139 -	}
   1.140 -
   1.141 -//----------------------------------------------------------------------------------------
   1.142 -inline void TImCodecQP::SetQPChar( TUint8 aChar )
   1.143 -//----------------------------------------------------------------------------------------
   1.144 -	{
   1.145 -	iQPCharacter=aChar;
   1.146 -	}
   1.147 -	
   1.148 -// this function rather meanly allows a line break on a non-breaking tab and non-breaking 
   1.149 -// space, as defined in CEditableText
   1.150 -
   1.151 -//----------------------------------------------------------------------------------------
   1.152 -inline TBool TImCodecQP::IsBreakable( TChar aChar)
   1.153 -//----------------------------------------------------------------------------------------
   1.154 -	{
   1.155 -	return (aChar==' '||aChar=='\t');
   1.156 -	}
   1.157 -
   1.158 -
   1.159 -//----------------------------------------------------------------------------------------
   1.160 -inline CImConvertCharconv& CImConvertHeader::CharConv()	
   1.161 -//----------------------------------------------------------------------------------------
   1.162 -	{
   1.163 -	return iCharConv;
   1.164 -	}