1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/txtfmstm.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,81 @@
1.4 +// Copyright (c) 1997-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 +// PRIVATE HEADER FILE CONTAINING IMPLEMENTATION SPECIFIC CLASSES
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __TXTFMSTM_H__
1.22 +#define __TXTFMSTM_H__
1.23 +
1.24 +#include <e32std.h>
1.25 +#include <txtfrmat.h>
1.26 +
1.27 +// forward declarations
1.28 +class RReadStream;
1.29 +class RWriteStream;
1.30 +class TCharFormatX;
1.31 +class TCharFormatXMask;
1.32 +
1.33 +/**
1.34 +stores format attributes as bytecode
1.35 +@internalComponent
1.36 +*/
1.37 +class RFormatStream
1.38 + {
1.39 +public:
1.40 + RFormatStream();
1.41 + void CopyL(const RFormatStream& aSource);
1.42 + void ExternalizeL(RWriteStream& aStream) const;
1.43 + void InternalizeL(RReadStream& aStream);
1.44 + void Reset();
1.45 + const TUint8* Ptr(TInt& aSize) const;
1.46 + void SetParaFormatL(const CParaFormat* aDesiredFormat,const TParaFormatMask& aDesiredMask,const CParaFormat* aCurrentFormat);
1.47 + void SenseParaFormatL(CParaFormat* aParaFormat,TParaFormatMask& aMask,CParaFormat::TParaFormatGetMode aMode)const;
1.48 + void SetCharFormatL(const TCharFormatX& aCharFormat,const TCharFormatXMask& aMask);
1.49 + void SenseCharFormat(TCharFormatX& aCharFormat,TCharFormatXMask& aMask)const;
1.50 + void Swap(RFormatStream& aStream);
1.51 +
1.52 +private:
1.53 + void AllocL(TInt aSize);
1.54 + TInt Length(TUint8*& aPtr,TTextFormatAttribute aType)const;
1.55 + TInt DoCalcSizeParaFormat(const CParaFormat* aDesiredFormat,TParaFormatMask aMask,const CParaFormat* aCurrentFormat);
1.56 + void DoSetParaFormat(const CParaFormat* aDesiredFormat,TParaFormatMask aMask,const CParaFormat* aCurrentFormat);
1.57 + void RemoveRedundantCharFormat(TCharFormatMask& aMask,const TCharFormatX& aFormat,const TCharFormatX& aEffectiveFormat);
1.58 + TInt DoCalcSizeCharFormat(const TCharFormatX& aCharFormat,const TCharFormatXMask& aMask);
1.59 + void DoStoreCharFormat(const TCharFormatX& aCharFormat,TCharFormatXMask aMask);
1.60 + TUint8* StoreBullet(TUint8* aPtr,const TBullet& aSource);
1.61 + TUint8* StoreBorder(TUint8* aPtr,TTextFormatAttribute aType,const TParaBorder& aSource);
1.62 + TUint8* StoreTab(TUint8* aPtr,const TTabStop& aSource);
1.63 + TInt StoreTabs(TUint8*& aPtr,const CParaFormat* aDesiredFormat,const CParaFormat* aCurrentFormat,TBool aStoreData);
1.64 + TInt MergeTabLists(TUint8*& aPtr,const CParaFormat* aDesiredFormat,TInt aDesiredTabCount,
1.65 + const CParaFormat* aCurrentFormat,TInt aCurrentTabCount,TBool aStoreData);
1.66 + void StoreAllTabs(TUint8*& aPtr,const CParaFormat* aSource);
1.67 + TUint8* Store(TUint8* aPtr,const TLogicalRgb& aRgb);
1.68 + TUint8* Store(TUint8* aPtr,const TTypeface& aTypeface);
1.69 + TUint8* ReadValue(TUint8* aPtr,TLogicalRgb& aRgb)const;
1.70 + TUint8* ReadValue(TUint8* aPtr,TTypeface& aTypeface)const;
1.71 + TUint8* ReadValue(TUint8* aPtr,TParaBorder& aBorder)const;
1.72 + TUint8* ReadValue(TUint8* aPtr,TBullet& aBullet)const;
1.73 + TUint8* ReadTabL(TUint8* aPtr,CParaFormat* aTarget)const;
1.74 +
1.75 + TUint8* iBase; // start of stored bytecode
1.76 + TUint8* iEnd; // end of stored bytecode
1.77 +
1.78 + __DECLARE_TEST;
1.79 +private:
1.80 + void TestInvariantL() const;
1.81 + TBool DoInvariantCheck() const;
1.82 + };
1.83 +
1.84 +#endif