Update contrib.
2 * Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef __PARSELST_H__
20 #define __PARSELST_H__
25 //++ sort out definitive hash includes
28 NONSHARABLE_CLASS(CParserList) : public CBase
35 EReformatOnRecogniseFlag = (TInt)0x80000000,
36 EReformatOnRolloverFlag = 0x40000000,
37 EDefaultParserFlag = 0x20000000,
38 EParserTagMask = 0x3FFFFFFF,
39 EMaxParserIndex = 0x1FFFFFFF
46 EParserInstanceNotActive,
48 EParserIgnoringAllowFlag,
53 class CParserItem : public CBase
56 CParserItem(MParser* aParser, const TUint aTagIndex);
59 inline MParser* Parser() const {return iParser;}
60 inline TUint TagIndex() const {return iTagIndex;}
71 void ActivateParserL(MParser* aParser);
72 void DeactivateParser(MParser* aParser);
73 void ActivateDefaultParserL(MParser* aParser);
74 void DeactivateParserDefaults();
75 TBool ParseThisText(CRichText& aTextObj,TInt aStartScan,TInt aScanLength,TInt& aStartOfTags,TInt& aLength);
76 MParser* ParserWithThisTag(const TUint aTagIndex) const;
77 TUint TagForThisParser(const MParser *const aParser) const;
79 static inline TBool ReformatOnRollover(const TUint aTagIndex) {return (aTagIndex & EReformatOnRolloverFlag);}
82 static inline TBool ReformatOnRecognise(const TUint aTagIndex) {return (aTagIndex & static_cast<TUint>( EReformatOnRecogniseFlag ) );}
83 static inline TBool DefaultParser(const TUint aTagIndex) {return (aTagIndex & EDefaultParserFlag);}
85 static inline TUint MaskedTag(const TUint32 aTagIndex) {return (aTagIndex & EParserTagMask);}
87 void ActivateAParserL(MParser* aParser, const TBool aDefaultParser);
88 TBool LoopOneParser(MParser* aParser, const TUint aTagIndex, CRichText& aTextObj,
89 const TInt aStartScan, const TInt aScanLength,
90 TInt& aStartOfTags, TInt& aLength);
91 void Panic(TParserListPanic aPanic) const;
94 RPointerArray<CParserItem> iParserList; // List of active parsers (specific and default)
101 NONSHARABLE_CLASS(CParserData) : public CBase
107 CParserData(TInt aEndParse);
109 TBool HaveRange() const { return iStartParse != -1; }
110 void MergeRange(TInt aStart,TInt aOldLength,TInt aNewLength);
111 void KillRange() { iStartParse = -1; }
112 TInt StartParse() const { return iStartParse; }
113 TInt EndParse() const { return iEndParse; }
115 CParserList* iActiveParserList; // local copy because access to Dll::Tls is slow
116 MEditObserver* iEditObserver;
117 TInt iLastKnownCursor;
120 TInt iStartParse; // start of text to be parsed; -1 means none
121 TInt iEndParse; // end of text to be parsed