os/graphics/graphicsdeviceinterface/directgdi/test/tcontextbase.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent - Internal Symbian test code 
    20 */
    21 
    22 #ifndef TCONTEXTBASE_H
    23 #define TCONTEXTBASE_H
    24 
    25 #include <graphics/directgditypes.h>
    26 #include <gdi.h>
    27 
    28 // Forward declarations.
    29 //
    30 class CFbsBitGc;
    31 class CDirectGdiContext;
    32 class CFbsBitGcFont;
    33 class CDirectGdiDriver;
    34 class CFbsBitmapDevice;
    35 class RDirectGdiDrawableSource;
    36 class RDirectGdiImageTarget;
    37 
    38 /**
    39 Struct to allow the equivalent of an image source to be drawn using BitGdi when testing the
    40 DrawResource methods. When an image source is created for testing, rotated bitmap versions
    41 of it are also created to allow the tests to be drawn in BitGdi using DrawBitmap
    42 */
    43 struct TDrawableSourceAndEquivRotatedBmps
    44 	{
    45 	TDrawableSourceAndEquivRotatedBmps() :
    46 		iDrawableSrc(NULL),
    47 		iBmpRotNone(NULL),
    48 		iBmpRot90(NULL),
    49 		iBmpRot180(NULL),
    50 		iBmpRot270(NULL)
    51 	{
    52 	}
    53 	
    54 	RDirectGdiDrawableSource* iDrawableSrc;
    55 	CFbsBitmap* iBmpRotNone;
    56 	CFbsBitmap* iBmpRot90;
    57 	CFbsBitmap* iBmpRot180;
    58 	CFbsBitmap* iBmpRot270;
    59 	};
    60 
    61 /**
    62 Base class for Contexts in Test.
    63 */
    64 class CTContextBase : public CBase
    65 	{
    66 public:
    67 	virtual void SetOrigin(const TPoint& aOrigin) = 0;
    68 	virtual void SetClippingRegion(const TRegion& aRegion) = 0;
    69 	virtual void ResetClippingRegion() = 0;
    70 	virtual void SetDrawMode(DirectGdi::TDrawMode aMode) = 0;
    71 	virtual void SetPenColor(const TRgb& aColor) = 0;
    72 	virtual void SetPenStyle(DirectGdi::TPenStyle aStyle) = 0;
    73 	virtual void SetPenSize(const TSize& aSize) = 0;
    74 	virtual void SetTextShadowColor(const TRgb& aColor) = 0;
    75 	virtual void SetBrushColor(const TRgb& aColor) = 0;
    76 	virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle) = 0;
    77 	virtual void SetBrushOrigin(const TPoint& aOrigin) = 0;
    78 	virtual void SetBrushPattern(const CFbsBitmap& aPattern) = 0;
    79 	virtual void SetBrushPattern(TInt aHandle) = 0;
    80 	virtual void ResetBrushPattern() = 0;
    81 	virtual void SetFont(const CFont* aFont) = 0;
    82 	virtual void ResetFont() = 0;
    83 	virtual void Reset() = 0;
    84 	virtual TRgb BrushColor() = 0;
    85 	virtual TRgb PenColor() = 0;
    86 	virtual TRgb TextShadowColor() = 0;
    87 	virtual void Clear(const TRect& aRect) = 0;
    88 	virtual void Clear() = 0;
    89 	virtual void MoveTo(const TPoint& aPoint) = 0;
    90 	virtual void MoveBy(const TPoint& aVector) = 0;
    91 	virtual void Plot(const TPoint& aPoint) = 0;
    92 	virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd) = 0;
    93 	virtual void DrawLineTo(const TPoint& aPoint) = 0;
    94 	virtual void DrawLineBy(const TPoint& aVector) = 0;
    95 	virtual void DrawRect(const TRect& aRect) = 0;
    96 	virtual void DrawRoundRect(const TRect& aRect, const TSize& aEllipse) = 0;
    97 	virtual void DrawPolyLine(const CArrayFix<TPoint>& aPointList) = 0;
    98 	virtual void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>& aPointList) = 0;
    99 	virtual void DrawPolygon(const CArrayFix<TPoint>& aPoints,
   100 			DirectGdi::TFillRule aRule) = 0;
   101 	virtual void DrawArc(const TRect& aRect, const TPoint& aStart,
   102 			const TPoint& aEnd) = 0;
   103 	virtual void DrawPie(const TRect& aRect, const TPoint& aStart,
   104 			const TPoint& aEnd) = 0;
   105 	virtual void DrawEllipse(const TRect& aRect) = 0;
   106 	virtual void BitBlt(const TPoint& aPoint, const CFbsBitmap& aBitmap) = 0;
   107 	virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
   108 			const TRect& aSrcRect) = 0;
   109 	virtual void BitBltMasked(const TPoint& aDestPos,
   110 			const CFbsBitmap& aBitmap, const TRect& aSrcRect,
   111 			const CFbsBitmap& aMask, TBool aInvertMask) = 0;
   112 	virtual void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aBitmap, 
   113 			const TRect& aSourceRect, const CFbsBitmap& aAlpha, 
   114 			const TPoint& aAlphaPos) = 0;
   115 	virtual void
   116 			DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSource) = 0;
   117 	virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aBitmap,
   118 			const TRect& aSrcRect) = 0;
   119 	virtual void DrawBitmapMasked(const TRect& aDestRect,
   120 			const CFbsBitmap& aBitmap, const TRect& aSrcRect,
   121 			const CFbsBitmap& aMask, TBool aInvertMask) = 0;
   122 	virtual void CopyRect(const TPoint& aOffset, const TRect& aRect) = 0;
   123 	virtual TBool HasBrushPattern() const = 0;
   124 	virtual TBool HasFont() const = 0;
   125 	virtual void ExternalizeL(RWriteStream& aWriteStream) = 0;
   126 	virtual void InternalizeL(RReadStream& aReadStream) = 0;
   127 	virtual void SetCharJustification(TInt aExcessWidth, TInt aNumGaps) = 0;
   128 	virtual void SetWordJustification(TInt aExcessWidth, TInt aNumChars) = 0;
   129 	virtual void SetUnderlineStyle(DirectGdi::TFontUnderline aUnderlineStyle) = 0;
   130 	virtual void
   131 			SetStrikethroughStyle(DirectGdi::TFontStrikethrough aStrikethroughStyle) = 0;
   132 	virtual void UpdateJustification(const TDesC& aText, const DirectGdi::TTextParameters* aParam) = 0;
   133 	virtual void UpdateJustificationVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp) = 0;
   134 	virtual void SetFontNoDuplicate(const CFont* aFont) = 0;
   135 	virtual TInt GetError() = 0;
   136 	// text drawing
   137 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam) = 0;
   138 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition) = 0;
   139 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox) = 0;
   140 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   141 		DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0) = 0;
   142 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp) = 0;
   143 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition, TBool aUp) = 0;
   144 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TBool aUp) = 0;
   145 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   146 			TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0) = 0;
   147 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   148 			TInt aTextWidth, TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0) = 0;
   149 	// New functionality for image based resource (not part of BitGdi)
   150 	virtual void DrawResource(const TPoint& aPos, 
   151 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   152 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone) = 0;
   153 	virtual void DrawResource(const TRect& aDestRect, 
   154 							const TDrawableSourceAndEquivRotatedBmps& aSource,
   155 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone) = 0;
   156 	virtual void DrawResource(const TRect& aDestRect, 
   157 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   158 							const TRect& aSrcRect,
   159 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone) = 0;
   160 	// New functionality for non-image based resource (not part of BitGdi)
   161 	virtual void DrawResource(const TRect& aDestRect, 
   162 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   163 							const TDesC8& aParam) = 0;
   164 	virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface) = 0;
   165 	virtual void CopySettings(const CTContextBase& aGc) = 0;
   166 	};
   167 
   168 /**
   169 Concrete implementation of a CTContextBase.
   170 This class implements the rendering mechanism for BitGDI.
   171 */
   172 class CTBitGdiContext : public CTContextBase
   173 	{
   174 public:
   175 	static CTBitGdiContext* NewL(CFbsBitmapDevice* aDevice, TBool aActivate=ETrue);
   176 	virtual ~CTBitGdiContext();
   177 
   178 	// from CTContextBase
   179 	virtual void SetOrigin(const TPoint& aOrigin);
   180 	virtual void SetClippingRegion(const TRegion& aRegion);
   181 	virtual void ResetClippingRegion();
   182 	virtual void SetDrawMode(DirectGdi::TDrawMode aMode);
   183 	virtual void SetPenColor(const TRgb& aColor);
   184 	virtual void SetPenStyle(DirectGdi::TPenStyle aStyle);
   185 	virtual void SetPenSize(const TSize& aSize);
   186 	virtual void SetTextShadowColor(const TRgb& aColor);
   187 	virtual void SetBrushColor(const TRgb& aColor);
   188 	virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle);
   189 	virtual void SetBrushOrigin(const TPoint& aOrigin);
   190 	virtual void SetBrushPattern(const CFbsBitmap& aPattern);
   191 	virtual void SetBrushPattern(TInt aHandle);
   192 	virtual void ResetBrushPattern();
   193 	virtual void SetFont(const CFont* aFont);
   194 	virtual void ResetFont();
   195 	virtual void Reset();
   196 	virtual TRgb BrushColor();
   197 	virtual TRgb PenColor();
   198 	virtual TRgb TextShadowColor();
   199 	virtual void Clear(const TRect& aRect);
   200 	virtual void Clear();
   201 	virtual void MoveTo(const TPoint& aPoint);
   202 	virtual void MoveBy(const TPoint& aVector);
   203 	virtual void Plot(const TPoint& aPoint);
   204 	virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd);
   205 	virtual void DrawLineTo(const TPoint& aPoint);
   206 	virtual void DrawLineBy(const TPoint& aVector);
   207 	virtual void DrawRect(const TRect& aRect);
   208 	virtual void DrawRoundRect(const TRect& aRect, const TSize& aEllipse);
   209 	virtual void DrawPolyLine(const CArrayFix<TPoint>& aPointList);
   210 	virtual void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>& aPointList);
   211 	virtual void DrawPolygon(const CArrayFix<TPoint>& aPoints,
   212 			DirectGdi::TFillRule aRule);
   213 	virtual void DrawArc(const TRect& aRect, const TPoint& aStart,
   214 			const TPoint& aEnd);
   215 	virtual void DrawPie(const TRect& aRect, const TPoint& aStart,
   216 			const TPoint& aEnd);
   217 	virtual void DrawEllipse(const TRect& aRect);
   218 	virtual void BitBlt(const TPoint& aPoint, const CFbsBitmap& aBitmap);
   219 	virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
   220 			const TRect& aSrcRect);
   221 	virtual void BitBltMasked(const TPoint& aDestPos,
   222 			const CFbsBitmap& aBitmap, const TRect& aSrcRect,
   223 			const CFbsBitmap& aMask, TBool aInvertMask);
   224 	virtual void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aBitmap, 
   225 			const TRect& aSourceRect, const CFbsBitmap& aAlpha, 
   226 			const TPoint& aAlphaPos);
   227 	virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSource);
   228 	virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aBitmap,
   229 			const TRect& aSrcRect);
   230 	virtual void DrawBitmapMasked(const TRect& aDestRect,
   231 			const CFbsBitmap& aBitmap, const TRect& aSrcRect,
   232 			const CFbsBitmap& aMask, TBool aInvertMask);
   233 	virtual void CopyRect(const TPoint& aOffset, const TRect& aRect);
   234 	virtual void ExternalizeL(RWriteStream& aWriteStream);
   235 	virtual void InternalizeL(RReadStream& aReadStream);
   236 	virtual TBool HasBrushPattern() const;
   237 	virtual TBool HasFont() const;
   238 	virtual void SetCharJustification(TInt aExcessWidth, TInt aNumGaps);
   239 	virtual void SetWordJustification(TInt aExcessWidth, TInt aNumChars);
   240 	virtual void SetUnderlineStyle(DirectGdi::TFontUnderline aUnderlineStyle);
   241 	virtual void SetStrikethroughStyle(DirectGdi::TFontStrikethrough aStrikethroughStyle);
   242 	virtual void UpdateJustification(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
   243 	virtual void UpdateJustificationVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
   244 	virtual void SetFontNoDuplicate(const CFont* aFont);
   245 	virtual TInt GetError();
   246 	// text drawing
   247 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
   248 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition);
   249 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox);
   250 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   251 			DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0);
   252 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   253 			TInt aTextWidth, DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0);
   254 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
   255 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition, TBool aUp);
   256 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TBool aUp);
   257 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   258 			TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
   259 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   260 			TInt aTextWidth, TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
   261 
   262    // New functionality for image based resource (not part of BitGdi)
   263 	virtual void DrawResource(const TPoint& aPos, 
   264 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   265 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
   266 	virtual void DrawResource(const TRect& aDestRect, 
   267 							const TDrawableSourceAndEquivRotatedBmps& aSource,
   268 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
   269 	virtual void DrawResource(const TRect& aDestRect, 
   270 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   271 							const TRect& aSrcRect,
   272 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
   273 	// New functionality for non-image based resource (not part of BitGdi)
   274 	virtual void DrawResource(const TRect& aDestRect, 
   275 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   276 							const TDesC8& aParam);
   277  
   278 	virtual TInt Activate(CBitmapDevice *aDevice);
   279 	virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface);
   280 	virtual void CopySettings(const CTContextBase& aGc);
   281 private:
   282 	CTBitGdiContext();
   283 	void ConstructL(CFbsBitmapDevice* aDevice, TBool aActivate);
   284 	void SetError(TInt aErr);
   285 
   286 public:
   287 	CFbsBitGc* iGc;
   288 	TInt iError;
   289 	};
   290 
   291 	
   292 /**
   293 Concrete implementation of a CTContextBase.
   294 This class implements the rendering mechanism for DirectGDI.
   295 */
   296 class CTestDirectGdiContext : public CTContextBase
   297 	{
   298 public:
   299 	static CTestDirectGdiContext* NewL();
   300 	virtual ~CTestDirectGdiContext();
   301 
   302 	// from CTContextBase
   303 	virtual void SetOrigin(const TPoint& aOrigin);
   304 	virtual void SetClippingRegion(const TRegion& aRegion);
   305 	virtual void ResetClippingRegion();
   306 	virtual void SetDrawMode(DirectGdi::TDrawMode aMode);
   307 	virtual void SetPenColor(const TRgb& aColor);
   308 	virtual void SetPenStyle(DirectGdi::TPenStyle aStyle);
   309 	virtual void SetPenSize(const TSize& aSize);
   310 	virtual void SetTextShadowColor(const TRgb& aColor);
   311 	virtual void SetBrushColor(const TRgb& aColor);
   312 	virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle);
   313 	virtual void SetBrushOrigin(const TPoint& aOrigin);
   314 	virtual void SetBrushPattern(const CFbsBitmap& aPattern);
   315 	virtual void SetBrushPattern(TInt aHandle);
   316 	virtual void ResetBrushPattern();
   317 	virtual void SetFont(const CFont* aFont);
   318 	virtual void ResetFont();
   319 	virtual void Reset();
   320 	virtual TRgb BrushColor();
   321 	virtual TRgb PenColor();
   322 	virtual TRgb TextShadowColor();
   323 	virtual void Clear(const TRect& aRect);
   324 	virtual void Clear();
   325 	virtual void MoveTo(const TPoint& aPoint);
   326 	virtual void MoveBy(const TPoint& aVector);
   327 	virtual void Plot(const TPoint& aPoint);
   328 	virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd);
   329 	virtual void DrawLineTo(const TPoint& aPoint);
   330 	virtual void DrawLineBy(const TPoint& aVector);
   331 	virtual void DrawRect(const TRect& aRect);
   332 	virtual void DrawRoundRect(const TRect& aRect, const TSize& aEllipse);
   333 	virtual void DrawPolyLine(const CArrayFix<TPoint>& aPointList);
   334 	virtual void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>& aPointList);
   335 	virtual void DrawPolygon(const CArrayFix<TPoint>& aPoints,
   336 			DirectGdi::TFillRule aRule);
   337 	virtual void DrawArc(const TRect& aRect, const TPoint& aStart,
   338 			const TPoint& aEnd);
   339 	virtual void DrawPie(const TRect& aRect, const TPoint& aStart,
   340 			const TPoint& aEnd);
   341 	virtual void DrawEllipse(const TRect& aRect);
   342 	virtual void BitBlt(const TPoint& aPoint, const CFbsBitmap& aBitmap);
   343 	virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
   344 			const TRect& aSrcRect);
   345 	virtual void BitBltMasked(const TPoint& aDestPos,
   346 			const CFbsBitmap& aBitmap, const TRect& aSrcRect,
   347 			const CFbsBitmap& aMask, TBool aInvertMask);
   348 	virtual void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aBitmap, 
   349 			const TRect& aSourceRect, const CFbsBitmap& aAlpha, 
   350 			const TPoint& aAlphaPos);
   351 	virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSource);
   352 	virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aBitmap,
   353 			const TRect& aSrcRect);
   354 	virtual void DrawBitmapMasked(const TRect& aDestRect,
   355 			const CFbsBitmap& aBitmap, const TRect& aSrcRect,
   356 			const CFbsBitmap& aMask, TBool aInvertMask);
   357 	virtual void CopyRect(const TPoint& aOffset, const TRect& aRect);
   358 	virtual void ExternalizeL(RWriteStream& aWriteStream);
   359 	virtual void InternalizeL(RReadStream& aReadStream);
   360 	virtual TBool HasBrushPattern() const;
   361 	virtual TBool HasFont() const;
   362 	virtual void SetCharJustification(TInt aExcessWidth, TInt aNumGaps);
   363 	virtual void SetWordJustification(TInt aExcessWidth, TInt aNumChars);
   364 	virtual void SetUnderlineStyle(DirectGdi::TFontUnderline aUnderlineStyle);
   365 	virtual void SetStrikethroughStyle(DirectGdi::TFontStrikethrough aStrikethroughStyle);
   366 	virtual void UpdateJustification(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
   367 	virtual void UpdateJustificationVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
   368 	virtual void SetFontNoDuplicate(const CFont* aFont);
   369 	virtual TInt GetError();
   370 	// text drawing
   371 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
   372 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition);
   373 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox);
   374 	virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   375 		DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0);
   376 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
   377 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition, TBool aUp);
   378 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TBool aUp);
   379 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   380 			TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
   381 	virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset, 
   382 			TInt aTextWidth, TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
   383 	// New functionality for image based resource (not part of BitGdi)
   384 	virtual void DrawResource(const TPoint& aPos, 
   385 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   386 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
   387 	virtual void DrawResource(const TRect& aDestRect, 
   388 							const TDrawableSourceAndEquivRotatedBmps& aSource,
   389 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
   390 	virtual void DrawResource(const TRect& aDestRect, 
   391 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   392 							const TRect& aSrcRect,
   393 							DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
   394 	// New functionality for non-image based resource (not part of BitGdi)
   395 	virtual void DrawResource(const TRect& aDestRect, 
   396 							const TDrawableSourceAndEquivRotatedBmps& aSource, 
   397 							const TDesC8& aParam);
   398 
   399 	virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface);
   400 
   401 	// CTestDirectGdiContext specific
   402 	virtual TInt Activate(RDirectGdiImageTarget& aTarget);
   403 	void NoJustifyAutoUpdate();
   404 	void SetJustifyAutoUpdate();
   405 	virtual void CopySettings(const CTContextBase& aGc);
   406 	
   407 private:
   408 	CTestDirectGdiContext();
   409 	void ConstructL();
   410 
   411 public:
   412 	CDirectGdiDriver* iGdiDriver;
   413 	CDirectGdiContext* iGc;
   414 	};
   415 
   416 #endif