williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// 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
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// PRIVATE HEADER FILE CONTAINING IMPLEMENTATION SPECIFIC CLASSES
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
#ifndef __TXTFMSTM_H__
|
williamr@2
|
19 |
#define __TXTFMSTM_H__
|
williamr@2
|
20 |
|
williamr@2
|
21 |
#include <e32std.h>
|
williamr@2
|
22 |
#include <txtfrmat.h>
|
williamr@2
|
23 |
|
williamr@2
|
24 |
// forward declarations
|
williamr@2
|
25 |
class RReadStream;
|
williamr@2
|
26 |
class RWriteStream;
|
williamr@2
|
27 |
class TCharFormatX;
|
williamr@2
|
28 |
class TCharFormatXMask;
|
williamr@2
|
29 |
|
williamr@2
|
30 |
/**
|
williamr@2
|
31 |
stores format attributes as bytecode
|
williamr@2
|
32 |
@internalComponent
|
williamr@2
|
33 |
*/
|
williamr@2
|
34 |
class RFormatStream
|
williamr@2
|
35 |
{
|
williamr@2
|
36 |
public:
|
williamr@2
|
37 |
RFormatStream();
|
williamr@2
|
38 |
void CopyL(const RFormatStream& aSource);
|
williamr@2
|
39 |
void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
40 |
void InternalizeL(RReadStream& aStream);
|
williamr@2
|
41 |
void Reset();
|
williamr@2
|
42 |
const TUint8* Ptr(TInt& aSize) const;
|
williamr@2
|
43 |
void SetParaFormatL(const CParaFormat* aDesiredFormat,const TParaFormatMask& aDesiredMask,const CParaFormat* aCurrentFormat);
|
williamr@2
|
44 |
void SenseParaFormatL(CParaFormat* aParaFormat,TParaFormatMask& aMask,CParaFormat::TParaFormatGetMode aMode)const;
|
williamr@2
|
45 |
void SetCharFormatL(const TCharFormatX& aCharFormat,const TCharFormatXMask& aMask);
|
williamr@2
|
46 |
void SenseCharFormat(TCharFormatX& aCharFormat,TCharFormatXMask& aMask)const;
|
williamr@2
|
47 |
void Swap(RFormatStream& aStream);
|
williamr@2
|
48 |
|
williamr@2
|
49 |
private:
|
williamr@2
|
50 |
void AllocL(TInt aSize);
|
williamr@2
|
51 |
TInt Length(TUint8*& aPtr,TTextFormatAttribute aType)const;
|
williamr@2
|
52 |
TInt DoCalcSizeParaFormat(const CParaFormat* aDesiredFormat,TParaFormatMask aMask,const CParaFormat* aCurrentFormat);
|
williamr@2
|
53 |
void DoSetParaFormat(const CParaFormat* aDesiredFormat,TParaFormatMask aMask,const CParaFormat* aCurrentFormat);
|
williamr@2
|
54 |
void RemoveRedundantCharFormat(TCharFormatMask& aMask,const TCharFormatX& aFormat,const TCharFormatX& aEffectiveFormat);
|
williamr@2
|
55 |
TInt DoCalcSizeCharFormat(const TCharFormatX& aCharFormat,const TCharFormatXMask& aMask);
|
williamr@2
|
56 |
void DoStoreCharFormat(const TCharFormatX& aCharFormat,TCharFormatXMask aMask);
|
williamr@2
|
57 |
TUint8* StoreBullet(TUint8* aPtr,const TBullet& aSource);
|
williamr@2
|
58 |
TUint8* StoreBorder(TUint8* aPtr,TTextFormatAttribute aType,const TParaBorder& aSource);
|
williamr@2
|
59 |
TUint8* StoreTab(TUint8* aPtr,const TTabStop& aSource);
|
williamr@2
|
60 |
TInt StoreTabs(TUint8*& aPtr,const CParaFormat* aDesiredFormat,const CParaFormat* aCurrentFormat,TBool aStoreData);
|
williamr@2
|
61 |
TInt MergeTabLists(TUint8*& aPtr,const CParaFormat* aDesiredFormat,TInt aDesiredTabCount,
|
williamr@2
|
62 |
const CParaFormat* aCurrentFormat,TInt aCurrentTabCount,TBool aStoreData);
|
williamr@2
|
63 |
void StoreAllTabs(TUint8*& aPtr,const CParaFormat* aSource);
|
williamr@2
|
64 |
TUint8* Store(TUint8* aPtr,const TLogicalRgb& aRgb);
|
williamr@2
|
65 |
TUint8* Store(TUint8* aPtr,const TTypeface& aTypeface);
|
williamr@2
|
66 |
TUint8* ReadValue(TUint8* aPtr,TLogicalRgb& aRgb)const;
|
williamr@2
|
67 |
TUint8* ReadValue(TUint8* aPtr,TTypeface& aTypeface)const;
|
williamr@2
|
68 |
TUint8* ReadValue(TUint8* aPtr,TParaBorder& aBorder)const;
|
williamr@2
|
69 |
TUint8* ReadValue(TUint8* aPtr,TBullet& aBullet)const;
|
williamr@2
|
70 |
TUint8* ReadTabL(TUint8* aPtr,CParaFormat* aTarget)const;
|
williamr@2
|
71 |
|
williamr@2
|
72 |
TUint8* iBase; // start of stored bytecode
|
williamr@2
|
73 |
TUint8* iEnd; // end of stored bytecode
|
williamr@2
|
74 |
|
williamr@2
|
75 |
__DECLARE_TEST;
|
williamr@2
|
76 |
private:
|
williamr@2
|
77 |
void TestInvariantL() const;
|
williamr@2
|
78 |
TBool DoInvariantCheck() const;
|
williamr@2
|
79 |
};
|
williamr@2
|
80 |
|
williamr@2
|
81 |
#endif
|