epoc32/include/frmtlay.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
     1.1 --- a/epoc32/include/frmtlay.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/frmtlay.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,17 +1,20 @@
     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 -//
    1.18 +/*
    1.19 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
    1.20 +* All rights reserved.
    1.21 +* This component and the accompanying materials are made available
    1.22 +* under the terms of "Eclipse Public License v1.0"
    1.23 +* which accompanies this distribution, and is available
    1.24 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.25 +*
    1.26 +* Initial Contributors:
    1.27 +* Nokia Corporation - initial contribution.
    1.28 +*
    1.29 +* Contributors:
    1.30 +*
    1.31 +* Description: 
    1.32 +*
    1.33 +*/
    1.34 +
    1.35  
    1.36  #ifndef __FRMTLAY_H__
    1.37  #define __FRMTLAY_H__
    1.38 @@ -31,6 +34,15 @@
    1.39  class TLayDocTextSource;
    1.40  class TCursorPosition;
    1.41  
    1.42 +class TLayDocTextSource;
    1.43 +class CTmTextLayout;
    1.44 +class TTmHighlightExtensions;
    1.45 +class MTmSource;
    1.46 +class TTmFormatParamBase;
    1.47 +
    1.48 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.49 +#include <frmtlay_internal.h>
    1.50 +#endif
    1.51  
    1.52  /**
    1.53  This interface class defines an interface for clients of Form to provided 
    1.54 @@ -39,7 +51,7 @@
    1.55  Form clients is optional.
    1.56  Derived objects of this interface are registered with the CTextLayout 
    1.57  API and are called from the TLayDocTextSource class at present.
    1.58 -@publishedPartner
    1.59 +@publishedAll
    1.60  @released
    1.61  @see MTmInlineTextSource
    1.62  */
    1.63 @@ -313,7 +325,8 @@
    1.64  								   const TDesC& aText,const TPoint& aTextOrigin,TInt aExtraPixels) const;
    1.65  	IMPORT_C virtual TRgb SystemColor(TUint aColorIndex,TRgb aDefaultColor) const;
    1.66  
    1.67 -	IMPORT_C virtual void MFormCustomDraw_Reserved_1();
    1.68 +	IMPORT_C virtual void DrawText(const TParam& aParam,const TLineInfo& aLineInfo,const TCharFormat& aFormat,
    1.69 +								   const TDesC& aText,const TInt aStart, const TInt aEnd, const TPoint& aTextOrigin,TInt aExtraPixels) const;
    1.70  	IMPORT_C virtual void MFormCustomDraw_Reserved_2();
    1.71  	};
    1.72  
    1.73 @@ -385,108 +398,6 @@
    1.74  	virtual TUint Remap(TUint aChar, const TNonPrintingCharVisibility aNonPrintingCharVisibility, const TLayDocTextSource& aLayDoc) = 0;
    1.75  	};
    1.76  
    1.77 -
    1.78 -/**
    1.79 -@internalTechnology
    1.80 -Internal to Symbian
    1.81 -*/
    1.82 -NONSHARABLE_CLASS(TLayDocTextSource) : public MTmSource, public MFormLabelApi, public MTmTextDrawExt
    1.83 -	{
    1.84 -	public:
    1.85 -
    1.86 -	enum
    1.87 -		{
    1.88 -		EDefaultFontHeightIncreaseFactor = 7,
    1.89 -		EDefaultMinimumLineDescent = 3
    1.90 -		};
    1.91 -
    1.92 -	TLayDocTextSource();
    1.93 -
    1.94 -	// overrides for MTmSource pure virtual functions
    1.95 -	MGraphicsDeviceMap& FormatDevice() const;
    1.96 -	MGraphicsDeviceMap& InterpretDevice() const;
    1.97 -	TInt DocumentLength() const;
    1.98 -	void GetText(TInt aPos,TPtrC& aText,TTmCharFormat& aFormat) const;
    1.99 -	void GetParagraphFormatL(TInt aPos,RTmParFormat& aFormat) const;
   1.100 -	TInt ParagraphStart(TInt aPos) const;
   1.101 -
   1.102 -	// overrides for other MTmSource virtual functions
   1.103 -	TRgb SystemColor(TUint aColorIndex,TRgb aDefaultColor) const;
   1.104 -	CPicture* PictureL(TInt aPos) const;
   1.105 -	TInt GetPictureSizeInTwipsL(TInt aPos,TSize& aSize) const;
   1.106 -	TBool LabelModeSelect(TLabelType aType, TInt aPos);
   1.107 -	void LabelModeCancel();
   1.108 -	void LabelMetrics(TLabelType aType, TSize& aLabelSize, TInt& aMarginSize) const;
   1.109 -	TUint Map(TUint aChar) const;
   1.110 -	void SetLineHeight(const TLineHeightParam& aParam,TInt& aAscent,TInt& aDescent) const;
   1.111 -	TBool PageBreakInRange(TInt aStartPos,TInt aEndPos) const;
   1.112 -	void DrawBackground(CGraphicsContext& aGc,const TPoint& aTextLayoutTopLeft,const TRect& aRect,
   1.113 -						const TLogicalRgb& aBackground,TRect& aRectDrawn) const;
   1.114 -	void DrawLineGraphics(CGraphicsContext& aGc,const TPoint& aTextLayoutTopLeft,const TRect& aRect,
   1.115 -						  const TTmLineInfo& aLineInfo) const;
   1.116 -	void DrawText(CGraphicsContext& aGc,const TPoint& aTextLayoutTopLeft,const TRect& aRect,
   1.117 -				  const TTmLineInfo& aLineInfo,const TTmCharFormat& aFormat,
   1.118 -				  const TDesC& aText,const TPoint& aTextOrigin,TInt aExtraPixels) const;
   1.119 -	virtual void DrawPicture(CGraphicsContext& aGc,
   1.120 -							 const TPoint& aTextLayoutTopLeft, const TRect& aRect,
   1.121 -							 MGraphicsDeviceMap& aDevice, const CPicture& aPicture) const;
   1.122 -	
   1.123 -	// overrides for the MTmSource virtual functions which implements the MFormCustomWrap
   1.124 -	// if iCustomWrap is set. 
   1.125 -	TBool LineBreakPossible(TUint aPrevClass,TUint aNextClass,TBool aHaveSpaces) const;
   1.126 -	TUint LineBreakClass(TUint aCode,TUint& aRangeStart,TUint& aRangeEnd) const;
   1.127 -	TBool GetLineBreakInContext(const TDesC& aText,TInt aMinBreakPos,TInt aMaxBreakPos,
   1.128 -												 TBool aForwards,TInt& aBreakPos) const;
   1.129 -	TBool IsHangingCharacter(TUint aChar) const;
   1.130 -	
   1.131 -	// other functions
   1.132 -	TBool CanMap() const;
   1.133 -
   1.134 -	TAny* GetExtendedInterface(const TUid& aInterfaceId);
   1.135 -
   1.136 -	//MTmTextDrawExt implementations
   1.137 -	virtual void DrawLine(CGraphicsContext& aGc, const TPoint& aPt1, const TPoint& aPt2) const;
   1.138 -	virtual void DrawText(CGraphicsContext& aGc, const TDesC& aText, const TPoint& aPt) const;
   1.139 -	virtual void DrawRect(CGraphicsContext& aGc, const TRect& aRc) const;
   1.140 -
   1.141 -	//Set/reset opaque flag of aGc graphics context
   1.142 -	void SetOpaque(CGraphicsContext& aGc) const;
   1.143 -	void ResetOpaque(CGraphicsContext& aGc) const;
   1.144 -
   1.145 -	// flags
   1.146 -	enum
   1.147 -		{
   1.148 -		EWrap = 1,
   1.149 -		ETruncateWithEllipsis = 2,
   1.150 -		EUseLabelsDevice = 4
   1.151 -		};
   1.152 -
   1.153 -	MLayDoc* iLayDoc;
   1.154 -	TUint iFlags;								// wrap, truncate, etc.
   1.155 -	TInt iWidth;								// wrapping width
   1.156 -	TChar iEllipsis;							// ellipsis character (or none if 0xFFFF) used if truncating
   1.157 -	TInt iLabelsWidth;
   1.158 -	TInt iLabelsGutter;
   1.159 -	CLayoutData::TFormatMode iFormatMode;
   1.160 -	MGraphicsDeviceMap* iImageDevice;			// device map used for drawing text
   1.161 -	MGraphicsDeviceMap* iLabelsDevice;			// device map used for labels
   1.162 -	MGraphicsDeviceMap* iFormatDevice;			// device map used for formatting
   1.163 -	TInt iFontHeightIncreaseFactor;				// percentage automatically added to font heights
   1.164 -	TInt iMinimumLineDescent;					// minimum line descent in pixels
   1.165 -	TNonPrintingCharVisibility iNonPrintingCharVisibility;
   1.166 -	const MFormParam* iFormParam;				// if non-null, points to the object that supplies system colours
   1.167 -	const MFormCustomDraw* iCustomDraw;			// if non-null, points to custom drawing routines
   1.168 -	const MFormCustomWrap* iCustomWrap;			// if non-null, points to custom wrapping routines 
   1.169 -    /** Optional object able to provide a concrete customisation object for use 
   1.170 -	    internally by Form. */
   1.171 -	MFormCustomInterfaceProvider* iInterfaceProvider;
   1.172 -	TBool iDrawOpaque;						// Opaque drawing active if the flag is ETrue
   1.173 -	TInt iExcessHeightRequired;				// delta required to position the baseline so there is enough
   1.174 -											// space for the highset glyph in pixels.  
   1.175 -	MFormCustomInvisibleCharacterRemapper* iInvisibleCharacterRemapper;	// Used to customize the remapping of 
   1.176 -																		// invisible characters to visible characters
   1.177 -	};
   1.178 -
   1.179  /** 
   1.180  Text layout.
   1.181  
   1.182 @@ -663,7 +574,9 @@
   1.183  
   1.184  	To use it, construct a TTagmaForwarder object, then call InitL(), which
   1.185  	finishes background formatting, then call the MTmTextLayoutForwarder
   1.186 -	functions. 
   1.187 +	functions.
   1.188 +	
   1.189 +	The class should only be used internally by FORM component.
   1.190  	@internalComponent
   1.191  	*/
   1.192  		{
   1.193 @@ -772,6 +685,7 @@
   1.194  	IMPORT_C TInt ScrollParagraphsL(TInt& aNumParas,TAllowDisallow aScrollBlankSpace);
   1.195  	IMPORT_C TInt ScrollLinesL(TInt& aNumLines,TAllowDisallow aScrollBlankSpace = EFDisallowScrollingBlankSpace);
   1.196  	IMPORT_C TInt ChangeBandTopL(TInt& aPixels,TAllowDisallow aScrollBlankSpace = EFDisallowScrollingBlankSpace);
   1.197 +    IMPORT_C void ChangeBandTopNoLimitBorderL(TInt aPixels);
   1.198  	IMPORT_C void PageUpL(TInt& aYCursorPos,TInt& aPixelsScrolled);
   1.199  	IMPORT_C void PageDownL(TInt& aYCursorPos,TInt& aPixelsScrolled);
   1.200  	IMPORT_C TBool HandleCharEditL(TUint aType,TInt& aCursorPos,TInt& aGood,TInt& aFormattedUpTo,
   1.201 @@ -798,6 +712,7 @@
   1.202  	IMPORT_C const MFormCustomDraw* CustomDraw() const;
   1.203  	IMPORT_C void SetCustomWrap(const MFormCustomWrap* aCustomWrap);
   1.204  	IMPORT_C const MFormCustomWrap* CustomWrap() const;
   1.205 +	/* this function should only used by Symbian internally */
   1.206  	IMPORT_C void ExtendFormattingToCoverYL(TInt aYPos);
   1.207  	IMPORT_C void ExtendFormattingToCoverPosL(TInt aDocPos);
   1.208  
   1.209 @@ -872,7 +787,7 @@
   1.210  	IMPORT_C CTextLayout();
   1.211   	IMPORT_C void ConstructL(MLayDoc *aDoc,TInt aWrapWidth);
   1.212  	void InitFormatParam(TTmFormatParamBase& aParam);
   1.213 -	TInt ScrollL(TInt aDy,TAllowDisallow aScrollBlankSpace);
   1.214 +	TInt ScrollL(TInt aDy,TAllowDisallow aScrollBlankSpace,TBool aTopNoLimitBorder=EFalse,TBool aBottomNoLimitBorder=EFalse);
   1.215  	void FormatBandL(TInt aStartDocPos,TInt aEndDocPos);
   1.216  	void PruneFormatL(TBool aFromStart);
   1.217  	TInt VisibleHeightInPixels() const;
   1.218 @@ -884,7 +799,8 @@
   1.219  	static void ResetOpaque(void* aThis);
   1.220  
   1.221  
   1.222 -	CTmTextLayout iText;		// the TAGMA object that contains the text layout
   1.223 +	CTmTextLayout *iText;		// the TAGMA object that contains the text layout
   1.224 +	TInt iDummyForIText[10];	// It is only here to add padding for maintain compatibility 
   1.225  	TInt iExcessHeightRequired; // The delta required to position the baseline so there is enough 
   1.226  								// space for the highset glyph in pixels
   1.227  	RWindow *iWnd;				// the window to be used to draw
   1.228 @@ -897,7 +813,7 @@
   1.229  										 // has been initiated externally and will be ended externally as well
   1.230  	TBool iReadyToRedraw;				// If EFalse, disables CTextLayout::BeginRedraw() and 
   1.231  										// CTextLayout::EndRedraw()
   1.232 -	TInt iDummy[5];		// This dummy variable has been inserted to replace the original size of
   1.233 +	TInt iDummy[4];		// This dummy variable has been inserted to replace the original size of
   1.234  						// a variable that had to be moved to avaid a BC break because it had
   1.235  						// increased in size. Feel free to reuse this space - just reduce the size
   1.236  						// of this variable by the size of any variable you insert in front of it.
   1.237 @@ -914,11 +830,13 @@
   1.238  	TBool iParInvalid;		// if true and background formatting is happening, the remainder of the paragraph
   1.239  							// containing iUnformattedStart is invalid and must be reformatted;
   1.240  							// otherwise, formatting stops when line ends match
   1.241 -	TTmHighlightExtensions iHighlightExtensions;
   1.242 -	TLayDocTextSource iSource;	// the source of the text
   1.243 +	TTmHighlightExtensions *iHighlightExtensions;
   1.244 +	TInt iDmmyForIHighlightExtensions[3];	// It is only here to add padding for maintain compatibility 
   1.245 +	TLayDocTextSource* iSource;	// the source of the text
   1.246  	// before adding any new member variables to the end of this class, please
   1.247  	// consider whether you can insert them before the iDummy member variable
   1.248  	// further up, which currently represents wasted space.
   1.249 +	TInt iDmmyForISource[23];	// It is only here to add padding for maintain compatibility 
   1.250  	};
   1.251  
   1.252  /**
   1.253 @@ -1067,7 +985,7 @@
   1.254  // inline functions
   1.255  inline const CTmTextLayout& CTextLayout::TagmaTextLayout() const
   1.256  	{
   1.257 -	return iText;
   1.258 +	return *iText;
   1.259  	}
   1.260  
   1.261  inline void CTextLayout::GetOrigin(TPoint& aPoint) const
   1.262 @@ -1093,7 +1011,7 @@
   1.263  
   1.264  inline const TTmHighlightExtensions& CTextLayout::HighlightExtensions() const
   1.265  	{
   1.266 -	return iHighlightExtensions;
   1.267 +	return *iHighlightExtensions;
   1.268  	}
   1.269  
   1.270  /**