sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: sl@0: class CDummyDevice : public CGraphicsDevice sl@0: { sl@0: protected: sl@0: CDummyDevice(); sl@0: public: sl@0: IMPORT_C static CDummyDevice* NewL(); sl@0: IMPORT_C ~CDummyDevice(); sl@0: IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const; sl@0: IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const; sl@0: IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const; sl@0: IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const; sl@0: IMPORT_C TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec); sl@0: IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec); sl@0: IMPORT_C void ReleaseFont(CFont* aFont); sl@0: IMPORT_C TDisplayMode DisplayMode() const; sl@0: IMPORT_C TSize SizeInPixels() const; sl@0: IMPORT_C TSize SizeInTwips() const; sl@0: IMPORT_C TInt CreateContext(CGraphicsContext*& aGC); sl@0: IMPORT_C TInt NumTypefaces() const; sl@0: IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const; sl@0: IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const; sl@0: IMPORT_C void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const; sl@0: IMPORT_C void SetPalette(CPalette* aPalette); sl@0: IMPORT_C TInt GetPalette(CPalette*& aPalette) const; sl@0: public: sl@0: CConsoleBase* iConsole; sl@0: }; sl@0: sl@0: class CDummyGc : public CGraphicsContext sl@0: { sl@0: public: sl@0: IMPORT_C CDummyGc(CDummyDevice* aDevice); sl@0: IMPORT_C ~CDummyGc(); sl@0: IMPORT_C CGraphicsDevice* Device() const; sl@0: IMPORT_C void SetOrigin(const TPoint& aPos=TPoint(0,0)); sl@0: IMPORT_C void SetDrawMode(TDrawMode aDrawingMode); sl@0: IMPORT_C void SetClippingRect(const TRect& aRect); sl@0: IMPORT_C void CancelClippingRect(); sl@0: IMPORT_C void Reset(); sl@0: sl@0: IMPORT_C void UseFont(const CFont* aFont); sl@0: IMPORT_C void DiscardFont(); sl@0: IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle); sl@0: IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle); sl@0: IMPORT_C void SetWordJustification(TInt aExcessWidth,TInt aNumGaps); sl@0: IMPORT_C void SetCharJustification(TInt aExcessWidth,TInt aNumChars); sl@0: sl@0: IMPORT_C void SetPenColor(const TRgb& aColor); sl@0: IMPORT_C void SetPenStyle(TPenStyle aPenStyle); sl@0: IMPORT_C void SetPenSize(const TSize& aSize); sl@0: sl@0: IMPORT_C void SetBrushColor(const TRgb& aColor); sl@0: IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle); sl@0: IMPORT_C void SetBrushOrigin(const TPoint& aOrigin); sl@0: IMPORT_C void UseBrushPattern(const CFbsBitmap* aBitmap); sl@0: IMPORT_C void DiscardBrushPattern(); sl@0: IMPORT_C void MoveTo(const TPoint& aPoint); sl@0: IMPORT_C void MoveBy(const TPoint& aVector); sl@0: IMPORT_C void Plot(const TPoint& aPoint); sl@0: IMPORT_C void DrawArc(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd); sl@0: IMPORT_C void DrawLine(const TPoint& aPoint1,const TPoint& aPoint2); sl@0: IMPORT_C void DrawLineTo(const TPoint& aPoint); sl@0: IMPORT_C void DrawLineBy(const TPoint& aVector); sl@0: IMPORT_C void DrawPolyLine(const CArrayFix* aPointList); sl@0: IMPORT_C void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints); sl@0: IMPORT_C void DrawPie(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd); sl@0: IMPORT_C void DrawEllipse(const TRect& aRect); sl@0: IMPORT_C void DrawRect(const TRect& aRect); sl@0: IMPORT_C void DrawRoundRect(const TRect& aRect,const TSize& aCornerSize); sl@0: IMPORT_C TInt DrawPolygon(const CArrayFix* aPointList,TFillRule aFillRule=EAlternate); sl@0: IMPORT_C TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule=EAlternate); sl@0: IMPORT_C void DrawBitmap(const TPoint& aTopLeft,const CFbsBitmap* aSource); sl@0: IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource); sl@0: IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource,const TRect& aSourceRect); sl@0: IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask); sl@0: IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask); sl@0: IMPORT_C void DrawText(const TDesC& aString,const TPoint& aPosition); sl@0: IMPORT_C void DrawText(const TDesC& aString,const TRect& aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0); sl@0: sl@0: protected: sl@0: CDummyDevice* iDevice; sl@0: }; sl@0: