sl@0
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef METAFILE_H
|
sl@0
|
17 |
#define METAFILE_H
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <e32std.h>
|
sl@0
|
20 |
#include <gdi.h>
|
sl@0
|
21 |
#include <s32file.h>
|
sl@0
|
22 |
|
sl@0
|
23 |
const TInt KWinPrintMetafileUidVal(268435687);
|
sl@0
|
24 |
|
sl@0
|
25 |
/**
|
sl@0
|
26 |
* @internalTechnology
|
sl@0
|
27 |
* Internal to Symbian
|
sl@0
|
28 |
*/
|
sl@0
|
29 |
class CMetafileDevice : public CGraphicsDevice
|
sl@0
|
30 |
{
|
sl@0
|
31 |
protected:
|
sl@0
|
32 |
IMPORT_C CMetafileDevice(CGraphicsDevice* aDevice);
|
sl@0
|
33 |
public:
|
sl@0
|
34 |
IMPORT_C static CMetafileDevice* NewL(CGraphicsDevice* aDevice);
|
sl@0
|
35 |
IMPORT_C ~CMetafileDevice();
|
sl@0
|
36 |
IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
|
sl@0
|
37 |
IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
|
sl@0
|
38 |
IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
|
sl@0
|
39 |
IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
|
sl@0
|
40 |
IMPORT_C TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
|
sl@0
|
41 |
IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
|
sl@0
|
42 |
IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec, TInt aMaxHeight);
|
sl@0
|
43 |
IMPORT_C void ReleaseFont(CFont* aFont);
|
sl@0
|
44 |
IMPORT_C TDisplayMode DisplayMode() const;
|
sl@0
|
45 |
IMPORT_C TSize SizeInPixels() const;
|
sl@0
|
46 |
IMPORT_C TSize SizeInTwips() const;
|
sl@0
|
47 |
IMPORT_C TInt CreateContext(CGraphicsContext*& aGC);
|
sl@0
|
48 |
IMPORT_C TInt NumTypefaces() const;
|
sl@0
|
49 |
IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport, TInt aTypefaceIndex) const;
|
sl@0
|
50 |
IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;
|
sl@0
|
51 |
IMPORT_C void PaletteAttributes(TBool& aModifiable, TInt& aNumEntries) const;
|
sl@0
|
52 |
IMPORT_C void SetPalette(CPalette* aPalette);
|
sl@0
|
53 |
IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
|
sl@0
|
54 |
IMPORT_C void UseGcL(TInt aGcIndex);
|
sl@0
|
55 |
IMPORT_C void StartOutputStreamL(RWriteStream& aStream); // Returns error code
|
sl@0
|
56 |
IMPORT_C void EndOfStreamL();
|
sl@0
|
57 |
IMPORT_C RWriteStream& WriteStream();
|
sl@0
|
58 |
private:
|
sl@0
|
59 |
TInt iGcCount;
|
sl@0
|
60 |
TInt iGcIndex;
|
sl@0
|
61 |
CGraphicsDevice* iRealDevice;
|
sl@0
|
62 |
RWriteStream* iWriteStream;
|
sl@0
|
63 |
};
|
sl@0
|
64 |
|
sl@0
|
65 |
/**
|
sl@0
|
66 |
* @internalTechnology
|
sl@0
|
67 |
* Internal to Symbian
|
sl@0
|
68 |
*/
|
sl@0
|
69 |
class CMetafileGc : public CGraphicsContext
|
sl@0
|
70 |
{
|
sl@0
|
71 |
friend class CMetafileDevice;
|
sl@0
|
72 |
protected:
|
sl@0
|
73 |
IMPORT_C CMetafileGc(CMetafileDevice* aMetafileDevice, TInt anIndex);
|
sl@0
|
74 |
public:
|
sl@0
|
75 |
IMPORT_C ~CMetafileGc();
|
sl@0
|
76 |
IMPORT_C CGraphicsDevice* Device() const;
|
sl@0
|
77 |
IMPORT_C void SetOrigin(const TPoint& aPos = TPoint(0, 0));
|
sl@0
|
78 |
IMPORT_C void SetDrawMode(TDrawMode aDrawingMode);
|
sl@0
|
79 |
IMPORT_C void SetClippingRect(const TRect& aRect);
|
sl@0
|
80 |
IMPORT_C void CancelClippingRect();
|
sl@0
|
81 |
IMPORT_C void Reset();
|
sl@0
|
82 |
IMPORT_C void UseFont(const CFont* aFont);
|
sl@0
|
83 |
IMPORT_C void DiscardFont();
|
sl@0
|
84 |
IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
|
sl@0
|
85 |
IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
|
sl@0
|
86 |
IMPORT_C void SetWordJustification(TInt aExcessWidth, TInt aNumGaps);
|
sl@0
|
87 |
IMPORT_C void SetCharJustification(TInt aExcessWidth, TInt aNumChars);
|
sl@0
|
88 |
IMPORT_C void SetPenColor(const TRgb& aColor);
|
sl@0
|
89 |
IMPORT_C void SetPenStyle(TPenStyle aPenStyle);
|
sl@0
|
90 |
IMPORT_C void SetPenSize(const TSize& aSize);
|
sl@0
|
91 |
IMPORT_C void SetBrushColor(const TRgb& aColor);
|
sl@0
|
92 |
IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle);
|
sl@0
|
93 |
IMPORT_C void SetBrushOrigin(const TPoint& aOrigin);
|
sl@0
|
94 |
IMPORT_C void UseBrushPattern(const CFbsBitmap* aBitmap);
|
sl@0
|
95 |
IMPORT_C void DiscardBrushPattern();
|
sl@0
|
96 |
IMPORT_C void MoveTo(const TPoint& aPoint);
|
sl@0
|
97 |
IMPORT_C void MoveBy(const TPoint& aVector);
|
sl@0
|
98 |
IMPORT_C void Plot(const TPoint& aPoint);
|
sl@0
|
99 |
IMPORT_C void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
|
sl@0
|
100 |
IMPORT_C void DrawLine(const TPoint& aPoint1, const TPoint& aPoint2);
|
sl@0
|
101 |
IMPORT_C void DrawLineTo(const TPoint& aPoint);
|
sl@0
|
102 |
IMPORT_C void DrawLineBy(const TPoint& aVector);
|
sl@0
|
103 |
IMPORT_C void DrawPolyLine(const CArrayFix<TPoint>* aPointList);
|
sl@0
|
104 |
IMPORT_C void DrawPolyLine(const TPoint* aPointList, TInt aNumPoints);
|
sl@0
|
105 |
IMPORT_C void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
|
sl@0
|
106 |
IMPORT_C void DrawEllipse(const TRect& aRect);
|
sl@0
|
107 |
IMPORT_C void DrawRect(const TRect& aRect);
|
sl@0
|
108 |
IMPORT_C void DrawRoundRect(const TRect& aRect, const TSize& aCornerSize);
|
sl@0
|
109 |
IMPORT_C TInt DrawPolygon(const CArrayFix<TPoint>* aPointList, TFillRule aFillRule = EAlternate);
|
sl@0
|
110 |
IMPORT_C TInt DrawPolygon(const TPoint* aPointList, TInt aNumPoints, TFillRule aFillRule = EAlternate);
|
sl@0
|
111 |
IMPORT_C void DrawBitmap(const TPoint& aTopLeft, const CFbsBitmap* aSource);
|
sl@0
|
112 |
IMPORT_C void DrawBitmap(const TRect& aDestRect, const CFbsBitmap* aSource);
|
sl@0
|
113 |
IMPORT_C void DrawBitmap(const TRect& aDestRect, const CFbsBitmap* aSource, const TRect& aSourceRect);
|
sl@0
|
114 |
IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
|
sl@0
|
115 |
IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask);
|
sl@0
|
116 |
IMPORT_C void DrawText(const TDesC& aString, const TPoint& aPosition);
|
sl@0
|
117 |
IMPORT_C void DrawText(const TDesC& aString, const TRect& aBox, TInt aBaselineOffset, TTextAlign aHoriz = ELeft, TInt aLeftMrg = 0);
|
sl@0
|
118 |
|
sl@0
|
119 |
IMPORT_C void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs,TBool aMapForwards);
|
sl@0
|
120 |
IMPORT_C TInt SetClippingRegion(const TRegion &aRegion);
|
sl@0
|
121 |
IMPORT_C void CancelClippingRegion();
|
sl@0
|
122 |
IMPORT_C void DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp);
|
sl@0
|
123 |
IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
|
sl@0
|
124 |
IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
|
sl@0
|
125 |
IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
|
sl@0
|
126 |
|
sl@0
|
127 |
private:
|
sl@0
|
128 |
void ExternalizeBitmapL(const CFbsBitmap* aSource);
|
sl@0
|
129 |
private:
|
sl@0
|
130 |
CMetafileDevice* iDevice;
|
sl@0
|
131 |
TInt iIndex;
|
sl@0
|
132 |
};
|
sl@0
|
133 |
|
sl@0
|
134 |
/**
|
sl@0
|
135 |
* @internalTechnology
|
sl@0
|
136 |
* Internal to Symbian
|
sl@0
|
137 |
*/
|
sl@0
|
138 |
class CMetafilePlayback : public CBase
|
sl@0
|
139 |
{
|
sl@0
|
140 |
protected:
|
sl@0
|
141 |
IMPORT_C CMetafilePlayback(CGraphicsDevice* aDevice);
|
sl@0
|
142 |
public:
|
sl@0
|
143 |
IMPORT_C static CMetafilePlayback* NewL(CGraphicsDevice* aDevice);
|
sl@0
|
144 |
IMPORT_C ~CMetafilePlayback();
|
sl@0
|
145 |
IMPORT_C void DrawL(RReadStream& aReadStream);
|
sl@0
|
146 |
protected:
|
sl@0
|
147 |
CGraphicsDevice* iDevice;
|
sl@0
|
148 |
};
|
sl@0
|
149 |
|
sl@0
|
150 |
#endif
|
sl@0
|
151 |
|