xref: /AOO41X/main/vcl/inc/salgdi.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _SV_SALGDI_HXX
29*cdf0e10cSrcweir #define _SV_SALGDI_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "tools/string.hxx"
32*cdf0e10cSrcweir #include "rtl/ustring.hxx"
33*cdf0e10cSrcweir #include "vcl/sv.h"
34*cdf0e10cSrcweir #include "vcl/dllapi.h"
35*cdf0e10cSrcweir #include "vcl/salgtype.hxx"
36*cdf0e10cSrcweir #include "vos/thread.hxx"
37*cdf0e10cSrcweir #include "vcl/outdev.hxx"
38*cdf0e10cSrcweir #include "vcl/salnativewidgets.hxx"
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #include <map>
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir class ImplDevFontList;
43*cdf0e10cSrcweir class SalBitmap;
44*cdf0e10cSrcweir class ImplFontSelectData;
45*cdf0e10cSrcweir class ImplFontMetricData;
46*cdf0e10cSrcweir struct ImplKernPairData;
47*cdf0e10cSrcweir class ImplFontData;
48*cdf0e10cSrcweir class ImplFontCharMap;
49*cdf0e10cSrcweir class SalLayout;
50*cdf0e10cSrcweir class ImplLayoutArgs;
51*cdf0e10cSrcweir class Rectangle;
52*cdf0e10cSrcweir class FontSubsetInfo;
53*cdf0e10cSrcweir class OutputDevice;
54*cdf0e10cSrcweir class ServerFontLayout;
55*cdf0e10cSrcweir struct SystemGraphicsData;
56*cdf0e10cSrcweir struct SystemFontData;
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir namespace basegfx {
59*cdf0e10cSrcweir     class B2DVector;
60*cdf0e10cSrcweir     class B2DPolygon;
61*cdf0e10cSrcweir     class B2DPolyPolygon;
62*cdf0e10cSrcweir }
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir // ---------------------
65*cdf0e10cSrcweir // - SalGraphics-Codes -
66*cdf0e10cSrcweir // ---------------------
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir #define SAL_SETFONT_REMOVEANDMATCHNEW       ((sal_uInt16)0x0001)
69*cdf0e10cSrcweir #define SAL_SETFONT_USEDRAWTEXT             ((sal_uInt16)0x0002)
70*cdf0e10cSrcweir #define SAL_SETFONT_USEDRAWTEXTARRAY        ((sal_uInt16)0x0004)
71*cdf0e10cSrcweir #define SAL_SETFONT_UNICODE                 ((sal_uInt16)0x0008)
72*cdf0e10cSrcweir #define SAL_SETFONT_BADFONT                 ((sal_uInt16)0x1000)
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir #define SAL_COPYAREA_WINDOWINVALIDATE       ((sal_uInt16)0x0001)
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir // -------------------
77*cdf0e10cSrcweir // - common typedefs -
78*cdf0e10cSrcweir // -------------------
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir typedef sal_Unicode sal_Ucs; // TODO: use sal_UCS4 instead of sal_Unicode
81*cdf0e10cSrcweir typedef std::map< sal_Ucs, sal_Int32 >    Ucs2SIntMap;
82*cdf0e10cSrcweir typedef std::map< sal_Ucs, sal_uInt32 >   Ucs2UIntMap;
83*cdf0e10cSrcweir typedef std::map< sal_Ucs, rtl::OString > Ucs2OStrMap;
84*cdf0e10cSrcweir typedef std::vector< sal_Int32 > Int32Vector;
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir // ---------------
87*cdf0e10cSrcweir // - SalGraphics -
88*cdf0e10cSrcweir // ---------------
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir // note: if you add any new methods to class SalGraphics using coordinates
91*cdf0e10cSrcweir //       make sure they have a corresponding protected pure virtual method
92*cdf0e10cSrcweir //       which has to be implemented by the platform dependent part.
93*cdf0e10cSrcweir //       Add a method that performs coordinate mirroring if required, (see
94*cdf0e10cSrcweir //       existing methods as sample) and then calls the equivalent pure method.
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir // note: all positions are in pixel and relative to
97*cdf0e10cSrcweir // the top/left-position of the virtual output area
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC SalGraphics
100*cdf0e10cSrcweir {
101*cdf0e10cSrcweir 	int						m_nLayout; // 0: mirroring off, 1: mirror x-axis
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir protected:
104*cdf0e10cSrcweir     // flags which hold the SetAntialiasing() value from OutputDevice
105*cdf0e10cSrcweir     bool                    m_bAntiAliasB2DDraw;
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir public:
108*cdf0e10cSrcweir     // get/set AA
109*cdf0e10cSrcweir     void setAntiAliasB2DDraw(bool bNew) { m_bAntiAliasB2DDraw = bNew; }
110*cdf0e10cSrcweir     bool getAntiAliasB2DDraw() const { return m_bAntiAliasB2DDraw; }
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir     SalGraphics();
113*cdf0e10cSrcweir     virtual ~SalGraphics();
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir protected:
116*cdf0e10cSrcweir     virtual bool        setClipRegion( const Region& ) = 0;
117*cdf0e10cSrcweir     // draw --> LineColor and FillColor and RasterOp and ClipRegion
118*cdf0e10cSrcweir     virtual void		drawPixel( long nX, long nY ) = 0;
119*cdf0e10cSrcweir     virtual void		drawPixel( long nX, long nY, SalColor nSalColor ) = 0;
120*cdf0e10cSrcweir     virtual void		drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
121*cdf0e10cSrcweir     virtual void		drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
122*cdf0e10cSrcweir     virtual void		drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ) = 0;
123*cdf0e10cSrcweir     virtual void		drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ) = 0;
124*cdf0e10cSrcweir     virtual void		drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
125*cdf0e10cSrcweir     virtual bool        drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ) = 0;
126*cdf0e10cSrcweir     virtual bool        drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) = 0;
127*cdf0e10cSrcweir     virtual sal_Bool	drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
128*cdf0e10cSrcweir     virtual sal_Bool	drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
129*cdf0e10cSrcweir     virtual sal_Bool	drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry ) = 0;
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir     // CopyArea --> No RasterOp, but ClipRegion
132*cdf0e10cSrcweir     virtual void		copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
133*cdf0e10cSrcweir                                   long nSrcHeight, sal_uInt16 nFlags ) = 0;
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir     // CopyBits and DrawBitmap --> RasterOp and ClipRegion
136*cdf0e10cSrcweir     // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
137*cdf0e10cSrcweir     virtual void		copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ) = 0;
138*cdf0e10cSrcweir     virtual void		drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ) = 0;
139*cdf0e10cSrcweir     virtual void		drawBitmap( const SalTwoRect* pPosAry,
140*cdf0e10cSrcweir                                     const SalBitmap& rSalBitmap,
141*cdf0e10cSrcweir                                     SalColor nTransparentColor ) = 0;
142*cdf0e10cSrcweir     virtual void		drawBitmap( const SalTwoRect* pPosAry,
143*cdf0e10cSrcweir                                     const SalBitmap& rSalBitmap,
144*cdf0e10cSrcweir                                     const SalBitmap& rMaskBitmap ) = 0;
145*cdf0e10cSrcweir     virtual void		drawMask( const SalTwoRect* pPosAry,
146*cdf0e10cSrcweir                                   const SalBitmap& rSalBitmap,
147*cdf0e10cSrcweir                                   SalColor nMaskColor ) = 0;
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir     virtual SalBitmap*	getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
150*cdf0e10cSrcweir     virtual SalColor	getPixel( long nX, long nY ) = 0;
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir     // invert --> ClipRegion (only Windows or VirDevs)
153*cdf0e10cSrcweir     virtual void		invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) = 0;
154*cdf0e10cSrcweir     virtual void		invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir     virtual sal_Bool		drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) = 0;
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir     // native widget rendering methods that require mirroring
159*cdf0e10cSrcweir     virtual sal_Bool        hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
160*cdf0e10cSrcweir                                               const Point& aPos, sal_Bool& rIsInside );
161*cdf0e10cSrcweir     virtual sal_Bool        drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
162*cdf0e10cSrcweir                                            ControlState nState, const ImplControlValue& aValue,
163*cdf0e10cSrcweir                                            const rtl::OUString& aCaption );
164*cdf0e10cSrcweir     virtual sal_Bool        drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
165*cdf0e10cSrcweir                                                ControlState nState, const ImplControlValue& aValue,
166*cdf0e10cSrcweir                                                const rtl::OUString& aCaption );
167*cdf0e10cSrcweir     virtual sal_Bool        getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
168*cdf0e10cSrcweir                                                 const ImplControlValue& aValue, const rtl::OUString& aCaption,
169*cdf0e10cSrcweir                                                 Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir     /** Render bitmap with alpha channel
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir         @param rSourceBitmap
174*cdf0e10cSrcweir         Source bitmap to blit
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir         @param rAlphaBitmap
177*cdf0e10cSrcweir         Alpha channel to use for blitting
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir         @return true, if the operation succeeded, and false
180*cdf0e10cSrcweir         otherwise. In this case, clients should try to emulate alpha
181*cdf0e10cSrcweir         compositing themselves
182*cdf0e10cSrcweir      */
183*cdf0e10cSrcweir     virtual bool		drawAlphaBitmap( const SalTwoRect&,
184*cdf0e10cSrcweir                                          const SalBitmap& rSourceBitmap,
185*cdf0e10cSrcweir                                          const SalBitmap& rAlphaBitmap ) = 0;
186*cdf0e10cSrcweir     /** Render solid rectangle with given transparency
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir         @param nTransparency
189*cdf0e10cSrcweir         Transparency value (0-255) to use. 0 blits and opaque, 255 a
190*cdf0e10cSrcweir         fully transparent rectangle
191*cdf0e10cSrcweir      */
192*cdf0e10cSrcweir     virtual bool		drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) = 0;
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir public:
195*cdf0e10cSrcweir     // public SalGraphics methods, the interface to the independent vcl part
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir     // get device resolution
198*cdf0e10cSrcweir     virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
199*cdf0e10cSrcweir     // get the depth of the device
200*cdf0e10cSrcweir     virtual sal_uInt16			GetBitCount() = 0;
201*cdf0e10cSrcweir     // get the width of the device
202*cdf0e10cSrcweir     virtual long			GetGraphicsWidth() const = 0;
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir     // set the clip region to empty
205*cdf0e10cSrcweir     virtual void			ResetClipRegion() = 0;
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir     // set the line color to transparent (= don't draw lines)
208*cdf0e10cSrcweir     virtual void			SetLineColor() = 0;
209*cdf0e10cSrcweir     // set the line color to a specific color
210*cdf0e10cSrcweir     virtual void			SetLineColor( SalColor nSalColor ) = 0;
211*cdf0e10cSrcweir     // set the fill color to transparent (= don't fill)
212*cdf0e10cSrcweir     virtual void			SetFillColor() = 0;
213*cdf0e10cSrcweir     // set the fill color to a specific color, shapes will be
214*cdf0e10cSrcweir     // filled accordingly
215*cdf0e10cSrcweir     virtual void          	SetFillColor( SalColor nSalColor ) = 0;
216*cdf0e10cSrcweir     // enable/disable XOR drawing
217*cdf0e10cSrcweir     virtual void			SetXORMode( bool bSet, bool bInvertOnly ) = 0;
218*cdf0e10cSrcweir     // set line color for raster operations
219*cdf0e10cSrcweir     virtual void			SetROPLineColor( SalROPColor nROPColor ) = 0;
220*cdf0e10cSrcweir     // set fill color for raster operations
221*cdf0e10cSrcweir     virtual void			SetROPFillColor( SalROPColor nROPColor ) = 0;
222*cdf0e10cSrcweir     // set the text color to a specific color
223*cdf0e10cSrcweir     virtual void			SetTextColor( SalColor nSalColor ) = 0;
224*cdf0e10cSrcweir     // set the font
225*cdf0e10cSrcweir     virtual sal_uInt16         SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
226*cdf0e10cSrcweir     // release the fonts
227*cdf0e10cSrcweir     void                   ReleaseFonts() { SetFont( NULL, 0 ); }
228*cdf0e10cSrcweir     // get the current font's metrics
229*cdf0e10cSrcweir     virtual void			GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir     // get kernign pairs of the current font
232*cdf0e10cSrcweir     // return only PairCount if (pKernPairs == NULL)
233*cdf0e10cSrcweir     virtual sal_uLong			GetKernPairs( sal_uLong nMaxPairCount, ImplKernPairData* ) = 0;
234*cdf0e10cSrcweir     // get the repertoire of the current font
235*cdf0e10cSrcweir     virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
236*cdf0e10cSrcweir     // graphics must fill supplied font list
237*cdf0e10cSrcweir     virtual void			GetDevFontList( ImplDevFontList* ) = 0;
238*cdf0e10cSrcweir     // graphics should call ImplAddDevFontSubstitute on supplied
239*cdf0e10cSrcweir     // OutputDevice for all its device specific preferred font substitutions
240*cdf0e10cSrcweir     virtual void			GetDevFontSubstList( OutputDevice* ) = 0;
241*cdf0e10cSrcweir     virtual bool			AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ) = 0;
242*cdf0e10cSrcweir     // CreateFontSubset: a method to get a subset of glyhps of a font
243*cdf0e10cSrcweir     // inside a new valid font file
244*cdf0e10cSrcweir     // returns sal_True if creation of subset was successfull
245*cdf0e10cSrcweir     // parameters: rToFile: contains a osl file URL to write the subset to
246*cdf0e10cSrcweir     //             pFont: describes from which font to create a subset
247*cdf0e10cSrcweir     //             pGlyphIDs: the glyph ids to be extracted
248*cdf0e10cSrcweir     //             pEncoding: the character code corresponding to each glyph
249*cdf0e10cSrcweir     //             pWidths: the advance widths of the correspoding glyphs (in PS font units)
250*cdf0e10cSrcweir     //             nGlyphs: the number of glyphs
251*cdf0e10cSrcweir     //             rInfo: additional outgoing information
252*cdf0e10cSrcweir     // implementation note: encoding 0 with glyph id 0 should be added implicitly
253*cdf0e10cSrcweir     // as "undefined character"
254*cdf0e10cSrcweir     virtual sal_Bool			CreateFontSubset( const rtl::OUString& rToFile,
255*cdf0e10cSrcweir                                               const ImplFontData* pFont,
256*cdf0e10cSrcweir                                               sal_Int32* pGlyphIDs,
257*cdf0e10cSrcweir                                               sal_uInt8* pEncoding,
258*cdf0e10cSrcweir                                               sal_Int32* pWidths,
259*cdf0e10cSrcweir                                               int nGlyphs,
260*cdf0e10cSrcweir                                               FontSubsetInfo& rInfo // out parameter
261*cdf0e10cSrcweir                                               ) = 0;
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir     // GetFontEncodingVector: a method to get the encoding map Unicode
264*cdf0e10cSrcweir 	// to font encoded character; this is only used for type1 fonts and
265*cdf0e10cSrcweir     // may return NULL in case of unknown encoding vector
266*cdf0e10cSrcweir     // if ppNonEncoded is set and non encoded characters (that is type1
267*cdf0e10cSrcweir     // glyphs with only a name) exist it is set to the corresponding
268*cdf0e10cSrcweir     // map for non encoded glyphs; the encoding vector contains -1
269*cdf0e10cSrcweir     // as encoding for these cases
270*cdf0e10cSrcweir     virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ) = 0;
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir     // GetEmbedFontData: gets the font data for a font marked
273*cdf0e10cSrcweir     // embeddable by GetDevFontList or NULL in case of error
274*cdf0e10cSrcweir     // parameters: pFont: describes the font in question
275*cdf0e10cSrcweir     //             pUnicodes: contains the Unicodes assigned to
276*cdf0e10cSrcweir     //             code points 0 to 255; must contain at least 256 members
277*cdf0e10cSrcweir     //             pWidths: the widths of all glyphs from char code 0 to 255
278*cdf0e10cSrcweir     //                      pWidths MUST support at least 256 members;
279*cdf0e10cSrcweir     //             rInfo: additional outgoing information
280*cdf0e10cSrcweir     //             pDataLen: out parameter, contains the byte length of the returned buffer
281*cdf0e10cSrcweir     virtual const void* GetEmbedFontData( const ImplFontData* pFont,
282*cdf0e10cSrcweir                                           const sal_Ucs* pUnicodes,
283*cdf0e10cSrcweir                                           sal_Int32* pWidths,
284*cdf0e10cSrcweir                                           FontSubsetInfo& rInfo,
285*cdf0e10cSrcweir                                           long* pDataLen ) = 0;
286*cdf0e10cSrcweir     // frees the font data again
287*cdf0e10cSrcweir     virtual void			FreeEmbedFontData( const void* pData, long nDataLen ) = 0;
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir     // get the same widths as in CreateFontSubset and GetEmbedFontData
290*cdf0e10cSrcweir     // in case of an embeddable font also fill the mapping
291*cdf0e10cSrcweir     // between unicode and glyph id
292*cdf0e10cSrcweir     // leave widths vector and mapping untouched in case of failure
293*cdf0e10cSrcweir     virtual void            GetGlyphWidths( const ImplFontData* pFont,
294*cdf0e10cSrcweir                                             bool bVertical,
295*cdf0e10cSrcweir                                             Int32Vector& rWidths,
296*cdf0e10cSrcweir                                             Ucs2UIntMap& rUnicodeEnc ) = 0;
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir     virtual sal_Bool                    GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
299*cdf0e10cSrcweir     virtual sal_Bool                    GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir     virtual SalLayout*              GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
302*cdf0e10cSrcweir     virtual void					 DrawServerFontLayout( const ServerFontLayout& ) = 0;
303*cdf0e10cSrcweir     /** Filter text from DrawText commands in a device specific manner
304*cdf0e10cSrcweir         <p>
305*cdf0e10cSrcweir         This function allows a device (or rather the corresponding SalGraphics
306*cdf0e10cSrcweir         implementation) to prevent text portions from being drawn. This currently
307*cdf0e10cSrcweir         is used only for filtering out the fax number in a document that is printed
308*cdf0e10cSrcweir         to one of psprint's specialized "fax" printers.
309*cdf0e10cSrcweir         </p>
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir         @param rOrigText
312*cdf0e10cSrcweir         The original text
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir         @param rNewText
315*cdf0e10cSrcweir         A String that will be filled with the adjusted version
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir         @param nIndex
318*cdf0e10cSrcweir         The index inside <code>rOrigText</code> that marks the first draw character
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir         @param rLen
321*cdf0e10cSrcweir         in: length of text beginning at <code>nIndex</code> to be drawn
322*cdf0e10cSrcweir         out: length of <code>rNewText</code> containing the substituted text
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir         @param rCutStart
325*cdf0e10cSrcweir         out: index at which the cutout portion of <code>rOrigText</code> begins
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir         @param rCutStop
328*cdf0e10cSrcweir         out: index at which the cutout portion of <code>rOrigText</code> ends
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir         @returns
331*cdf0e10cSrcweir         true: a substitution has taken place and rNewText rLen, rCutStart and rCutStop have been filled accordingly
332*cdf0e10cSrcweir         false: no substitution has taken place, rNewText, rLen, rCutStart, rCutStop remain unchanged
333*cdf0e10cSrcweir      */
334*cdf0e10cSrcweir     virtual bool            filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir     virtual bool            supportsOperation( OutDevSupportType ) const = 0;
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir     // mirroring specifica
339*cdf0e10cSrcweir 	int						GetLayout() { return m_nLayout; }
340*cdf0e10cSrcweir 	void					SetLayout( int aLayout ) { m_nLayout = aLayout;}
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir 	void					mirror( long& nX, const OutputDevice *pOutDev, bool bBack = false ) const;
343*cdf0e10cSrcweir 	void					mirror( long& nX, long& nWidth, const OutputDevice *pOutDev, bool bBack = false ) const;
344*cdf0e10cSrcweir 	sal_Bool					mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack = false ) const;
345*cdf0e10cSrcweir     void                    mirror( Rectangle& rRect, const OutputDevice*, bool bBack = false ) const;
346*cdf0e10cSrcweir     void                    mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack = false ) const;
347*cdf0e10cSrcweir     void                    mirror( ControlType,const ImplControlValue&,const OutputDevice*,bool bBack = false) const;
348*cdf0e10cSrcweir 	basegfx::B2DPoint       mirror( const basegfx::B2DPoint& i_rPoint, const OutputDevice *pOutDev, bool bBack = false ) const;
349*cdf0e10cSrcweir 	basegfx::B2DPolygon     mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
350*cdf0e10cSrcweir 	basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir     // non virtual methods; these do possible coordinate mirroring and
353*cdf0e10cSrcweir     // then delegate to protected virtual methods
354*cdf0e10cSrcweir     bool                    SetClipRegion( const Region&, const OutputDevice *pOutDev );
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir     // draw --> LineColor and FillColor and RasterOp and ClipRegion
357*cdf0e10cSrcweir     void                    DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
358*cdf0e10cSrcweir     void                    DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev );
359*cdf0e10cSrcweir     void                    DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
360*cdf0e10cSrcweir     void                    DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
361*cdf0e10cSrcweir     void                    DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
362*cdf0e10cSrcweir     void                    DrawPolygon( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
363*cdf0e10cSrcweir     void                    DrawPolyPolygon( sal_uInt32 nPoly,
364*cdf0e10cSrcweir                                              const sal_uInt32* pPoints,
365*cdf0e10cSrcweir                                              PCONSTSALPOINT* pPtAry,
366*cdf0e10cSrcweir                                              const OutputDevice *pOutDev );
367*cdf0e10cSrcweir     bool                    DrawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency, const OutputDevice* );
368*cdf0e10cSrcweir     bool                    DrawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, const OutputDevice* );
369*cdf0e10cSrcweir     sal_Bool                DrawPolyLineBezier( sal_uLong nPoints,
370*cdf0e10cSrcweir                                                 const SalPoint* pPtAry,
371*cdf0e10cSrcweir                                                 const sal_uInt8* pFlgAry,
372*cdf0e10cSrcweir                                                 const OutputDevice *pOutDev );
373*cdf0e10cSrcweir     sal_Bool                DrawPolygonBezier( sal_uLong nPoints,
374*cdf0e10cSrcweir                                                const SalPoint* pPtAry,
375*cdf0e10cSrcweir                                                const sal_uInt8* pFlgAry,
376*cdf0e10cSrcweir                                                const OutputDevice *pOutDev );
377*cdf0e10cSrcweir     sal_Bool                DrawPolyPolygonBezier( sal_uInt32 nPoly,
378*cdf0e10cSrcweir                                                    const sal_uInt32* pPoints,
379*cdf0e10cSrcweir                                                    const SalPoint* const* pPtAry,
380*cdf0e10cSrcweir                                                    const sal_uInt8* const* pFlgAry,
381*cdf0e10cSrcweir                                                    const OutputDevice *pOutDev );
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir     // CopyArea --> No RasterOp, but ClipRegion
384*cdf0e10cSrcweir     void                    CopyArea( long nDestX,
385*cdf0e10cSrcweir                                       long nDestY,
386*cdf0e10cSrcweir                                       long nSrcX,
387*cdf0e10cSrcweir                                       long nSrcY,
388*cdf0e10cSrcweir                                       long nSrcWidth,
389*cdf0e10cSrcweir                                       long nSrcHeight,
390*cdf0e10cSrcweir                                       sal_uInt16 nFlags,
391*cdf0e10cSrcweir                                       const OutputDevice *pOutDev );
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir     // CopyBits and DrawBitmap --> RasterOp and ClipRegion
394*cdf0e10cSrcweir     // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
395*cdf0e10cSrcweir     void                    CopyBits( const SalTwoRect* pPosAry,
396*cdf0e10cSrcweir                                       SalGraphics* pSrcGraphics,
397*cdf0e10cSrcweir                                       const OutputDevice *pOutDev,
398*cdf0e10cSrcweir                                       const OutputDevice *pSrcOutDev );
399*cdf0e10cSrcweir     void                    DrawBitmap( const SalTwoRect* pPosAry,
400*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
401*cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
402*cdf0e10cSrcweir     void                    DrawBitmap( const SalTwoRect* pPosAry,
403*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
404*cdf0e10cSrcweir                                         SalColor nTransparentColor,
405*cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
406*cdf0e10cSrcweir     void                    DrawBitmap( const SalTwoRect* pPosAry,
407*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
408*cdf0e10cSrcweir                                         const SalBitmap& rTransparentBitmap,
409*cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir     void                    DrawMask( const SalTwoRect* pPosAry,
412*cdf0e10cSrcweir                                       const SalBitmap& rSalBitmap,
413*cdf0e10cSrcweir                                       SalColor nMaskColor,
414*cdf0e10cSrcweir                                       const OutputDevice *pOutDev );
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir     SalBitmap*              GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
417*cdf0e10cSrcweir     SalColor                GetPixel( long nX, long nY, const OutputDevice *pOutDev );
418*cdf0e10cSrcweir 
419*cdf0e10cSrcweir     // invert --> ClipRegion (only Windows)
420*cdf0e10cSrcweir     void                    Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
421*cdf0e10cSrcweir     void                    Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
422*cdf0e10cSrcweir 
423*cdf0e10cSrcweir     sal_Bool                    DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev );
424*cdf0e10cSrcweir 
425*cdf0e10cSrcweir     //-------------------------------------
426*cdf0e10cSrcweir     //  Native Widget Rendering functions
427*cdf0e10cSrcweir     //-------------------------------------
428*cdf0e10cSrcweir 
429*cdf0e10cSrcweir     // Query the platform layer for control support
430*cdf0e10cSrcweir     virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
431*cdf0e10cSrcweir 
432*cdf0e10cSrcweir     // Query the native control to determine if it was acted upon
433*cdf0e10cSrcweir     sal_Bool HitTestNativeControl( ControlType nType,
434*cdf0e10cSrcweir 									  ControlPart nPart,
435*cdf0e10cSrcweir 									  const Rectangle& rControlRegion,
436*cdf0e10cSrcweir 									  const Point& aPos,
437*cdf0e10cSrcweir                                       sal_Bool& rIsInside,
438*cdf0e10cSrcweir                                       const OutputDevice *pOutDev );
439*cdf0e10cSrcweir 
440*cdf0e10cSrcweir     // Request rendering of a particular control and/or part
441*cdf0e10cSrcweir     sal_Bool DrawNativeControl( ControlType nType,
442*cdf0e10cSrcweir 									ControlPart nPart,
443*cdf0e10cSrcweir 									const Rectangle& rControlRegion,
444*cdf0e10cSrcweir 									ControlState nState,
445*cdf0e10cSrcweir 									const ImplControlValue& aValue,
446*cdf0e10cSrcweir 									const rtl::OUString& aCaption,
447*cdf0e10cSrcweir                                     const OutputDevice *pOutDev );
448*cdf0e10cSrcweir 
449*cdf0e10cSrcweir     // Request rendering of a caption string for a control
450*cdf0e10cSrcweir     sal_Bool DrawNativeControlText( ControlType nType,
451*cdf0e10cSrcweir 										ControlPart nPart,
452*cdf0e10cSrcweir 										const Rectangle& rControlRegion,
453*cdf0e10cSrcweir 										ControlState nState,
454*cdf0e10cSrcweir 										const ImplControlValue& aValue,
455*cdf0e10cSrcweir 										const rtl::OUString& aCaption,
456*cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
457*cdf0e10cSrcweir 
458*cdf0e10cSrcweir     // Query the native control's actual drawing region (including adornment)
459*cdf0e10cSrcweir     sal_Bool GetNativeControlRegion( ControlType nType,
460*cdf0e10cSrcweir 										 ControlPart nPart,
461*cdf0e10cSrcweir 										 const Rectangle& rControlRegion,
462*cdf0e10cSrcweir 										 ControlState nState,
463*cdf0e10cSrcweir 										 const ImplControlValue& aValue,
464*cdf0e10cSrcweir 										 const rtl::OUString& aCaption,
465*cdf0e10cSrcweir 										 Rectangle &rNativeBoundingRegion,
466*cdf0e10cSrcweir 										 Rectangle &rNativeContentRegion,
467*cdf0e10cSrcweir                                          const OutputDevice *pOutDev );
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir     static void AddDevFontSubstitute( OutputDevice* pOutDev,
470*cdf0e10cSrcweir                                       const String& rFontName,
471*cdf0e10cSrcweir                                       const String& rReplaceFontName,
472*cdf0e10cSrcweir                                       sal_uInt16 nFlags = 0 );
473*cdf0e10cSrcweir 
474*cdf0e10cSrcweir     bool DrawAlphaBitmap( const SalTwoRect&,
475*cdf0e10cSrcweir                           const SalBitmap& rSourceBitmap,
476*cdf0e10cSrcweir                           const SalBitmap& rAlphaBitmap,
477*cdf0e10cSrcweir                           const OutputDevice *pOutDev );
478*cdf0e10cSrcweir 
479*cdf0e10cSrcweir     bool DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
480*cdf0e10cSrcweir                         sal_uInt8 nTransparency, const OutputDevice *pOutDev );
481*cdf0e10cSrcweir 
482*cdf0e10cSrcweir     virtual SystemGraphicsData   GetGraphicsData() const = 0;
483*cdf0e10cSrcweir     virtual SystemFontData       GetSysFontData( int nFallbacklevel ) const = 0;
484*cdf0e10cSrcweir };
485*cdf0e10cSrcweir 
486*cdf0e10cSrcweir #endif // _SV_SALGDI_HXX
487