1.1 --- a/epoc32/include/metafile.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,150 +0,0 @@
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 -#ifndef METAFILE_H
1.20 -#define METAFILE_H
1.21 -
1.22 -#include <e32std.h>
1.23 -#include <gdi.h>
1.24 -#include <s32file.h>
1.25 -
1.26 -const TInt KWinPrintMetafileUidVal(268435687);
1.27 -
1.28 -/**
1.29 - * @internalTechnology
1.30 - * Internal to Symbian
1.31 - */
1.32 -class CMetafileDevice : public CGraphicsDevice
1.33 - {
1.34 -protected:
1.35 - IMPORT_C CMetafileDevice(CGraphicsDevice* aDevice);
1.36 -public:
1.37 - IMPORT_C static CMetafileDevice* NewL(CGraphicsDevice* aDevice);
1.38 - IMPORT_C ~CMetafileDevice();
1.39 - IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
1.40 - IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
1.41 - IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
1.42 - IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
1.43 - IMPORT_C TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
1.44 - IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
1.45 - IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec, TInt aMaxHeight);
1.46 - IMPORT_C void ReleaseFont(CFont* aFont);
1.47 - IMPORT_C TDisplayMode DisplayMode() const;
1.48 - IMPORT_C TSize SizeInPixels() const;
1.49 - IMPORT_C TSize SizeInTwips() const;
1.50 - IMPORT_C TInt CreateContext(CGraphicsContext*& aGC);
1.51 - IMPORT_C TInt NumTypefaces() const;
1.52 - IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport, TInt aTypefaceIndex) const;
1.53 - IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;
1.54 - IMPORT_C void PaletteAttributes(TBool& aModifiable, TInt& aNumEntries) const;
1.55 - IMPORT_C void SetPalette(CPalette* aPalette);
1.56 - IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
1.57 - IMPORT_C void UseGcL(TInt aGcIndex);
1.58 - IMPORT_C void StartOutputStreamL(RWriteStream& aStream); // Returns error code
1.59 - IMPORT_C void EndOfStreamL();
1.60 - IMPORT_C RWriteStream& WriteStream();
1.61 -private:
1.62 - TInt iGcCount;
1.63 - TInt iGcIndex;
1.64 - CGraphicsDevice* iRealDevice;
1.65 - RWriteStream* iWriteStream;
1.66 - };
1.67 -
1.68 -/**
1.69 - * @internalTechnology
1.70 - * Internal to Symbian
1.71 - */
1.72 -class CMetafileGc : public CGraphicsContext
1.73 - {
1.74 - friend class CMetafileDevice;
1.75 -protected:
1.76 - IMPORT_C CMetafileGc(CMetafileDevice* aMetafileDevice, TInt anIndex);
1.77 -public:
1.78 - IMPORT_C ~CMetafileGc();
1.79 - IMPORT_C CGraphicsDevice* Device() const;
1.80 - IMPORT_C void SetOrigin(const TPoint& aPos = TPoint(0, 0));
1.81 - IMPORT_C void SetDrawMode(TDrawMode aDrawingMode);
1.82 - IMPORT_C void SetClippingRect(const TRect& aRect);
1.83 - IMPORT_C void CancelClippingRect();
1.84 - IMPORT_C void Reset();
1.85 - IMPORT_C void UseFont(const CFont* aFont);
1.86 - IMPORT_C void DiscardFont();
1.87 - IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
1.88 - IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
1.89 - IMPORT_C void SetWordJustification(TInt aExcessWidth, TInt aNumGaps);
1.90 - IMPORT_C void SetCharJustification(TInt aExcessWidth, TInt aNumChars);
1.91 - IMPORT_C void SetPenColor(const TRgb& aColor);
1.92 - IMPORT_C void SetPenStyle(TPenStyle aPenStyle);
1.93 - IMPORT_C void SetPenSize(const TSize& aSize);
1.94 - IMPORT_C void SetBrushColor(const TRgb& aColor);
1.95 - IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle);
1.96 - IMPORT_C void SetBrushOrigin(const TPoint& aOrigin);
1.97 - IMPORT_C void UseBrushPattern(const CFbsBitmap* aBitmap);
1.98 - IMPORT_C void DiscardBrushPattern();
1.99 - IMPORT_C void MoveTo(const TPoint& aPoint);
1.100 - IMPORT_C void MoveBy(const TPoint& aVector);
1.101 - IMPORT_C void Plot(const TPoint& aPoint);
1.102 - IMPORT_C void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
1.103 - IMPORT_C void DrawLine(const TPoint& aPoint1, const TPoint& aPoint2);
1.104 - IMPORT_C void DrawLineTo(const TPoint& aPoint);
1.105 - IMPORT_C void DrawLineBy(const TPoint& aVector);
1.106 - IMPORT_C void DrawPolyLine(const CArrayFix<TPoint>* aPointList);
1.107 - IMPORT_C void DrawPolyLine(const TPoint* aPointList, TInt aNumPoints);
1.108 - IMPORT_C void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
1.109 - IMPORT_C void DrawEllipse(const TRect& aRect);
1.110 - IMPORT_C void DrawRect(const TRect& aRect);
1.111 - IMPORT_C void DrawRoundRect(const TRect& aRect, const TSize& aCornerSize);
1.112 - IMPORT_C TInt DrawPolygon(const CArrayFix<TPoint>* aPointList, TFillRule aFillRule = EAlternate);
1.113 - IMPORT_C TInt DrawPolygon(const TPoint* aPointList, TInt aNumPoints, TFillRule aFillRule = EAlternate);
1.114 - IMPORT_C void DrawBitmap(const TPoint& aTopLeft, const CFbsBitmap* aSource);
1.115 - IMPORT_C void DrawBitmap(const TRect& aDestRect, const CFbsBitmap* aSource);
1.116 - IMPORT_C void DrawBitmap(const TRect& aDestRect, const CFbsBitmap* aSource, const TRect& aSourceRect);
1.117 - IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
1.118 - IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask);
1.119 - IMPORT_C void DrawText(const TDesC& aString, const TPoint& aPosition);
1.120 - IMPORT_C void DrawText(const TDesC& aString, const TRect& aBox, TInt aBaselineOffset, TTextAlign aHoriz = ELeft, TInt aLeftMrg = 0);
1.121 -
1.122 - IMPORT_C void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs,TBool aMapForwards);
1.123 - IMPORT_C TInt SetClippingRegion(const TRegion &aRegion);
1.124 - IMPORT_C void CancelClippingRegion();
1.125 - IMPORT_C void DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp);
1.126 - IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
1.127 - IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
1.128 - IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
1.129 -
1.130 -private:
1.131 - void ExternalizeBitmapL(const CFbsBitmap* aSource);
1.132 -private:
1.133 - CMetafileDevice* iDevice;
1.134 - TInt iIndex;
1.135 - };
1.136 -
1.137 -/**
1.138 - * @internalTechnology
1.139 - * Internal to Symbian
1.140 - */
1.141 -class CMetafilePlayback : public CBase
1.142 - {
1.143 -protected:
1.144 - IMPORT_C CMetafilePlayback(CGraphicsDevice* aDevice);
1.145 -public:
1.146 - IMPORT_C static CMetafilePlayback* NewL(CGraphicsDevice* aDevice);
1.147 - IMPORT_C ~CMetafilePlayback();
1.148 - IMPORT_C void DrawL(RReadStream& aReadStream);
1.149 -protected:
1.150 - CGraphicsDevice* iDevice;
1.151 - };
1.152 -
1.153 -#endif