1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/directgdi/test/tcontextbase.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,416 @@
1.4 +// Copyright (c) 2007-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 "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.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 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +#ifndef TCONTEXTBASE_H
1.26 +#define TCONTEXTBASE_H
1.27 +
1.28 +#include <graphics/directgditypes.h>
1.29 +#include <gdi.h>
1.30 +
1.31 +// Forward declarations.
1.32 +//
1.33 +class CFbsBitGc;
1.34 +class CDirectGdiContext;
1.35 +class CFbsBitGcFont;
1.36 +class CDirectGdiDriver;
1.37 +class CFbsBitmapDevice;
1.38 +class RDirectGdiDrawableSource;
1.39 +class RDirectGdiImageTarget;
1.40 +
1.41 +/**
1.42 +Struct to allow the equivalent of an image source to be drawn using BitGdi when testing the
1.43 +DrawResource methods. When an image source is created for testing, rotated bitmap versions
1.44 +of it are also created to allow the tests to be drawn in BitGdi using DrawBitmap
1.45 +*/
1.46 +struct TDrawableSourceAndEquivRotatedBmps
1.47 + {
1.48 + TDrawableSourceAndEquivRotatedBmps() :
1.49 + iDrawableSrc(NULL),
1.50 + iBmpRotNone(NULL),
1.51 + iBmpRot90(NULL),
1.52 + iBmpRot180(NULL),
1.53 + iBmpRot270(NULL)
1.54 + {
1.55 + }
1.56 +
1.57 + RDirectGdiDrawableSource* iDrawableSrc;
1.58 + CFbsBitmap* iBmpRotNone;
1.59 + CFbsBitmap* iBmpRot90;
1.60 + CFbsBitmap* iBmpRot180;
1.61 + CFbsBitmap* iBmpRot270;
1.62 + };
1.63 +
1.64 +/**
1.65 +Base class for Contexts in Test.
1.66 +*/
1.67 +class CTContextBase : public CBase
1.68 + {
1.69 +public:
1.70 + virtual void SetOrigin(const TPoint& aOrigin) = 0;
1.71 + virtual void SetClippingRegion(const TRegion& aRegion) = 0;
1.72 + virtual void ResetClippingRegion() = 0;
1.73 + virtual void SetDrawMode(DirectGdi::TDrawMode aMode) = 0;
1.74 + virtual void SetPenColor(const TRgb& aColor) = 0;
1.75 + virtual void SetPenStyle(DirectGdi::TPenStyle aStyle) = 0;
1.76 + virtual void SetPenSize(const TSize& aSize) = 0;
1.77 + virtual void SetTextShadowColor(const TRgb& aColor) = 0;
1.78 + virtual void SetBrushColor(const TRgb& aColor) = 0;
1.79 + virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle) = 0;
1.80 + virtual void SetBrushOrigin(const TPoint& aOrigin) = 0;
1.81 + virtual void SetBrushPattern(const CFbsBitmap& aPattern) = 0;
1.82 + virtual void SetBrushPattern(TInt aHandle) = 0;
1.83 + virtual void ResetBrushPattern() = 0;
1.84 + virtual void SetFont(const CFont* aFont) = 0;
1.85 + virtual void ResetFont() = 0;
1.86 + virtual void Reset() = 0;
1.87 + virtual TRgb BrushColor() = 0;
1.88 + virtual TRgb PenColor() = 0;
1.89 + virtual TRgb TextShadowColor() = 0;
1.90 + virtual void Clear(const TRect& aRect) = 0;
1.91 + virtual void Clear() = 0;
1.92 + virtual void MoveTo(const TPoint& aPoint) = 0;
1.93 + virtual void MoveBy(const TPoint& aVector) = 0;
1.94 + virtual void Plot(const TPoint& aPoint) = 0;
1.95 + virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd) = 0;
1.96 + virtual void DrawLineTo(const TPoint& aPoint) = 0;
1.97 + virtual void DrawLineBy(const TPoint& aVector) = 0;
1.98 + virtual void DrawRect(const TRect& aRect) = 0;
1.99 + virtual void DrawRoundRect(const TRect& aRect, const TSize& aEllipse) = 0;
1.100 + virtual void DrawPolyLine(const CArrayFix<TPoint>& aPointList) = 0;
1.101 + virtual void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>& aPointList) = 0;
1.102 + virtual void DrawPolygon(const CArrayFix<TPoint>& aPoints,
1.103 + DirectGdi::TFillRule aRule) = 0;
1.104 + virtual void DrawArc(const TRect& aRect, const TPoint& aStart,
1.105 + const TPoint& aEnd) = 0;
1.106 + virtual void DrawPie(const TRect& aRect, const TPoint& aStart,
1.107 + const TPoint& aEnd) = 0;
1.108 + virtual void DrawEllipse(const TRect& aRect) = 0;
1.109 + virtual void BitBlt(const TPoint& aPoint, const CFbsBitmap& aBitmap) = 0;
1.110 + virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
1.111 + const TRect& aSrcRect) = 0;
1.112 + virtual void BitBltMasked(const TPoint& aDestPos,
1.113 + const CFbsBitmap& aBitmap, const TRect& aSrcRect,
1.114 + const CFbsBitmap& aMask, TBool aInvertMask) = 0;
1.115 + virtual void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
1.116 + const TRect& aSourceRect, const CFbsBitmap& aAlpha,
1.117 + const TPoint& aAlphaPos) = 0;
1.118 + virtual void
1.119 + DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSource) = 0;
1.120 + virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aBitmap,
1.121 + const TRect& aSrcRect) = 0;
1.122 + virtual void DrawBitmapMasked(const TRect& aDestRect,
1.123 + const CFbsBitmap& aBitmap, const TRect& aSrcRect,
1.124 + const CFbsBitmap& aMask, TBool aInvertMask) = 0;
1.125 + virtual void CopyRect(const TPoint& aOffset, const TRect& aRect) = 0;
1.126 + virtual TBool HasBrushPattern() const = 0;
1.127 + virtual TBool HasFont() const = 0;
1.128 + virtual void ExternalizeL(RWriteStream& aWriteStream) = 0;
1.129 + virtual void InternalizeL(RReadStream& aReadStream) = 0;
1.130 + virtual void SetCharJustification(TInt aExcessWidth, TInt aNumGaps) = 0;
1.131 + virtual void SetWordJustification(TInt aExcessWidth, TInt aNumChars) = 0;
1.132 + virtual void SetUnderlineStyle(DirectGdi::TFontUnderline aUnderlineStyle) = 0;
1.133 + virtual void
1.134 + SetStrikethroughStyle(DirectGdi::TFontStrikethrough aStrikethroughStyle) = 0;
1.135 + virtual void UpdateJustification(const TDesC& aText, const DirectGdi::TTextParameters* aParam) = 0;
1.136 + virtual void UpdateJustificationVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp) = 0;
1.137 + virtual void SetFontNoDuplicate(const CFont* aFont) = 0;
1.138 + virtual TInt GetError() = 0;
1.139 + // text drawing
1.140 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam) = 0;
1.141 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition) = 0;
1.142 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox) = 0;
1.143 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.144 + DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0) = 0;
1.145 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp) = 0;
1.146 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition, TBool aUp) = 0;
1.147 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TBool aUp) = 0;
1.148 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.149 + TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0) = 0;
1.150 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.151 + TInt aTextWidth, TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0) = 0;
1.152 + // New functionality for image based resource (not part of BitGdi)
1.153 + virtual void DrawResource(const TPoint& aPos,
1.154 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.155 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone) = 0;
1.156 + virtual void DrawResource(const TRect& aDestRect,
1.157 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.158 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone) = 0;
1.159 + virtual void DrawResource(const TRect& aDestRect,
1.160 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.161 + const TRect& aSrcRect,
1.162 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone) = 0;
1.163 + // New functionality for non-image based resource (not part of BitGdi)
1.164 + virtual void DrawResource(const TRect& aDestRect,
1.165 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.166 + const TDesC8& aParam) = 0;
1.167 + virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface) = 0;
1.168 + virtual void CopySettings(const CTContextBase& aGc) = 0;
1.169 + };
1.170 +
1.171 +/**
1.172 +Concrete implementation of a CTContextBase.
1.173 +This class implements the rendering mechanism for BitGDI.
1.174 +*/
1.175 +class CTBitGdiContext : public CTContextBase
1.176 + {
1.177 +public:
1.178 + static CTBitGdiContext* NewL(CFbsBitmapDevice* aDevice, TBool aActivate=ETrue);
1.179 + virtual ~CTBitGdiContext();
1.180 +
1.181 + // from CTContextBase
1.182 + virtual void SetOrigin(const TPoint& aOrigin);
1.183 + virtual void SetClippingRegion(const TRegion& aRegion);
1.184 + virtual void ResetClippingRegion();
1.185 + virtual void SetDrawMode(DirectGdi::TDrawMode aMode);
1.186 + virtual void SetPenColor(const TRgb& aColor);
1.187 + virtual void SetPenStyle(DirectGdi::TPenStyle aStyle);
1.188 + virtual void SetPenSize(const TSize& aSize);
1.189 + virtual void SetTextShadowColor(const TRgb& aColor);
1.190 + virtual void SetBrushColor(const TRgb& aColor);
1.191 + virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle);
1.192 + virtual void SetBrushOrigin(const TPoint& aOrigin);
1.193 + virtual void SetBrushPattern(const CFbsBitmap& aPattern);
1.194 + virtual void SetBrushPattern(TInt aHandle);
1.195 + virtual void ResetBrushPattern();
1.196 + virtual void SetFont(const CFont* aFont);
1.197 + virtual void ResetFont();
1.198 + virtual void Reset();
1.199 + virtual TRgb BrushColor();
1.200 + virtual TRgb PenColor();
1.201 + virtual TRgb TextShadowColor();
1.202 + virtual void Clear(const TRect& aRect);
1.203 + virtual void Clear();
1.204 + virtual void MoveTo(const TPoint& aPoint);
1.205 + virtual void MoveBy(const TPoint& aVector);
1.206 + virtual void Plot(const TPoint& aPoint);
1.207 + virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd);
1.208 + virtual void DrawLineTo(const TPoint& aPoint);
1.209 + virtual void DrawLineBy(const TPoint& aVector);
1.210 + virtual void DrawRect(const TRect& aRect);
1.211 + virtual void DrawRoundRect(const TRect& aRect, const TSize& aEllipse);
1.212 + virtual void DrawPolyLine(const CArrayFix<TPoint>& aPointList);
1.213 + virtual void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>& aPointList);
1.214 + virtual void DrawPolygon(const CArrayFix<TPoint>& aPoints,
1.215 + DirectGdi::TFillRule aRule);
1.216 + virtual void DrawArc(const TRect& aRect, const TPoint& aStart,
1.217 + const TPoint& aEnd);
1.218 + virtual void DrawPie(const TRect& aRect, const TPoint& aStart,
1.219 + const TPoint& aEnd);
1.220 + virtual void DrawEllipse(const TRect& aRect);
1.221 + virtual void BitBlt(const TPoint& aPoint, const CFbsBitmap& aBitmap);
1.222 + virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
1.223 + const TRect& aSrcRect);
1.224 + virtual void BitBltMasked(const TPoint& aDestPos,
1.225 + const CFbsBitmap& aBitmap, const TRect& aSrcRect,
1.226 + const CFbsBitmap& aMask, TBool aInvertMask);
1.227 + virtual void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
1.228 + const TRect& aSourceRect, const CFbsBitmap& aAlpha,
1.229 + const TPoint& aAlphaPos);
1.230 + virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSource);
1.231 + virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aBitmap,
1.232 + const TRect& aSrcRect);
1.233 + virtual void DrawBitmapMasked(const TRect& aDestRect,
1.234 + const CFbsBitmap& aBitmap, const TRect& aSrcRect,
1.235 + const CFbsBitmap& aMask, TBool aInvertMask);
1.236 + virtual void CopyRect(const TPoint& aOffset, const TRect& aRect);
1.237 + virtual void ExternalizeL(RWriteStream& aWriteStream);
1.238 + virtual void InternalizeL(RReadStream& aReadStream);
1.239 + virtual TBool HasBrushPattern() const;
1.240 + virtual TBool HasFont() const;
1.241 + virtual void SetCharJustification(TInt aExcessWidth, TInt aNumGaps);
1.242 + virtual void SetWordJustification(TInt aExcessWidth, TInt aNumChars);
1.243 + virtual void SetUnderlineStyle(DirectGdi::TFontUnderline aUnderlineStyle);
1.244 + virtual void SetStrikethroughStyle(DirectGdi::TFontStrikethrough aStrikethroughStyle);
1.245 + virtual void UpdateJustification(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
1.246 + virtual void UpdateJustificationVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
1.247 + virtual void SetFontNoDuplicate(const CFont* aFont);
1.248 + virtual TInt GetError();
1.249 + // text drawing
1.250 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
1.251 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition);
1.252 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox);
1.253 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.254 + DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0);
1.255 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.256 + TInt aTextWidth, DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0);
1.257 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
1.258 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition, TBool aUp);
1.259 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TBool aUp);
1.260 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.261 + TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
1.262 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.263 + TInt aTextWidth, TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
1.264 +
1.265 + // New functionality for image based resource (not part of BitGdi)
1.266 + virtual void DrawResource(const TPoint& aPos,
1.267 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.268 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
1.269 + virtual void DrawResource(const TRect& aDestRect,
1.270 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.271 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
1.272 + virtual void DrawResource(const TRect& aDestRect,
1.273 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.274 + const TRect& aSrcRect,
1.275 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
1.276 + // New functionality for non-image based resource (not part of BitGdi)
1.277 + virtual void DrawResource(const TRect& aDestRect,
1.278 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.279 + const TDesC8& aParam);
1.280 +
1.281 + virtual TInt Activate(CBitmapDevice *aDevice);
1.282 + virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface);
1.283 + virtual void CopySettings(const CTContextBase& aGc);
1.284 +private:
1.285 + CTBitGdiContext();
1.286 + void ConstructL(CFbsBitmapDevice* aDevice, TBool aActivate);
1.287 + void SetError(TInt aErr);
1.288 +
1.289 +public:
1.290 + CFbsBitGc* iGc;
1.291 + TInt iError;
1.292 + };
1.293 +
1.294 +
1.295 +/**
1.296 +Concrete implementation of a CTContextBase.
1.297 +This class implements the rendering mechanism for DirectGDI.
1.298 +*/
1.299 +class CTestDirectGdiContext : public CTContextBase
1.300 + {
1.301 +public:
1.302 + static CTestDirectGdiContext* NewL();
1.303 + virtual ~CTestDirectGdiContext();
1.304 +
1.305 + // from CTContextBase
1.306 + virtual void SetOrigin(const TPoint& aOrigin);
1.307 + virtual void SetClippingRegion(const TRegion& aRegion);
1.308 + virtual void ResetClippingRegion();
1.309 + virtual void SetDrawMode(DirectGdi::TDrawMode aMode);
1.310 + virtual void SetPenColor(const TRgb& aColor);
1.311 + virtual void SetPenStyle(DirectGdi::TPenStyle aStyle);
1.312 + virtual void SetPenSize(const TSize& aSize);
1.313 + virtual void SetTextShadowColor(const TRgb& aColor);
1.314 + virtual void SetBrushColor(const TRgb& aColor);
1.315 + virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle);
1.316 + virtual void SetBrushOrigin(const TPoint& aOrigin);
1.317 + virtual void SetBrushPattern(const CFbsBitmap& aPattern);
1.318 + virtual void SetBrushPattern(TInt aHandle);
1.319 + virtual void ResetBrushPattern();
1.320 + virtual void SetFont(const CFont* aFont);
1.321 + virtual void ResetFont();
1.322 + virtual void Reset();
1.323 + virtual TRgb BrushColor();
1.324 + virtual TRgb PenColor();
1.325 + virtual TRgb TextShadowColor();
1.326 + virtual void Clear(const TRect& aRect);
1.327 + virtual void Clear();
1.328 + virtual void MoveTo(const TPoint& aPoint);
1.329 + virtual void MoveBy(const TPoint& aVector);
1.330 + virtual void Plot(const TPoint& aPoint);
1.331 + virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd);
1.332 + virtual void DrawLineTo(const TPoint& aPoint);
1.333 + virtual void DrawLineBy(const TPoint& aVector);
1.334 + virtual void DrawRect(const TRect& aRect);
1.335 + virtual void DrawRoundRect(const TRect& aRect, const TSize& aEllipse);
1.336 + virtual void DrawPolyLine(const CArrayFix<TPoint>& aPointList);
1.337 + virtual void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>& aPointList);
1.338 + virtual void DrawPolygon(const CArrayFix<TPoint>& aPoints,
1.339 + DirectGdi::TFillRule aRule);
1.340 + virtual void DrawArc(const TRect& aRect, const TPoint& aStart,
1.341 + const TPoint& aEnd);
1.342 + virtual void DrawPie(const TRect& aRect, const TPoint& aStart,
1.343 + const TPoint& aEnd);
1.344 + virtual void DrawEllipse(const TRect& aRect);
1.345 + virtual void BitBlt(const TPoint& aPoint, const CFbsBitmap& aBitmap);
1.346 + virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
1.347 + const TRect& aSrcRect);
1.348 + virtual void BitBltMasked(const TPoint& aDestPos,
1.349 + const CFbsBitmap& aBitmap, const TRect& aSrcRect,
1.350 + const CFbsBitmap& aMask, TBool aInvertMask);
1.351 + virtual void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aBitmap,
1.352 + const TRect& aSourceRect, const CFbsBitmap& aAlpha,
1.353 + const TPoint& aAlphaPos);
1.354 + virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSource);
1.355 + virtual void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aBitmap,
1.356 + const TRect& aSrcRect);
1.357 + virtual void DrawBitmapMasked(const TRect& aDestRect,
1.358 + const CFbsBitmap& aBitmap, const TRect& aSrcRect,
1.359 + const CFbsBitmap& aMask, TBool aInvertMask);
1.360 + virtual void CopyRect(const TPoint& aOffset, const TRect& aRect);
1.361 + virtual void ExternalizeL(RWriteStream& aWriteStream);
1.362 + virtual void InternalizeL(RReadStream& aReadStream);
1.363 + virtual TBool HasBrushPattern() const;
1.364 + virtual TBool HasFont() const;
1.365 + virtual void SetCharJustification(TInt aExcessWidth, TInt aNumGaps);
1.366 + virtual void SetWordJustification(TInt aExcessWidth, TInt aNumChars);
1.367 + virtual void SetUnderlineStyle(DirectGdi::TFontUnderline aUnderlineStyle);
1.368 + virtual void SetStrikethroughStyle(DirectGdi::TFontStrikethrough aStrikethroughStyle);
1.369 + virtual void UpdateJustification(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
1.370 + virtual void UpdateJustificationVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
1.371 + virtual void SetFontNoDuplicate(const CFont* aFont);
1.372 + virtual TInt GetError();
1.373 + // text drawing
1.374 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam);
1.375 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition);
1.376 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox);
1.377 + virtual void DrawText(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.378 + DirectGdi::TTextAlign aAlignment = DirectGdi::ELeft, TInt aMargin = 0);
1.379 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, TBool aUp);
1.380 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TPoint& aPosition, TBool aUp);
1.381 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TBool aUp);
1.382 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.383 + TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
1.384 + virtual void DrawTextVertical(const TDesC& aText, const DirectGdi::TTextParameters* aParam, const TRect& aBox, TInt aBaselineOffset,
1.385 + TInt aTextWidth, TBool aUp, DirectGdi::TTextAlign aVerticalAlignment = DirectGdi::ELeft, TInt aMargin = 0);
1.386 + // New functionality for image based resource (not part of BitGdi)
1.387 + virtual void DrawResource(const TPoint& aPos,
1.388 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.389 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
1.390 + virtual void DrawResource(const TRect& aDestRect,
1.391 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.392 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
1.393 + virtual void DrawResource(const TRect& aDestRect,
1.394 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.395 + const TRect& aSrcRect,
1.396 + DirectGdi::TGraphicsRotation aRotation=DirectGdi::EGraphicsRotationNone);
1.397 + // New functionality for non-image based resource (not part of BitGdi)
1.398 + virtual void DrawResource(const TRect& aDestRect,
1.399 + const TDrawableSourceAndEquivRotatedBmps& aSource,
1.400 + const TDesC8& aParam);
1.401 +
1.402 + virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface);
1.403 +
1.404 + // CTestDirectGdiContext specific
1.405 + virtual TInt Activate(RDirectGdiImageTarget& aTarget);
1.406 + void NoJustifyAutoUpdate();
1.407 + void SetJustifyAutoUpdate();
1.408 + virtual void CopySettings(const CTContextBase& aGc);
1.409 +
1.410 +private:
1.411 + CTestDirectGdiContext();
1.412 + void ConstructL();
1.413 +
1.414 +public:
1.415 + CDirectGdiDriver* iGdiDriver;
1.416 + CDirectGdiContext* iGc;
1.417 + };
1.418 +
1.419 +#endif