1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*3334a7e6SAndrew Rist * distributed with this work for additional information
6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at
10*3334a7e6SAndrew Rist *
11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist *
13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the
17*3334a7e6SAndrew Rist * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist * under the License.
19*3334a7e6SAndrew Rist *
20*3334a7e6SAndrew Rist *************************************************************/
21*3334a7e6SAndrew Rist
22*3334a7e6SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #ifndef SVX_FRAMELINK_HXX
25cdf0e10cSrcweir #define SVX_FRAMELINK_HXX
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <algorithm>
28cdf0e10cSrcweir #include <sal/types.h>
29cdf0e10cSrcweir #include <tools/gen.hxx>
30cdf0e10cSrcweir #include <tools/color.hxx>
31cdf0e10cSrcweir #include "svx/svxdllapi.h"
32cdf0e10cSrcweir
33cdf0e10cSrcweir class OutputDevice;
34cdf0e10cSrcweir class SvxBorderLine;
35cdf0e10cSrcweir
36cdf0e10cSrcweir namespace svx {
37cdf0e10cSrcweir namespace frame {
38cdf0e10cSrcweir
39cdf0e10cSrcweir // ============================================================================
40cdf0e10cSrcweir // Enums
41cdf0e10cSrcweir // ============================================================================
42cdf0e10cSrcweir
43cdf0e10cSrcweir /** Specifies how the reference points for frame borders are used.
44cdf0e10cSrcweir */
45cdf0e10cSrcweir enum RefMode
46cdf0e10cSrcweir {
47cdf0e10cSrcweir /** Frame borders are drawn centered to the reference points. */
48cdf0e10cSrcweir REFMODE_CENTERED,
49cdf0e10cSrcweir
50cdf0e10cSrcweir /** The reference points specify the begin of the frame border width.
51cdf0e10cSrcweir
52cdf0e10cSrcweir The result is that horizontal lines are drawn below, and vertical lines
53cdf0e10cSrcweir are drawn right of the reference points.
54cdf0e10cSrcweir */
55cdf0e10cSrcweir REFMODE_BEGIN,
56cdf0e10cSrcweir
57cdf0e10cSrcweir /** The reference points specify the end of the frame border width.
58cdf0e10cSrcweir
59cdf0e10cSrcweir The result is that horizontal lines are drawn above, and vertical lines
60cdf0e10cSrcweir are drawn left of the reference points.
61cdf0e10cSrcweir */
62cdf0e10cSrcweir REFMODE_END
63cdf0e10cSrcweir };
64cdf0e10cSrcweir
65cdf0e10cSrcweir // ============================================================================
66cdf0e10cSrcweir // Classes
67cdf0e10cSrcweir // ============================================================================
68cdf0e10cSrcweir
69cdf0e10cSrcweir /** Contains the widths of primary and secondary line of a frame style.
70cdf0e10cSrcweir
71cdf0e10cSrcweir In the following, "frame style" is a complete style of one frame border,
72cdf0e10cSrcweir i.e. the double line at the left side of the frame. A "line" is always a
73cdf0e10cSrcweir trivial single line, i.e. the first line of a double frame style.
74cdf0e10cSrcweir
75cdf0e10cSrcweir The following states of the members of this struct are valid:
76cdf0e10cSrcweir
77cdf0e10cSrcweir mnPrim mnDist mnSecn frame style
78cdf0e10cSrcweir -------------------------------------------------
79cdf0e10cSrcweir 0 0 0 invisible
80cdf0e10cSrcweir >0 0 0 single
81cdf0e10cSrcweir >0 >0 >0 double
82cdf0e10cSrcweir
83cdf0e10cSrcweir The behaviour of the member functions for other states is not defined.
84cdf0e10cSrcweir
85cdf0e10cSrcweir Per definition the primary line in double frame styles is:
86cdf0e10cSrcweir - The top line for horizontal frame borders.
87cdf0e10cSrcweir - The left line for vertical frame borders.
88cdf0e10cSrcweir - The bottom-left line for top-left to bottom-right diagonal frame borders.
89cdf0e10cSrcweir - The top-left line for bottom-left to top-right diagonal frame borders.
90cdf0e10cSrcweir
91cdf0e10cSrcweir The following picture shows the upper end of a vertical double frame
92cdf0e10cSrcweir border.
93cdf0e10cSrcweir
94cdf0e10cSrcweir |<---------------- GetWidth() ----------------->|
95cdf0e10cSrcweir | |
96cdf0e10cSrcweir |<----- mnPrim ----->||<- mnDist ->||<- mnSecn >|
97cdf0e10cSrcweir | || || |
98cdf0e10cSrcweir ###################### #############
99cdf0e10cSrcweir ###################### #############
100cdf0e10cSrcweir ###################### #############
101cdf0e10cSrcweir ###################### #############
102cdf0e10cSrcweir ###################### | #############
103cdf0e10cSrcweir ###################### | #############
104cdf0e10cSrcweir |
105cdf0e10cSrcweir |<- middle of the frame border
106cdf0e10cSrcweir */
107cdf0e10cSrcweir class SVX_DLLPUBLIC Style
108cdf0e10cSrcweir {
109cdf0e10cSrcweir public:
110cdf0e10cSrcweir /** Constructs an invisible frame style. */
Style()111cdf0e10cSrcweir inline explicit Style() : meRefMode( REFMODE_CENTERED ), mnPrim( 0 ), mnDist( 0 ), mnSecn( 0 ), mbDotted( false ) {}
112cdf0e10cSrcweir /** Constructs a frame style with passed line widths. */
Style(sal_uInt16 nP,sal_uInt16 nD,sal_uInt16 nS)113cdf0e10cSrcweir inline explicit Style( sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS ) :
114cdf0e10cSrcweir meRefMode( REFMODE_CENTERED ), mbDotted( false )
115cdf0e10cSrcweir { Set( nP, nD, nS ); }
116cdf0e10cSrcweir /** Constructs a frame style with passed color and line widths. */
Style(const Color & rColor,sal_uInt16 nP,sal_uInt16 nD,sal_uInt16 nS)117cdf0e10cSrcweir inline explicit Style( const Color& rColor, sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS ) :
118cdf0e10cSrcweir meRefMode( REFMODE_CENTERED ), mbDotted( false )
119cdf0e10cSrcweir { Set( rColor, nP, nD, nS ); }
120cdf0e10cSrcweir /** Constructs a frame style from the passed SvxBorderLine struct. */
Style(const SvxBorderLine & rBorder,double fScale=1.0,sal_uInt16 nMaxWidth=SAL_MAX_UINT16,bool=false)121cdf0e10cSrcweir inline explicit Style( const SvxBorderLine& rBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16, bool /*bUseDots*/ = false ) :
122cdf0e10cSrcweir meRefMode( REFMODE_CENTERED ) { Set( rBorder, fScale, nMaxWidth ); }
123cdf0e10cSrcweir /** Constructs a frame style from the passed SvxBorderLine struct. Clears the style, if pBorder is 0. */
Style(const SvxBorderLine * pBorder,double fScale=1.0,sal_uInt16 nMaxWidth=SAL_MAX_UINT16,bool=false)124cdf0e10cSrcweir inline explicit Style( const SvxBorderLine* pBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16, bool /*bUseDots*/ = false ) :
125cdf0e10cSrcweir meRefMode( REFMODE_CENTERED ) { Set( pBorder, fScale, nMaxWidth ); }
126cdf0e10cSrcweir
GetRefMode() const127cdf0e10cSrcweir inline RefMode GetRefMode() const { return meRefMode; }
GetColor() const128cdf0e10cSrcweir inline const Color& GetColor() const { return maColor; }
Prim() const129cdf0e10cSrcweir inline sal_uInt16 Prim() const { return mnPrim; }
Dist() const130cdf0e10cSrcweir inline sal_uInt16 Dist() const { return mnDist; }
Secn() const131cdf0e10cSrcweir inline sal_uInt16 Secn() const { return mnSecn; }
Dotted() const132cdf0e10cSrcweir inline bool Dotted() const { return mbDotted; }
133cdf0e10cSrcweir
134cdf0e10cSrcweir /** Returns the total width of this frame style. */
GetWidth() const135cdf0e10cSrcweir inline sal_uInt16 GetWidth() const { return mnPrim + mnDist + mnSecn; }
136cdf0e10cSrcweir
137cdf0e10cSrcweir
138cdf0e10cSrcweir /** Sets the frame style to invisible state. */
139cdf0e10cSrcweir void Clear();
140cdf0e10cSrcweir /** Sets the frame style to the passed line widths. */
141cdf0e10cSrcweir void Set( sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS );
142cdf0e10cSrcweir /** Sets the frame style to the passed line widths. */
143cdf0e10cSrcweir void Set( const Color& rColor, sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS );
144cdf0e10cSrcweir /** Sets the frame style to the passed SvxBorderLine struct. */
145cdf0e10cSrcweir void Set( const SvxBorderLine& rBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16, bool /*bUseDots*/ = false );
146cdf0e10cSrcweir /** Sets the frame style to the passed SvxBorderLine struct. Clears the style, if pBorder is 0. */
147cdf0e10cSrcweir void Set( const SvxBorderLine* pBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16, bool /*bUseDots*/ = false );
148cdf0e10cSrcweir
149cdf0e10cSrcweir /** Sets a new reference point handling mode, does not modify other settings. */
SetRefMode(RefMode eRefMode)150cdf0e10cSrcweir inline void SetRefMode( RefMode eRefMode ) { meRefMode = eRefMode; }
151cdf0e10cSrcweir /** Sets a new color, does not modify other settings. */
SetColor(const Color & rColor)152cdf0e10cSrcweir inline void SetColor( const Color& rColor ) { maColor = rColor; }
153cdf0e10cSrcweir /** Sets whether to use dotted style for single hair lines. */
SetDotted(bool bDotted)154cdf0e10cSrcweir inline void SetDotted( bool bDotted ) { mbDotted = bDotted; }
155cdf0e10cSrcweir
156cdf0e10cSrcweir /** Scales the style by the specified scaling factor. Ensures that visible lines keep visible. */
157cdf0e10cSrcweir Style& ScaleSelf( double fScale, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 );
158cdf0e10cSrcweir /** Returns this style scaled by the specified scaling factor. Ensures that visible lines keep visible. */
159cdf0e10cSrcweir Style Scale( double fScale, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ) const;
160cdf0e10cSrcweir
161cdf0e10cSrcweir /** Mirrors this style (exchanges primary and secondary), if it is a double frame style. */
162cdf0e10cSrcweir Style& MirrorSelf();
163cdf0e10cSrcweir /** Returns this style mirrored, if it is a double frame style, otherwise a simple copy. */
164cdf0e10cSrcweir Style Mirror() const;
165cdf0e10cSrcweir
166cdf0e10cSrcweir private:
167cdf0e10cSrcweir Color maColor; /// The color of the line(s) of this frame border.
168cdf0e10cSrcweir RefMode meRefMode; /// Reference point handling for this frame border.
169cdf0e10cSrcweir sal_uInt16 mnPrim; /// Width of primary (single, left, or top) line.
170cdf0e10cSrcweir sal_uInt16 mnDist; /// Distance between primary and secondary line.
171cdf0e10cSrcweir sal_uInt16 mnSecn; /// Width of secondary (right or bottom) line.
172cdf0e10cSrcweir bool mbDotted; /// true = Draw dotted lines; false = Draw solid lines.
173cdf0e10cSrcweir };
174cdf0e10cSrcweir
175cdf0e10cSrcweir bool operator==( const Style& rL, const Style& rR );
176cdf0e10cSrcweir SVX_DLLPUBLIC bool operator<( const Style& rL, const Style& rR );
177cdf0e10cSrcweir
operator !=(const Style & rL,const Style & rR)178cdf0e10cSrcweir inline bool operator!=( const Style& rL, const Style& rR ) { return !(rL == rR); }
operator >(const Style & rL,const Style & rR)179cdf0e10cSrcweir inline bool operator>( const Style& rL, const Style& rR ) { return rR < rL; }
operator <=(const Style & rL,const Style & rR)180cdf0e10cSrcweir inline bool operator<=( const Style& rL, const Style& rR ) { return !(rR < rL); }
operator >=(const Style & rL,const Style & rR)181cdf0e10cSrcweir inline bool operator>=( const Style& rL, const Style& rR ) { return !(rL < rR); }
182cdf0e10cSrcweir
183cdf0e10cSrcweir // ----------------------------------------------------------------------------
184cdf0e10cSrcweir
185cdf0e10cSrcweir /** Extends the Style struct with an angle for diagonal frame borders.
186cdf0e10cSrcweir
187cdf0e10cSrcweir The angle is specified in radian (a full circle is equivalent to 2*PI).
188cdf0e10cSrcweir It is dependent on the context, how the value is interpreted, i.e. it may
189cdf0e10cSrcweir specify the angle to a horizontal or vertical frame border.
190cdf0e10cSrcweir */
191cdf0e10cSrcweir class DiagStyle : public Style
192cdf0e10cSrcweir {
193cdf0e10cSrcweir public:
194cdf0e10cSrcweir /** Constructs an invisible diagonal frame style. */
DiagStyle()195cdf0e10cSrcweir inline explicit DiagStyle() : mfAngle( 0.0 ) {}
196cdf0e10cSrcweir /** Constructs a diagonal frame style passed style and angle. */
DiagStyle(const Style & rStyle,double fAngle)197cdf0e10cSrcweir inline explicit DiagStyle( const Style& rStyle, double fAngle ) :
198cdf0e10cSrcweir Style( rStyle ), mfAngle( fAngle ) {}
199cdf0e10cSrcweir
GetAngle() const200cdf0e10cSrcweir inline double GetAngle() const { return mfAngle; }
201cdf0e10cSrcweir
202cdf0e10cSrcweir /** Returns this style mirrored, if it is a double frame style, otherwise a simple copy. */
Mirror() const203cdf0e10cSrcweir inline DiagStyle Mirror() const { return DiagStyle( Style::Mirror(), mfAngle ); }
204cdf0e10cSrcweir
205cdf0e10cSrcweir private:
206cdf0e10cSrcweir double mfAngle; /// Angle between this and hor. or vert. border.
207cdf0e10cSrcweir };
208cdf0e10cSrcweir
209cdf0e10cSrcweir // ============================================================================
210cdf0e10cSrcweir // Various helper functions
211cdf0e10cSrcweir // ============================================================================
212cdf0e10cSrcweir
213cdf0e10cSrcweir /** Returns the angle between horizontal border of a rectangle and its diagonal.
214cdf0e10cSrcweir
215cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
216cdf0e10cSrcweir horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
217cdf0e10cSrcweir passed sizes may be negative, calculation is done with absolute values.
218cdf0e10cSrcweir */
219cdf0e10cSrcweir SVX_DLLPUBLIC double GetHorDiagAngle( long nWidth, long nHeight );
220cdf0e10cSrcweir
221cdf0e10cSrcweir /** Returns the angle between horizontal border of a rectangle and its diagonal.
222cdf0e10cSrcweir
223cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
224cdf0e10cSrcweir horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
225cdf0e10cSrcweir passed rectangle positions may be unordered, they are adjusted internally.
226cdf0e10cSrcweir */
GetHorDiagAngle(long nX1,long nX2,long nY1,long nY2)227cdf0e10cSrcweir inline double GetHorDiagAngle( long nX1, long nX2, long nY1, long nY2 )
228cdf0e10cSrcweir { return GetHorDiagAngle( nX2 - nX1, nY2 - nY1 ); }
229cdf0e10cSrcweir
230cdf0e10cSrcweir /** Returns the angle between horizontal border of a rectangle and its diagonal.
231cdf0e10cSrcweir
232cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
233cdf0e10cSrcweir horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
234cdf0e10cSrcweir passed rectangle edges may be unordered, they are adjusted internally.
235cdf0e10cSrcweir */
GetHorDiagAngle(const Point & rP1,const Point & rP2)236cdf0e10cSrcweir inline double GetHorDiagAngle( const Point& rP1, const Point& rP2 )
237cdf0e10cSrcweir { return GetHorDiagAngle( rP2.X() - rP1.X(), rP2.Y() - rP1.Y() ); }
238cdf0e10cSrcweir
239cdf0e10cSrcweir /** Returns the angle between horizontal border of a rectangle and its diagonal.
240cdf0e10cSrcweir
241cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
242cdf0e10cSrcweir horizontal borders, and is therefore in the range [0,PI/2] (inclusive).
243cdf0e10cSrcweir */
GetHorDiagAngle(const Rectangle & rRect)244cdf0e10cSrcweir inline double GetHorDiagAngle( const Rectangle& rRect )
245cdf0e10cSrcweir { return GetHorDiagAngle( rRect.GetWidth(), rRect.GetHeight() ); }
246cdf0e10cSrcweir
247cdf0e10cSrcweir // ----------------------------------------------------------------------------
248cdf0e10cSrcweir
249cdf0e10cSrcweir /** Returns the angle between vertical border of a rectangle and its diagonal.
250cdf0e10cSrcweir
251cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
252cdf0e10cSrcweir vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
253cdf0e10cSrcweir passed sizes may be negative, calculation is done with absolute values.
254cdf0e10cSrcweir */
GetVerDiagAngle(long nWidth,long nHeight)255cdf0e10cSrcweir inline double GetVerDiagAngle( long nWidth, long nHeight )
256cdf0e10cSrcweir { return GetHorDiagAngle( nHeight, nWidth ); }
257cdf0e10cSrcweir
258cdf0e10cSrcweir /** Returns the angle between vertical border of a rectangle and its diagonal.
259cdf0e10cSrcweir
260cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
261cdf0e10cSrcweir vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
262cdf0e10cSrcweir passed rectangle positions may be unordered, they are adjusted internally.
263cdf0e10cSrcweir */
GetVerDiagAngle(long nX1,long nX2,long nY1,long nY2)264cdf0e10cSrcweir inline double GetVerDiagAngle( long nX1, long nX2, long nY1, long nY2 )
265cdf0e10cSrcweir { return GetVerDiagAngle( nX2 - nX1, nY2 - nY1 ); }
266cdf0e10cSrcweir
267cdf0e10cSrcweir /** Returns the angle between vertical border of a rectangle and its diagonal.
268cdf0e10cSrcweir
269cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
270cdf0e10cSrcweir vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
271cdf0e10cSrcweir passed rectangle edges may be unordered, they are adjusted internally.
272cdf0e10cSrcweir */
GetVerDiagAngle(const Point & rP1,const Point & rP2)273cdf0e10cSrcweir inline double GetVerDiagAngle( const Point& rP1, const Point& rP2 )
274cdf0e10cSrcweir { return GetVerDiagAngle( rP2.X() - rP1.X(), rP2.Y() - rP1.Y() ); }
275cdf0e10cSrcweir
276cdf0e10cSrcweir /** Returns the angle between vertical border of a rectangle and its diagonal.
277cdf0e10cSrcweir
278cdf0e10cSrcweir The returned values represents the inner angle between the diagonals and
279cdf0e10cSrcweir vertical borders, and is therefore in the range [0,PI/2] (inclusive).
280cdf0e10cSrcweir */
GetVerDiagAngle(const Rectangle & rRect)281cdf0e10cSrcweir inline double GetVerDiagAngle( const Rectangle& rRect )
282cdf0e10cSrcweir { return GetVerDiagAngle( rRect.GetWidth(), rRect.GetHeight() ); }
283cdf0e10cSrcweir
284cdf0e10cSrcweir // ============================================================================
285cdf0e10cSrcweir
286cdf0e10cSrcweir /** Returns an X coordinate for a diagonal frame border in the specified height.
287cdf0e10cSrcweir
288cdf0e10cSrcweir This function is for usage with the top-left end of a top-left to
289cdf0e10cSrcweir bottom-right diagonal frame border, connected to the left end of a
290cdf0e10cSrcweir horizontal frame border.
291cdf0e10cSrcweir
292cdf0e10cSrcweir The function returns the relative X position (i.e. for a polygon) of the
293cdf0e10cSrcweir diagonal frame border according to the specified relative Y position. The
294cdf0e10cSrcweir mentioned positions are relative to the reference point of both frame
295cdf0e10cSrcweir borders.
296cdf0e10cSrcweir
297cdf0e10cSrcweir +----------------------------------------------------------
298cdf0e10cSrcweir | The horizontal frame border.
299cdf0e10cSrcweir | |
300cdf0e10cSrcweir - - - - - - | --+-- <---- Reference point for horizontal and diagonal frame borders.
301cdf0e10cSrcweir ^ | \ | \
302cdf0e10cSrcweir nVerOffs | \ \ <--- The diagonal frame border.
303cdf0e10cSrcweir v +---\ \------------------------------------------------
304cdf0e10cSrcweir - - - - - - - - -\- - -X <----- The function calculates the X position of i.e.
305cdf0e10cSrcweir \ \ this point (relative from X of reference point).
306cdf0e10cSrcweir \ \
307cdf0e10cSrcweir Primary -->\ \<-- Secondary
308cdf0e10cSrcweir
309cdf0e10cSrcweir @param nVerOffs
310cdf0e10cSrcweir The vertical position of the point to be calculated, relative to the Y
311cdf0e10cSrcweir coordinate of the reference point.
312cdf0e10cSrcweir @param nDiagOffs
313cdf0e10cSrcweir The width offset across the diagonal frame border (0 = middle),
314cdf0e10cSrcweir regardless of the gradient of the diagonal frame border (always
315cdf0e10cSrcweir vertical to the direction of the diagonal frame border). This value is
316cdf0e10cSrcweir not related in any way to the reference point. For details about
317cdf0e10cSrcweir relative width offsets, see description of class Style.
318cdf0e10cSrcweir @param fAngle
319cdf0e10cSrcweir Inner (right) angle between diagonal and horizontal frame border.
320cdf0e10cSrcweir */
321cdf0e10cSrcweir SVX_DLLPUBLIC long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
322cdf0e10cSrcweir
323cdf0e10cSrcweir /** Returns an X coordinate for a diagonal frame border in the specified height.
324cdf0e10cSrcweir
325cdf0e10cSrcweir This function is for usage with the bottom-left end of a bottom-left to
326cdf0e10cSrcweir top-right diagonal frame border, connected to the left end of a horizontal
327cdf0e10cSrcweir frame border.
328cdf0e10cSrcweir
329cdf0e10cSrcweir The function returns the relative X position (i.e. for a polygon) of the
330cdf0e10cSrcweir diagonal frame border according to the specified relative Y position. The
331cdf0e10cSrcweir mentioned positions are relative to the reference point of both frame
332cdf0e10cSrcweir borders.
333cdf0e10cSrcweir
334cdf0e10cSrcweir Primary -->/ /<--- Secondary
335cdf0e10cSrcweir / /
336cdf0e10cSrcweir / / The function calculates the X position of i.e.
337cdf0e10cSrcweir - - - - - - - - -/- - -X <----- this point (relative from X of reference point).
338cdf0e10cSrcweir ^ +---/ /------------------------------------------------
339cdf0e10cSrcweir nVerOffs | / / <--- The diagonal frame border.
340cdf0e10cSrcweir v | / | /
341cdf0e10cSrcweir - - - - - - | --+-- <---- Reference point for horizontal and diagonal frame borders.
342cdf0e10cSrcweir | |
343cdf0e10cSrcweir | The horizontal frame border.
344cdf0e10cSrcweir +----------------------------------------------------------
345cdf0e10cSrcweir
346cdf0e10cSrcweir @param nVerOffs
347cdf0e10cSrcweir The vertical position of the point to be calculated, relative to the Y
348cdf0e10cSrcweir coordinate of the reference point.
349cdf0e10cSrcweir @param nDiagOffs
350cdf0e10cSrcweir The width offset across the diagonal frame border (0 = middle),
351cdf0e10cSrcweir regardless of the gradient of the diagonal frame border (always
352cdf0e10cSrcweir vertical to the direction of the diagonal frame border). This value is
353cdf0e10cSrcweir not related in any way to the reference point. For details about
354cdf0e10cSrcweir relative width offsets, see description of class Style.
355cdf0e10cSrcweir @param fAngle
356cdf0e10cSrcweir Inner (right) angle between diagonal and horizontal frame border.
357cdf0e10cSrcweir */
358cdf0e10cSrcweir long GetBLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
359cdf0e10cSrcweir
360cdf0e10cSrcweir /** Returns an X coordinate for a diagonal frame border in the specified height.
361cdf0e10cSrcweir
362cdf0e10cSrcweir This function is for usage with the bottom-right end of a top-left to
363cdf0e10cSrcweir bottom-right diagonal frame border, connected to the right end of a
364cdf0e10cSrcweir horizontal frame border.
365cdf0e10cSrcweir
366cdf0e10cSrcweir @param nVerOffs
367cdf0e10cSrcweir The vertical position of the point to be calculated, relative to the Y
368cdf0e10cSrcweir coordinate of the reference point.
369cdf0e10cSrcweir @param nDiagOffs
370cdf0e10cSrcweir The width offset across the diagonal frame border (0 = middle),
371cdf0e10cSrcweir regardless of the gradient of the diagonal frame border (always
372cdf0e10cSrcweir vertical to the direction of the diagonal frame border). This value is
373cdf0e10cSrcweir not related in any way to the reference point. For details about
374cdf0e10cSrcweir relative width offsets, see description of class Style.
375cdf0e10cSrcweir @param fAngle
376cdf0e10cSrcweir Inner (left) angle between diagonal and horizontal frame border.
377cdf0e10cSrcweir */
378cdf0e10cSrcweir long GetBRDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
379cdf0e10cSrcweir
380cdf0e10cSrcweir /** Returns an X coordinate for a diagonal frame border in the specified height.
381cdf0e10cSrcweir
382cdf0e10cSrcweir This function is for usage with the top-right end of a bottom-left to
383cdf0e10cSrcweir top-right diagonal frame border, connected to the right end of a horizontal
384cdf0e10cSrcweir frame border.
385cdf0e10cSrcweir
386cdf0e10cSrcweir @param nVerOffs
387cdf0e10cSrcweir The vertical position of the point to be calculated, relative to the Y
388cdf0e10cSrcweir coordinate of the reference point.
389cdf0e10cSrcweir @param nDiagOffs
390cdf0e10cSrcweir The width offset across the diagonal frame border (0 = middle),
391cdf0e10cSrcweir regardless of the gradient of the diagonal frame border (always
392cdf0e10cSrcweir vertical to the direction of the diagonal frame border). This value is
393cdf0e10cSrcweir not related in any way to the reference point. For details about
394cdf0e10cSrcweir relative width offsets, see description of class Style.
395cdf0e10cSrcweir @param fAngle
396cdf0e10cSrcweir Inner (left) angle between diagonal and horizontal frame border.
397cdf0e10cSrcweir */
398cdf0e10cSrcweir long GetTRDiagOffset( long nVerOffs, long nDiagOffs, double fAngle );
399cdf0e10cSrcweir
400cdf0e10cSrcweir // ============================================================================
401cdf0e10cSrcweir
402cdf0e10cSrcweir /** Checks whether two horizontal frame borders are "connectable".
403cdf0e10cSrcweir
404cdf0e10cSrcweir Two borders are "connectable" in terms of this function, if both can be
405cdf0e10cSrcweir drawn with only one call of a border drawing function. This means, the two
406cdf0e10cSrcweir frame borders must have equal style and color, and none of the other
407cdf0e10cSrcweir vertical and diagonal frame borders break the lines of the two borders in
408cdf0e10cSrcweir any way (i.e. two vertical double frame borders would break the horizonal
409cdf0e10cSrcweir frame borders). Of course this function can be used for vertical frame
410cdf0e10cSrcweir borders as well.
411cdf0e10cSrcweir
412cdf0e10cSrcweir The follong picture shows the meaning of all passed parameters:
413cdf0e10cSrcweir
414cdf0e10cSrcweir \ rTFromT /
415cdf0e10cSrcweir \ | /
416cdf0e10cSrcweir rTFromTL | rTFromTR
417cdf0e10cSrcweir \ | /
418cdf0e10cSrcweir \ | /
419cdf0e10cSrcweir ======== rLBorder ========= ========== rRBorder =======
420cdf0e10cSrcweir / | \
421cdf0e10cSrcweir / | \
422cdf0e10cSrcweir rBFromBL | rBFromBR
423cdf0e10cSrcweir / | \
424cdf0e10cSrcweir / rBFromB \
425cdf0e10cSrcweir
426cdf0e10cSrcweir @return
427cdf0e10cSrcweir True, if rLBorder and rRBorder can be drawn in one step without
428cdf0e10cSrcweir interruption at their connection point.
429cdf0e10cSrcweir */
430cdf0e10cSrcweir SVX_DLLPUBLIC bool CheckFrameBorderConnectable(
431cdf0e10cSrcweir const Style& rLBorder, /// Style of the left frame border to connect.
432cdf0e10cSrcweir const Style& rRBorder, /// Style of the right frame border to connect.
433cdf0e10cSrcweir
434cdf0e10cSrcweir const Style& rTFromTL, /// Diagonal frame border from top-left to connection point.
435cdf0e10cSrcweir const Style& rTFromT, /// Vertical frame border from top to connection point.
436cdf0e10cSrcweir const Style& rTFromTR, /// Horizontal frame border from top-right to connection point.
437cdf0e10cSrcweir
438cdf0e10cSrcweir const Style& rBFromBL, /// Diagonal frame border from bottom-left to connection point.
439cdf0e10cSrcweir const Style& rBFromB, /// Vertical frame border from bottom to connection point.
440cdf0e10cSrcweir const Style& rBFromBR /// Horizontal frame border from bottom-right to connection point.
441cdf0e10cSrcweir );
442cdf0e10cSrcweir
443cdf0e10cSrcweir // ============================================================================
444cdf0e10cSrcweir // Drawing functions
445cdf0e10cSrcweir // ============================================================================
446cdf0e10cSrcweir
447cdf0e10cSrcweir /** Draws a horizontal frame border, regards all connected frame styles.
448cdf0e10cSrcweir
449cdf0e10cSrcweir The frame style to draw is passed as parameter rBorder. The function
450cdf0e10cSrcweir calculates the adjustment in X direction for left and right end of primary
451cdf0e10cSrcweir and secondary line of the frame border (the style may present a double
452cdf0e10cSrcweir line). The line ends may differ according to the connected frame styles
453cdf0e10cSrcweir coming from top, bottom, left, right, and/or diagonal.
454cdf0e10cSrcweir
455cdf0e10cSrcweir Thick frame styles are always drawn centered (in width) to the passed
456cdf0e10cSrcweir reference points. The Y coordinates of both reference points must be equal
457cdf0e10cSrcweir (the line cannot be drawn slanted).
458cdf0e10cSrcweir
459cdf0e10cSrcweir The function preserves all settings of the passed output device.
460cdf0e10cSrcweir
461cdf0e10cSrcweir All parameters starting with "rL" refer to the left end of the processed
462cdf0e10cSrcweir frame border, all parameters starting with "rR" refer to the right end.
463cdf0e10cSrcweir The following part of the parameter name starting with "From" specifies
464cdf0e10cSrcweir where the frame border comes from. Example: "rLFromTR" means the frame
465cdf0e10cSrcweir border coming from top-right, connected to the left end of rBorder (and
466cdf0e10cSrcweir therefore a diagonal frame border).
467cdf0e10cSrcweir
468cdf0e10cSrcweir The follong picture shows the meaning of all passed parameters:
469cdf0e10cSrcweir
470cdf0e10cSrcweir rLFromT / \ rRFromT
471cdf0e10cSrcweir | / \ |
472cdf0e10cSrcweir | rLFromTR rRFromTL |
473cdf0e10cSrcweir | / \ |
474cdf0e10cSrcweir | / \ |
475cdf0e10cSrcweir --- rLFromL --- ============== rBorder ============== --- rRFromR ---
476cdf0e10cSrcweir | \ / |
477cdf0e10cSrcweir | \ / |
478cdf0e10cSrcweir | rLFromBR rRFromBL |
479cdf0e10cSrcweir | \ / |
480cdf0e10cSrcweir rLFromB \ / rRFromB
481cdf0e10cSrcweir */
482cdf0e10cSrcweir SVX_DLLPUBLIC void DrawHorFrameBorder(
483cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
484cdf0e10cSrcweir
485cdf0e10cSrcweir const Point& rLPos, /// Reference point for left end of the processed frame border.
486cdf0e10cSrcweir const Point& rRPos, /// Reference point for right end of the processed frame border.
487cdf0e10cSrcweir const Style& rBorder, /// Style of the processed frame border.
488cdf0e10cSrcweir
489cdf0e10cSrcweir const DiagStyle& rLFromTR, /// Diagonal frame border from top-right to left end of rBorder.
490cdf0e10cSrcweir const Style& rLFromT, /// Vertical frame border from top to left end of rBorder.
491cdf0e10cSrcweir const Style& rLFromL, /// Horizontal frame border from left to left end of rBorder.
492cdf0e10cSrcweir const Style& rLFromB, /// Vertical frame border from bottom to left end of rBorder.
493cdf0e10cSrcweir const DiagStyle& rLFromBR, /// Diagonal frame border from bottom-right to left end of rBorder.
494cdf0e10cSrcweir
495cdf0e10cSrcweir const DiagStyle& rRFromTL, /// Diagonal frame border from top-left to right end of rBorder.
496cdf0e10cSrcweir const Style& rRFromT, /// Vertical frame border from top to right end of rBorder.
497cdf0e10cSrcweir const Style& rRFromR, /// Horizontal frame border from right to right end of rBorder.
498cdf0e10cSrcweir const Style& rRFromB, /// Vertical frame border from bottom to right end of rBorder.
499cdf0e10cSrcweir const DiagStyle& rRFromBL, /// Diagonal frame border from bottom-left to right end of rBorder.
500cdf0e10cSrcweir
501cdf0e10cSrcweir const Color* pForceColor = 0 /// If specified, overrides frame border color.
502cdf0e10cSrcweir );
503cdf0e10cSrcweir
504cdf0e10cSrcweir // ----------------------------------------------------------------------------
505cdf0e10cSrcweir
506cdf0e10cSrcweir /** Draws a horizontal frame border, regards all connected frame styles.
507cdf0e10cSrcweir
508cdf0e10cSrcweir This is a simplified version of the DrawHorFrameBorder() function described
509cdf0e10cSrcweir above. It does not support diagonal connected frame borders. See description
510cdf0e10cSrcweir above for additional details about the parameters.
511cdf0e10cSrcweir
512cdf0e10cSrcweir The function preserves all settings of the passed output device.
513cdf0e10cSrcweir */
514cdf0e10cSrcweir void SVX_DLLPUBLIC DrawHorFrameBorder(
515cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
516cdf0e10cSrcweir
517cdf0e10cSrcweir const Point& rLPos, /// Reference point for left end of the processed frame border.
518cdf0e10cSrcweir const Point& rRPos, /// Reference point for right end of the processed frame border.
519cdf0e10cSrcweir const Style& rBorder, /// Style of the processed frame border.
520cdf0e10cSrcweir
521cdf0e10cSrcweir const Style& rLFromT, /// Vertical frame border from top to left end of rBorder.
522cdf0e10cSrcweir const Style& rLFromL, /// Horizontal frame border from left to left end of rBorder.
523cdf0e10cSrcweir const Style& rLFromB, /// Vertical frame border from bottom to left end of rBorder.
524cdf0e10cSrcweir
525cdf0e10cSrcweir const Style& rRFromT, /// Vertical frame border from top to right end of rBorder.
526cdf0e10cSrcweir const Style& rRFromR, /// Horizontal frame border from right to right end of rBorder.
527cdf0e10cSrcweir const Style& rRFromB, /// Vertical frame border from bottom to right end of rBorder.
528cdf0e10cSrcweir
529cdf0e10cSrcweir const Color* pForceColor = 0 /// If specified, overrides frame border color.
530cdf0e10cSrcweir );
531cdf0e10cSrcweir
532cdf0e10cSrcweir // ----------------------------------------------------------------------------
533cdf0e10cSrcweir
534cdf0e10cSrcweir /** Draws a horizontal frame border without connected frame styles.
535cdf0e10cSrcweir
536cdf0e10cSrcweir This is the most simplified version of the DrawHorFrameBorder() function
537cdf0e10cSrcweir described above. See description above for additional details about the
538cdf0e10cSrcweir parameters.
539cdf0e10cSrcweir
540cdf0e10cSrcweir The function preserves all settings of the passed output device.
541cdf0e10cSrcweir */
542cdf0e10cSrcweir void SVX_DLLPUBLIC DrawHorFrameBorder(
543cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
544cdf0e10cSrcweir const Point& rLPos, /// Reference point for left end of the processed frame border.
545cdf0e10cSrcweir const Point& rRPos, /// Reference point for right end of the processed frame border.
546cdf0e10cSrcweir const Style& rBorder, /// Style of the frame border to draw.
547cdf0e10cSrcweir const Color* pForceColor = 0 /// If specified, overrides frame border color.
548cdf0e10cSrcweir );
549cdf0e10cSrcweir
550cdf0e10cSrcweir // ============================================================================
551cdf0e10cSrcweir
552cdf0e10cSrcweir /** Draws a vertical frame border, regards all connected frame styles.
553cdf0e10cSrcweir
554cdf0e10cSrcweir The frame style to draw is passed as parameter rBorder. The function
555cdf0e10cSrcweir calculates the adjustment in Y direction for top and bottom end of primary
556cdf0e10cSrcweir and secondary line of the frame border (the style may present a double
557cdf0e10cSrcweir line). The line ends may differ according to the connected frame styles
558cdf0e10cSrcweir coming from left, right, top, bottom, and/or diagonal.
559cdf0e10cSrcweir
560cdf0e10cSrcweir Thick frame styles are always drawn centered (in width) to the passed
561cdf0e10cSrcweir reference points. The X coordinates of both reference points must be equal
562cdf0e10cSrcweir (the line cannot be drawn slanted).
563cdf0e10cSrcweir
564cdf0e10cSrcweir The function preserves all settings of the passed output device.
565cdf0e10cSrcweir
566cdf0e10cSrcweir All parameters starting with "rT" refer to the top end of the processed
567cdf0e10cSrcweir frame border, all parameters starting with "rB" refer to the bottom end.
568cdf0e10cSrcweir The following part of the parameter name starting with "From" specifies
569cdf0e10cSrcweir where the frame border comes from. Example: "rTFromBL" means the frame
570cdf0e10cSrcweir border coming from bottom-left, connected to the top end of rBorder (and
571cdf0e10cSrcweir therefore a diagonal frame border).
572cdf0e10cSrcweir
573cdf0e10cSrcweir The follong picture shows the meaning of all passed parameters:
574cdf0e10cSrcweir
575cdf0e10cSrcweir |
576cdf0e10cSrcweir rTFromT
577cdf0e10cSrcweir |
578cdf0e10cSrcweir |
579cdf0e10cSrcweir --- rTFromL --- --- rTFromR ---
580cdf0e10cSrcweir / # \
581cdf0e10cSrcweir / # \
582cdf0e10cSrcweir rTFromBL # rTFromBR
583cdf0e10cSrcweir / # \
584cdf0e10cSrcweir / # \
585cdf0e10cSrcweir #
586cdf0e10cSrcweir rBorder
587cdf0e10cSrcweir #
588cdf0e10cSrcweir \ # /
589cdf0e10cSrcweir \ # /
590cdf0e10cSrcweir rBFromTL # rBFromTR
591cdf0e10cSrcweir \ # /
592cdf0e10cSrcweir \ # /
593cdf0e10cSrcweir --- rBFromL --- --- rBFromR ---
594cdf0e10cSrcweir |
595cdf0e10cSrcweir |
596cdf0e10cSrcweir rBFromB
597cdf0e10cSrcweir |
598cdf0e10cSrcweir */
599cdf0e10cSrcweir SVX_DLLPUBLIC void DrawVerFrameBorder(
600cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
601cdf0e10cSrcweir
602cdf0e10cSrcweir const Point& rTPos, /// Reference point for top end of the processed frame border.
603cdf0e10cSrcweir const Point& rBPos, /// Reference point for bottom end of the processed frame border.
604cdf0e10cSrcweir const Style& rBorder, /// Style of the processed frame border.
605cdf0e10cSrcweir
606cdf0e10cSrcweir const DiagStyle& rTFromBL, /// Diagonal frame border from bottom-right to top end of rBorder.
607cdf0e10cSrcweir const Style& rTFromL, /// Horizontal frame border from left to top end of rBorder.
608cdf0e10cSrcweir const Style& rTFromT, /// Vertical frame border from top to top end of rBorder.
609cdf0e10cSrcweir const Style& rTFromR, /// Horizontal frame border from right to top end of rBorder.
610cdf0e10cSrcweir const DiagStyle& rTFromBR, /// Diagonal frame border from bottom-right to top end of rBorder.
611cdf0e10cSrcweir
612cdf0e10cSrcweir const DiagStyle& rBFromTL, /// Diagonal frame border from top-left to bottom end of rBorder.
613cdf0e10cSrcweir const Style& rBFromL, /// Horizontal frame border from left to bottom end of rBorder.
614cdf0e10cSrcweir const Style& rBFromB, /// Vertical frame border from bottom to bottom end of rBorder.
615cdf0e10cSrcweir const Style& rBFromR, /// Horizontal frame border from right to bottom end of rBorder.
616cdf0e10cSrcweir const DiagStyle& rBFromTR, /// Diagonal frame border from top-right to bottom end of rBorder.
617cdf0e10cSrcweir
618cdf0e10cSrcweir const Color* pForceColor = 0 /// If specified, overrides frame border color.
619cdf0e10cSrcweir );
620cdf0e10cSrcweir
621cdf0e10cSrcweir // ----------------------------------------------------------------------------
622cdf0e10cSrcweir
623cdf0e10cSrcweir /** Draws a vertical frame border, regards all connected frame styles.
624cdf0e10cSrcweir
625cdf0e10cSrcweir This is a simplified version of the DrawVerFrameBorder() function described
626cdf0e10cSrcweir above. It does not support diagonal connected frame borders. See description
627cdf0e10cSrcweir above for additional details about the parameters.
628cdf0e10cSrcweir
629cdf0e10cSrcweir The function preserves all settings of the passed output device.
630cdf0e10cSrcweir */
631cdf0e10cSrcweir void SVX_DLLPUBLIC DrawVerFrameBorder(
632cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
633cdf0e10cSrcweir
634cdf0e10cSrcweir const Point& rTPos, /// Reference point for top end of the processed frame border.
635cdf0e10cSrcweir const Point& rBPos, /// Reference point for bottom end of the processed frame border.
636cdf0e10cSrcweir const Style& rBorder, /// Style of the processed frame border.
637cdf0e10cSrcweir
638cdf0e10cSrcweir const Style& rTFromL, /// Horizontal frame border from left to top end of rBorder.
639cdf0e10cSrcweir const Style& rTFromT, /// Vertical frame border from top to top end of rBorder.
640cdf0e10cSrcweir const Style& rTFromR, /// Horizontal frame border from right to top end of rBorder.
641cdf0e10cSrcweir
642cdf0e10cSrcweir const Style& rBFromL, /// Horizontal frame border from left to bottom end of rBorder.
643cdf0e10cSrcweir const Style& rBFromB, /// Vertical frame border from bottom to bottom end of rBorder.
644cdf0e10cSrcweir const Style& rBFromR, /// Horizontal frame border from right to bottom end of rBorder.
645cdf0e10cSrcweir
646cdf0e10cSrcweir const Color* pForceColor = 0 /// If specified, overrides frame border color.
647cdf0e10cSrcweir );
648cdf0e10cSrcweir
649cdf0e10cSrcweir // ----------------------------------------------------------------------------
650cdf0e10cSrcweir
651cdf0e10cSrcweir /** Draws a vertical frame border without connected frame styles.
652cdf0e10cSrcweir
653cdf0e10cSrcweir This is the most simplified version of the DrawVerFrameBorder() function
654cdf0e10cSrcweir described above. See description above for additional details about the
655cdf0e10cSrcweir parameters.
656cdf0e10cSrcweir
657cdf0e10cSrcweir The function preserves all settings of the passed output device.
658cdf0e10cSrcweir */
659cdf0e10cSrcweir void SVX_DLLPUBLIC DrawVerFrameBorder(
660cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
661cdf0e10cSrcweir const Point& rTPos, /// Reference point for top end of the processed frame border.
662cdf0e10cSrcweir const Point& rBPos, /// Reference point for bottom end of the processed frame border.
663cdf0e10cSrcweir const Style& rBorder, /// Style of the frame border to draw.
664cdf0e10cSrcweir const Color* pForceColor = 0 /// If specified, overrides frame border color.
665cdf0e10cSrcweir );
666cdf0e10cSrcweir
667cdf0e10cSrcweir // ----------------------------------------------------------------------------
668cdf0e10cSrcweir
669cdf0e10cSrcweir /** Draws a vertical slanted frame border without connected frame styles.
670cdf0e10cSrcweir
671cdf0e10cSrcweir This is an extended version of the simple DrawVerFrameBorder() function
672cdf0e10cSrcweir described above. It accepts start and end reference points with different
673cdf0e10cSrcweir X coordinates. See description above for additional details about the
674cdf0e10cSrcweir parameters (except the restriction on the reference points).
675cdf0e10cSrcweir
676cdf0e10cSrcweir The function preserves all settings of the passed output device.
677cdf0e10cSrcweir */
678cdf0e10cSrcweir void SVX_DLLPUBLIC DrawVerFrameBorderSlanted(
679cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
680cdf0e10cSrcweir const Point& rTPos, /// Reference point for top end of the processed frame border.
681cdf0e10cSrcweir const Point& rBPos, /// Reference point for bottom end of the processed frame border.
682cdf0e10cSrcweir const Style& rBorder, /// Style of the frame border to draw.
683cdf0e10cSrcweir const Color* pForceColor = 0 /// If specified, overrides frame border color.
684cdf0e10cSrcweir );
685cdf0e10cSrcweir
686cdf0e10cSrcweir // ============================================================================
687cdf0e10cSrcweir
688cdf0e10cSrcweir /** Draws both diagonal frame borders, regards all connected frame styles.
689cdf0e10cSrcweir
690cdf0e10cSrcweir One or both passed diagonal frame styles may be invisible.
691cdf0e10cSrcweir
692cdf0e10cSrcweir The function preserves all settings of the passed output device.
693cdf0e10cSrcweir */
694cdf0e10cSrcweir SVX_DLLPUBLIC void DrawDiagFrameBorders(
695cdf0e10cSrcweir OutputDevice& rDev, /// The output device used to draw the frame border.
696cdf0e10cSrcweir
697cdf0e10cSrcweir const Rectangle& rRect, /// Rectangle for both diagonal frame borders.
698cdf0e10cSrcweir const Style& rTLBR, /// Style of the processed top-left to bottom-right diagonal frame border.
699cdf0e10cSrcweir const Style& rBLTR, /// Style of the processed bottom-left to top-right diagonal frame border.
700cdf0e10cSrcweir
701cdf0e10cSrcweir const Style& rTLFromB, /// Vertical frame border from bottom to top-left end of rTLBR.
702cdf0e10cSrcweir const Style& rTLFromR, /// Horizontal frame border from right to top-left end of rTLBR.
703cdf0e10cSrcweir const Style& rBRFromT, /// Vertical frame border from top to bottom-right end of rTLBR.
704cdf0e10cSrcweir const Style& rBRFromL, /// Horizontal frame border from left to bottom-right end of rTLBR.
705cdf0e10cSrcweir
706cdf0e10cSrcweir const Style& rBLFromT, /// Vertical frame border from top to bottom-left end of rBLTR.
707cdf0e10cSrcweir const Style& rBLFromR, /// Horizontal frame border from right to bottom-left end of rBLTR.
708cdf0e10cSrcweir const Style& rTRFromB, /// Vertical frame border from bottom to top-right end of rBLTR.
709cdf0e10cSrcweir const Style& rTRFromL, /// Horizontal frame border from left to top-right end of rBLTR.
710cdf0e10cSrcweir
711cdf0e10cSrcweir const Color* pForceColor = 0, /// If specified, overrides frame border color.
712cdf0e10cSrcweir bool bDiagDblClip = false /// true = Use clipping for crossing double frame borders.
713cdf0e10cSrcweir );
714cdf0e10cSrcweir
715cdf0e10cSrcweir // ============================================================================
716cdf0e10cSrcweir
717cdf0e10cSrcweir } // namespace frame
718cdf0e10cSrcweir } // namespace svx
719cdf0e10cSrcweir
720cdf0e10cSrcweir /* Yes, I love ASCII art. :-) -DR- */
721cdf0e10cSrcweir
722cdf0e10cSrcweir #endif
723cdf0e10cSrcweir
724