First public contribution.
2 * Copyright (c) 2006-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.
15 * TestLayout.h test jig for CTmTextLayout
22 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
23 #include "TAGMA_INTERNAL.H"
27 class CTestGraphicsDevice;
29 typedef void TransliterationFn(const TDesC&, TDes&);
31 class CETextSource : public CBase, public MTmSource
34 CETextSource(const CRichText& aRichText, MGraphicsDeviceMap* aDeviceMap);
35 MGraphicsDeviceMap& FormatDevice() const { return *iDeviceMap; }
36 MGraphicsDeviceMap& InterpretDevice() const { return *iDeviceMap; }
37 TInt DocumentLength() const;
38 void GetText(TInt aPos, TPtrC& aText, TTmCharFormat& aFormat) const;
39 void GetParagraphFormatL(TInt aPos, RTmParFormat& aFormat) const;
40 TInt ParagraphStart(TInt aPos) const;
41 CPicture* PictureL(TInt aPos) const;
44 const CRichText* iRichText;
45 MGraphicsDeviceMap* iDeviceMap;
48 class CTestTmTextLayout : public CBase
51 static CTestTmTextLayout* NewLC(const CRichText& aText, TInt aWrapWidth);
52 static CTestTmTextLayout* NewLC(const TDesC& aText, TInt aWrapWidth,
53 TransliterationFn* aTransliterate);
55 MTmSource& Source() { return *iSource; }
56 const MTmSource& Source() const { return *iSource; }
57 CTmTextLayout& Layout() { return *iLayout; }
58 const CTmTextLayout& Layout() const { return *iLayout; }
59 CTestGraphicsDevice& Device() const { return *iDevice; }
60 void FormatL(const TTmReformatParam& aIn, TTmReformatResult& aOut);
61 // Function to test the API: CTmTextLayout::FindAdjacentChunks()
62 void TestAdjacentChunks();
64 void ConstructL(const CRichText& aText, TInt aWrapWidth);
67 CTmTextLayout* iLayout;
68 TTmFormatParam iFormatParam;
69 CETextSource* iSource;
70 CTestGraphicsDevice* iDevice;
72 CParaFormatLayer* iParagraphFormatLayer;
73 CCharFormatLayer* iCharacterFormatLayer;