os/graphics/printingservices/printerdriversupport/tps/DUMMY.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1996-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 #include <gdi.h>
    17 
    18 class CDummyDevice : public	CGraphicsDevice
    19 	{
    20 protected:
    21 	CDummyDevice();
    22 public:
    23 	IMPORT_C static CDummyDevice* NewL();
    24 	IMPORT_C ~CDummyDevice();
    25 	IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
    26 	IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
    27 	IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
    28 	IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
    29 	IMPORT_C TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
    30 	IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
    31 	IMPORT_C void ReleaseFont(CFont* aFont);
    32 	IMPORT_C TDisplayMode DisplayMode() const;
    33 	IMPORT_C TSize SizeInPixels() const;
    34 	IMPORT_C TSize SizeInTwips() const;
    35     IMPORT_C TInt CreateContext(CGraphicsContext*& aGC);
    36     IMPORT_C TInt NumTypefaces() const;
    37     IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const;
    38 	IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
    39 	IMPORT_C void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const;
    40 	IMPORT_C void SetPalette(CPalette* aPalette);
    41 	IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
    42 public:
    43 	CConsoleBase* iConsole;
    44 	};
    45 
    46 class CDummyGc : public	CGraphicsContext
    47 	{
    48 public:
    49 	IMPORT_C CDummyGc(CDummyDevice* aDevice);
    50 	IMPORT_C ~CDummyGc();
    51 	IMPORT_C CGraphicsDevice* Device() const;
    52 	IMPORT_C void SetOrigin(const TPoint& aPos=TPoint(0,0));
    53 	IMPORT_C void SetDrawMode(TDrawMode aDrawingMode);
    54 	IMPORT_C void SetClippingRect(const TRect& aRect);
    55 	IMPORT_C void CancelClippingRect();
    56 	IMPORT_C void Reset();
    57 
    58 	IMPORT_C void UseFont(const CFont* aFont);
    59 	IMPORT_C void DiscardFont();
    60 	IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
    61 	IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
    62 	IMPORT_C void SetWordJustification(TInt aExcessWidth,TInt aNumGaps);
    63 	IMPORT_C void SetCharJustification(TInt aExcessWidth,TInt aNumChars);
    64 
    65 	IMPORT_C void SetPenColor(const TRgb& aColor);
    66 	IMPORT_C void SetPenStyle(TPenStyle aPenStyle);
    67 	IMPORT_C void SetPenSize(const TSize& aSize);
    68 
    69 	IMPORT_C void SetBrushColor(const TRgb& aColor);
    70 	IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle);
    71 	IMPORT_C void SetBrushOrigin(const TPoint& aOrigin);
    72 	IMPORT_C void UseBrushPattern(const CFbsBitmap* aBitmap);
    73 	IMPORT_C void DiscardBrushPattern();
    74 	IMPORT_C void MoveTo(const TPoint& aPoint);
    75 	IMPORT_C void MoveBy(const TPoint& aVector);
    76 	IMPORT_C void Plot(const TPoint& aPoint);
    77 	IMPORT_C void DrawArc(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd);
    78 	IMPORT_C void DrawLine(const TPoint& aPoint1,const TPoint& aPoint2);
    79 	IMPORT_C void DrawLineTo(const TPoint& aPoint);
    80 	IMPORT_C void DrawLineBy(const TPoint& aVector);
    81 	IMPORT_C void DrawPolyLine(const CArrayFix<TPoint>* aPointList);
    82 	IMPORT_C void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints);
    83 	IMPORT_C void DrawPie(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd);
    84 	IMPORT_C void DrawEllipse(const TRect& aRect);
    85 	IMPORT_C void DrawRect(const TRect& aRect);
    86 	IMPORT_C void DrawRoundRect(const TRect& aRect,const TSize& aCornerSize);
    87 	IMPORT_C TInt DrawPolygon(const CArrayFix<TPoint>* aPointList,TFillRule aFillRule=EAlternate);
    88 	IMPORT_C TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule=EAlternate);
    89 	IMPORT_C void DrawBitmap(const TPoint& aTopLeft,const CFbsBitmap* aSource);
    90 	IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource);
    91 	IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource,const TRect& aSourceRect);
    92 	IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
    93 	IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask);
    94 	IMPORT_C void DrawText(const TDesC& aString,const TPoint& aPosition);
    95 	IMPORT_C void DrawText(const TDesC& aString,const TRect& aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0);
    96 
    97 protected:
    98 	CDummyDevice* iDevice;
    99 	};
   100