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