1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drawdev.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
36 #ifndef _OUTDEV_HXX //autogen
37 #include <vcl/outdev.hxx>
40 /*************************************************************************
43 * Alle Draw-Methoden werden um den Offset *pPos verschoben.
44 *************************************************************************/
52 inline SwDrawDev( OutputDevice
*pOutDev
, const Point
*pPosition
)
53 :pOut(pOutDev
), pPos(pPosition
) { }
55 inline OutputDevice
*GetOut() { return pOut
; }
58 inline void DrawText( const Point
& rStart
, const String
& rTxt
,
59 const USHORT nIdx
= 0,
60 const USHORT nLen
= STRING_LEN
);
61 inline void DrawStretchText( const Point
& rStart
, USHORT nWidth
,
63 const USHORT nIdx
= 0,
64 const USHORT nLen
= STRING_LEN
);
65 inline void DrawTextArray( const Point
& rStart
,
68 const USHORT nIdx
= 0,
69 const USHORT nLen
= STRING_LEN
);
70 inline void DrawLine( const Point
& rStart
, const Point
& rEnd
);
71 inline void DrawRect( const SwRect
& rRect
,
72 const USHORT nHorzRount
= 0,
73 const USHORT nVertRound
= 0 );
75 inline const Point
*GetOrigin() const {return pPos
; }
78 /*************************************************************************
80 *************************************************************************/
82 inline void SwDrawDev::DrawText( const Point
& rStart
, const String
& rTxt
,
83 const USHORT nIdx
, const USHORT nLen
)
86 pOut
->DrawText( rStart
, rTxt
, nIdx
, nLen
);
88 pOut
->DrawText( rStart
- *pPos
, rTxt
, nIdx
, nLen
);
91 /*************************************************************************
92 * SwDrawDev::DrawStretchText
93 *************************************************************************/
95 inline void SwDrawDev::DrawStretchText( const Point
& rStart
, USHORT nWidth
,
96 const String
& rTxt
, const USHORT nIdx
, const USHORT nLen
)
99 pOut
->DrawStretchText( rStart
, nWidth
, rTxt
, nIdx
, nLen
);
101 pOut
->DrawStretchText( rStart
- *pPos
, nWidth
, rTxt
, nIdx
, nLen
);
104 /*************************************************************************
105 * SwDrawDev::DrawTextArray
106 *************************************************************************/
108 inline void SwDrawDev::DrawTextArray( const Point
& rStart
, const String
& rTxt
,
109 long *pKernArray
, const USHORT nIdx
, const USHORT nLen
)
112 pOut
->DrawTextArray( rStart
, rTxt
, pKernArray
, nIdx
, nLen
);
114 pOut
->DrawTextArray( rStart
- *pPos
, rTxt
, pKernArray
, nIdx
, nLen
);
117 /*************************************************************************
118 * SwDrawDev::DrawLine
119 *************************************************************************/
121 inline void SwDrawDev::DrawLine( const Point
& rStart
, const Point
& rEnd
)
124 pOut
->DrawLine( rStart
, rEnd
);
126 pOut
->DrawLine( rStart
- *pPos
, rEnd
- *pPos
);
129 /*************************************************************************
130 * SwDrawDev::DrawRect
131 *************************************************************************/
133 inline void SwDrawDev::DrawRect( const SwRect
& rRect
,
134 const USHORT nHorzRound
, const USHORT nVertRound
)
136 SwRect
aRect( rRect
);
138 aRect
.Pos() -= *pPos
;
139 pOut
->DrawRect( aRect
.SVRect(), nHorzRound
, nVertRound
);