1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SVX_FRAMELINK_HXX
21 #define SVX_FRAMELINK_HXX
24 #include <sal/types.h>
25 #include <tools/color.hxx>
26 #include "svx/svxdllapi.h"
27 #include <vcl/outdev.hxx>
28 #include <editeng/borderline.hxx>
30 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
39 // ============================================================================
41 // ============================================================================
43 /** Specifies how the reference points for frame borders are used.
47 /** Frame borders are drawn centered to the reference points. */
50 /** The reference points specify the begin of the frame border width.
52 The result is that horizontal lines are drawn below, and vertical lines
53 are drawn right of the reference points.
57 /** The reference points specify the end of the frame border width.
59 The result is that horizontal lines are drawn above, and vertical lines
60 are drawn left of the reference points.
65 // ============================================================================
67 // ============================================================================
69 /** Contains the widths of primary and secondary line of a frame style.
71 In the following, "frame style" is a complete style of one frame border,
72 i.e. the double line at the left side of the frame. A "line" is always a
73 trivial single line, i.e. the first line of a double frame style.
75 The following states of the members of this struct are valid:
77 mnPrim mnDist mnSecn frame style
78 -------------------------------------------------
83 The behaviour of the member functions for other states is not defined.
85 Per definition the primary line in double frame styles is:
86 - The top line for horizontal frame borders.
87 - The left line for vertical frame borders.
88 - The bottom-left line for top-left to bottom-right diagonal frame borders.
89 - The top-left line for bottom-left to top-right diagonal frame borders.
91 The following picture shows the upper end of a vertical double frame
94 |<---------------- GetWidth() ----------------->|
96 |<----- mnPrim ----->||<- mnDist ->||<- mnSecn >|
98 ###################### #############
99 ###################### #############
100 ###################### #############
101 ###################### #############
102 ###################### | #############
103 ###################### | #############
105 |<- middle of the frame border
107 class SVX_DLLPUBLIC Style
110 /** Constructs an invisible frame style. */
111 inline explicit Style()
112 : meRefMode( REFMODE_CENTERED
)
113 , mnType( ::com::sun::star::table::BorderLineStyle::SOLID
)
115 /** Constructs a frame style with passed line widths. */
116 inline explicit Style( double nP
, double nD
, double nS
, editeng::SvxBorderStyle nType
) :
117 meRefMode( REFMODE_CENTERED
), mnType( nType
)
118 { Clear(); Set( nP
, nD
, nS
); }
119 /** Constructs a frame style with passed color and line widths. */
120 inline explicit Style( const Color
& rColorPrim
, const Color
& rColorSecn
, const Color
& rColorGap
, bool bUseGapColor
,
121 double nP
, double nD
, double nS
, editeng::SvxBorderStyle nType
) :
122 meRefMode( REFMODE_CENTERED
), mnType( nType
)
123 { Set( rColorPrim
, rColorSecn
, rColorGap
, bUseGapColor
, nP
, nD
, nS
); }
124 /** Constructs a frame style from the passed SvxBorderLine struct. */
125 inline explicit Style( const editeng::SvxBorderLine
& rBorder
, double fScale
= 1.0, sal_uInt16 nMaxWidth
= SAL_MAX_UINT16
) :
126 meRefMode( REFMODE_CENTERED
) { Set( rBorder
, fScale
, nMaxWidth
); }
127 /** Constructs a frame style from the passed SvxBorderLine struct. Clears the style, if pBorder is 0. */
128 inline explicit Style( const editeng::SvxBorderLine
* pBorder
, double fScale
= 1.0, sal_uInt16 nMaxWidth
= SAL_MAX_UINT16
) :
129 meRefMode( REFMODE_CENTERED
) { Set( pBorder
, fScale
, nMaxWidth
); }
131 inline RefMode
GetRefMode() const { return meRefMode
; }
132 inline const Color
& GetColorPrim() const { return maColorPrim
; }
133 inline const Color
& GetColorSecn() const { return maColorSecn
; }
134 inline const Color
& GetColorGap() const { return maColorGap
; }
135 inline bool UseGapColor() const { return mbUseGapColor
; }
136 inline double Prim() const { return mnPrim
; }
137 inline double Dist() const { return mnDist
; }
138 inline double Secn() const { return mnSecn
; }
139 inline editeng::SvxBorderStyle
Type() const { return mnType
; }
141 /** Returns the total width of this frame style. */
142 inline double GetWidth() const { return mnPrim
+ mnDist
+ mnSecn
; }
144 /** Sets the frame style to invisible state. */
146 /** Sets the frame style to the passed line widths. */
147 void Set( double nP
, double nD
, double nS
);
148 /** Sets the frame style to the passed line widths. */
149 void Set( const Color
& rColorPrim
, const Color
& rColorSecn
, const Color
& rColorGap
, bool bUseGapColor
,
150 double nP
, double nD
, double nS
);
151 /** Sets the frame style to the passed SvxBorderLine struct. */
152 void Set( const editeng::SvxBorderLine
& rBorder
, double fScale
= 1.0, sal_uInt16 nMaxWidth
= SAL_MAX_UINT16
);
153 /** Sets the frame style to the passed SvxBorderLine struct. Clears the style, if pBorder is 0. */
154 void Set( const editeng::SvxBorderLine
* pBorder
, double fScale
= 1.0, sal_uInt16 nMaxWidth
= SAL_MAX_UINT16
);
156 /** Sets a new reference point handling mode, does not modify other settings. */
157 inline void SetRefMode( RefMode eRefMode
) { meRefMode
= eRefMode
; }
158 /** Sets a new color, does not modify other settings. */
159 inline void SetColorPrim( const Color
& rColor
) { maColorPrim
= rColor
; }
160 inline void SetColorSecn( const Color
& rColor
) { maColorSecn
= rColor
; }
161 inline void SetColorGap( bool bUseIt
, const Color
& rColor
) { maColorGap
= rColor
; mbUseGapColor
= bUseIt
; }
162 /** Sets whether to use dotted style for single hair lines. */
163 inline void SetType( editeng::SvxBorderStyle nType
) { mnType
= nType
; }
165 /** Mirrors this style (exchanges primary and secondary), if it is a double frame style. */
167 /** Returns this style mirrored, if it is a double frame style, otherwise a simple copy. */
168 Style
Mirror() const;
175 RefMode meRefMode
; /// Reference point handling for this frame border.
176 double mnPrim
; /// Width of primary (single, left, or top) line.
177 double mnDist
; /// Distance between primary and secondary line.
178 double mnSecn
; /// Width of secondary (right or bottom) line.
179 editeng::SvxBorderStyle mnType
;
182 bool operator==( const Style
& rL
, const Style
& rR
);
183 SVX_DLLPUBLIC
bool operator<( const Style
& rL
, const Style
& rR
);
185 inline bool operator!=( const Style
& rL
, const Style
& rR
) { return !(rL
== rR
); }
186 inline bool operator>( const Style
& rL
, const Style
& rR
) { return rR
< rL
; }
187 inline bool operator<=( const Style
& rL
, const Style
& rR
) { return !(rR
< rL
); }
188 inline bool operator>=( const Style
& rL
, const Style
& rR
) { return !(rL
< rR
); }
190 // ----------------------------------------------------------------------------
192 /** Extends the Style struct with an angle for diagonal frame borders.
194 The angle is specified in radian (a full circle is equivalent to 2*PI).
195 It is dependent on the context, how the value is interpreted, i.e. it may
196 specify the angle to a horizontal or vertical frame border.
198 class DiagStyle
: public Style
201 /** Constructs an invisible diagonal frame style. */
202 inline explicit DiagStyle() : mfAngle( 0.0 ) {}
203 /** Constructs a diagonal frame style passed style and angle. */
204 inline explicit DiagStyle( const Style
& rStyle
, double fAngle
) :
205 Style( rStyle
), mfAngle( fAngle
) {}
207 inline double GetAngle() const { return mfAngle
; }
209 /** Returns this style mirrored, if it is a double frame style, otherwise a simple copy. */
210 inline DiagStyle
Mirror() const { return DiagStyle( Style::Mirror(), mfAngle
); }
213 double mfAngle
; /// Angle between this and hor. or vert. border.
216 // ============================================================================
217 // Various helper functions
218 // ============================================================================
220 /** Returns the angle between horizontal border of a rectangle and its diagonal.
222 The returned values represents the inner angle between the diagonals and
223 horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
224 passed sizes may be negative, calculation is done with absolute values.
226 SVX_DLLPUBLIC
double GetHorDiagAngle( long nWidth
, long nHeight
);
228 /** Returns the angle between horizontal border of a rectangle and its diagonal.
230 The returned values represents the inner angle between the diagonals and
231 horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
232 passed rectangle positions may be unordered, they are adjusted internally.
234 inline double GetHorDiagAngle( long nX1
, long nX2
, long nY1
, long nY2
)
235 { return GetHorDiagAngle( nX2
- nX1
, nY2
- nY1
); }
237 /** Returns the angle between horizontal border of a rectangle and its diagonal.
239 The returned values represents the inner angle between the diagonals and
240 horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The
241 passed rectangle edges may be unordered, they are adjusted internally.
243 inline double GetHorDiagAngle( const Point
& rP1
, const Point
& rP2
)
244 { return GetHorDiagAngle( rP2
.X() - rP1
.X(), rP2
.Y() - rP1
.Y() ); }
246 /** Returns the angle between horizontal border of a rectangle and its diagonal.
248 The returned values represents the inner angle between the diagonals and
249 horizontal borders, and is therefore in the range [0,PI/2] (inclusive).
251 inline double GetHorDiagAngle( const Rectangle
& rRect
)
252 { return GetHorDiagAngle( rRect
.GetWidth(), rRect
.GetHeight() ); }
254 // ----------------------------------------------------------------------------
256 /** Returns the angle between vertical border of a rectangle and its diagonal.
258 The returned values represents the inner angle between the diagonals and
259 vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
260 passed sizes may be negative, calculation is done with absolute values.
262 inline double GetVerDiagAngle( long nWidth
, long nHeight
)
263 { return GetHorDiagAngle( nHeight
, nWidth
); }
265 /** Returns the angle between vertical border of a rectangle and its diagonal.
267 The returned values represents the inner angle between the diagonals and
268 vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
269 passed rectangle positions may be unordered, they are adjusted internally.
271 inline double GetVerDiagAngle( long nX1
, long nX2
, long nY1
, long nY2
)
272 { return GetVerDiagAngle( nX2
- nX1
, nY2
- nY1
); }
274 /** Returns the angle between vertical border of a rectangle and its diagonal.
276 The returned values represents the inner angle between the diagonals and
277 vertical borders, and is therefore in the range [0,PI/2] (inclusive). The
278 passed rectangle edges may be unordered, they are adjusted internally.
280 inline double GetVerDiagAngle( const Point
& rP1
, const Point
& rP2
)
281 { return GetVerDiagAngle( rP2
.X() - rP1
.X(), rP2
.Y() - rP1
.Y() ); }
283 /** Returns the angle between vertical border of a rectangle and its diagonal.
285 The returned values represents the inner angle between the diagonals and
286 vertical borders, and is therefore in the range [0,PI/2] (inclusive).
288 inline double GetVerDiagAngle( const Rectangle
& rRect
)
289 { return GetVerDiagAngle( rRect
.GetWidth(), rRect
.GetHeight() ); }
291 // ============================================================================
293 /** Returns an X coordinate for a diagonal frame border in the specified height.
295 This function is for usage with the top-left end of a top-left to
296 bottom-right diagonal frame border, connected to the left end of a
297 horizontal frame border.
299 The function returns the relative X position (i.e. for a polygon) of the
300 diagonal frame border according to the specified relative Y position. The
301 mentioned positions are relative to the reference point of both frame
304 +----------------------------------------------------------
305 | The horizontal frame border.
307 - - - - - - | --+-- <---- Reference point for horizontal and diagonal frame borders.
309 nVerOffs | \ \ <--- The diagonal frame border.
310 v +---\ \------------------------------------------------
311 - - - - - - - - -\- - -X <----- The function calculates the X position of i.e.
312 \ \ this point (relative from X of reference point).
314 Primary -->\ \<-- Secondary
317 The vertical position of the point to be calculated, relative to the Y
318 coordinate of the reference point.
320 The width offset across the diagonal frame border (0 = middle),
321 regardless of the gradient of the diagonal frame border (always
322 vertical to the direction of the diagonal frame border). This value is
323 not related in any way to the reference point. For details about
324 relative width offsets, see description of class Style.
326 Inner (right) angle between diagonal and horizontal frame border.
328 SVX_DLLPUBLIC
long GetTLDiagOffset( long nVerOffs
, long nDiagOffs
, double fAngle
);
330 /** Returns an X coordinate for a diagonal frame border in the specified height.
332 This function is for usage with the bottom-left end of a bottom-left to
333 top-right diagonal frame border, connected to the left end of a horizontal
336 The function returns the relative X position (i.e. for a polygon) of the
337 diagonal frame border according to the specified relative Y position. The
338 mentioned positions are relative to the reference point of both frame
341 Primary -->/ /<--- Secondary
343 / / The function calculates the X position of i.e.
344 - - - - - - - - -/- - -X <----- this point (relative from X of reference point).
345 ^ +---/ /------------------------------------------------
346 nVerOffs | / / <--- The diagonal frame border.
348 - - - - - - | --+-- <---- Reference point for horizontal and diagonal frame borders.
350 | The horizontal frame border.
351 +----------------------------------------------------------
354 The vertical position of the point to be calculated, relative to the Y
355 coordinate of the reference point.
357 The width offset across the diagonal frame border (0 = middle),
358 regardless of the gradient of the diagonal frame border (always
359 vertical to the direction of the diagonal frame border). This value is
360 not related in any way to the reference point. For details about
361 relative width offsets, see description of class Style.
363 Inner (right) angle between diagonal and horizontal frame border.
365 long GetBLDiagOffset( long nVerOffs
, long nDiagOffs
, double fAngle
);
367 /** Returns an X coordinate for a diagonal frame border in the specified height.
369 This function is for usage with the bottom-right end of a top-left to
370 bottom-right diagonal frame border, connected to the right end of a
371 horizontal frame border.
374 The vertical position of the point to be calculated, relative to the Y
375 coordinate of the reference point.
377 The width offset across the diagonal frame border (0 = middle),
378 regardless of the gradient of the diagonal frame border (always
379 vertical to the direction of the diagonal frame border). This value is
380 not related in any way to the reference point. For details about
381 relative width offsets, see description of class Style.
383 Inner (left) angle between diagonal and horizontal frame border.
385 long GetBRDiagOffset( long nVerOffs
, long nDiagOffs
, double fAngle
);
387 /** Returns an X coordinate for a diagonal frame border in the specified height.
389 This function is for usage with the top-right end of a bottom-left to
390 top-right diagonal frame border, connected to the right end of a horizontal
394 The vertical position of the point to be calculated, relative to the Y
395 coordinate of the reference point.
397 The width offset across the diagonal frame border (0 = middle),
398 regardless of the gradient of the diagonal frame border (always
399 vertical to the direction of the diagonal frame border). This value is
400 not related in any way to the reference point. For details about
401 relative width offsets, see description of class Style.
403 Inner (left) angle between diagonal and horizontal frame border.
405 long GetTRDiagOffset( long nVerOffs
, long nDiagOffs
, double fAngle
);
407 // ============================================================================
409 /** Checks whether two horizontal frame borders are "connectable".
411 Two borders are "connectable" in terms of this function, if both can be
412 drawn with only one call of a border drawing function. This means, the two
413 frame borders must have equal style and color, and none of the other
414 vertical and diagonal frame borders break the lines of the two borders in
415 any way (i.e. two vertical double frame borders would break the horizonal
416 frame borders). Of course this function can be used for vertical frame
419 The follong picture shows the meaning of all passed parameters:
426 ======== rLBorder ========= ========== rRBorder =======
434 True, if rLBorder and rRBorder can be drawn in one step without
435 interruption at their connection point.
437 SVX_DLLPUBLIC
bool CheckFrameBorderConnectable(
438 const Style
& rLBorder
, /// Style of the left frame border to connect.
439 const Style
& rRBorder
, /// Style of the right frame border to connect.
441 const Style
& rTFromTL
, /// Diagonal frame border from top-left to connection point.
442 const Style
& rTFromT
, /// Vertical frame border from top to connection point.
443 const Style
& rTFromTR
, /// Horizontal frame border from top-right to connection point.
445 const Style
& rBFromBL
, /// Diagonal frame border from bottom-left to connection point.
446 const Style
& rBFromB
, /// Vertical frame border from bottom to connection point.
447 const Style
& rBFromBR
/// Horizontal frame border from bottom-right to connection point.
450 // ============================================================================
452 // ============================================================================
454 /** Draws a horizontal frame border, regards all connected frame styles.
456 The frame style to draw is passed as parameter rBorder. The function
457 calculates the adjustment in X direction for left and right end of primary
458 and secondary line of the frame border (the style may present a double
459 line). The line ends may differ according to the connected frame styles
460 coming from top, bottom, left, right, and/or diagonal.
462 Thick frame styles are always drawn centered (in width) to the passed
463 reference points. The Y coordinates of both reference points must be equal
464 (the line cannot be drawn slanted).
466 The function preserves all settings of the passed output device.
468 All parameters starting with "rL" refer to the left end of the processed
469 frame border, all parameters starting with "rR" refer to the right end.
470 The following part of the parameter name starting with "From" specifies
471 where the frame border comes from. Example: "rLFromTR" means the frame
472 border coming from top-right, connected to the left end of rBorder (and
473 therefore a diagonal frame border).
475 The follong picture shows the meaning of all passed parameters:
479 | rLFromTR rRFromTL |
482 --- rLFromL --- ============== rBorder ============== --- rRFromR ---
485 | rLFromBR rRFromBL |
489 SVX_DLLPUBLIC
drawinglayer::primitive2d::Primitive2DSequence
CreateBorderPrimitives(
490 const Point
& rLPos
, /// Reference point for left end of the processed frame border.
491 const Point
& rRPos
, /// Reference point for right end of the processed frame border.
492 const Style
& rBorder
, /// Style of the processed frame border.
494 const DiagStyle
& rLFromTR
, /// Diagonal frame border from top-right to left end of rBorder.
495 const Style
& rLFromT
, /// Vertical frame border from top to left end of rBorder.
496 const Style
& rLFromL
, /// Horizontal frame border from left to left end of rBorder.
497 const Style
& rLFromB
, /// Vertical frame border from bottom to left end of rBorder.
498 const DiagStyle
& rLFromBR
, /// Diagonal frame border from bottom-right to left end of rBorder.
500 const DiagStyle
& rRFromTL
, /// Diagonal frame border from top-left to right end of rBorder.
501 const Style
& rRFromT
, /// Vertical frame border from top to right end of rBorder.
502 const Style
& rRFromR
, /// Horizontal frame border from right to right end of rBorder.
503 const Style
& rRFromB
, /// Vertical frame border from bottom to right end of rBorder.
504 const DiagStyle
& rRFromBL
, /// Diagonal frame border from bottom-left to right end of rBorder.
506 const Color
* pForceColor
= 0,/// If specified, overrides frame border color.
507 const long& rRotationT
= 9000, /// Angle of the top slanted frames in 100th of degree
508 const long& rRotationB
= 9000 /// Angle of the bottom slanted frames in 100th of degree
511 SVX_DLLPUBLIC
drawinglayer::primitive2d::Primitive2DSequence
CreateBorderPrimitives(
512 const Point
& rLPos
, /// Reference point for left end of the processed frame border.
513 const Point
& rRPos
, /// Reference point for right end of the processed frame border.
514 const Style
& rBorder
, /// Style of the processed frame border.
516 const Style
& rLFromT
, /// Vertical frame border from top to left end of rBorder.
517 const Style
& rLFromL
, /// Horizontal frame border from left to left end of rBorder.
518 const Style
& rLFromB
, /// Vertical frame border from bottom to left end of rBorder.
520 const Style
& rRFromT
, /// Vertical frame border from top to right end of rBorder.
521 const Style
& rRFromR
, /// Horizontal frame border from right to right end of rBorder.
522 const Style
& rRFromB
, /// Vertical frame border from bottom to right end of rBorder.
524 const Color
* pForceColor
= 0,/// If specified, overrides frame border color.
525 const long& rRotationT
= 9000, /// Angle of the top slanted frame in 100th of degrees
526 const long& rRotationB
= 9000 /// Angle of the bottom slanted frame in 100th of degrees
529 SVX_DLLPUBLIC
drawinglayer::primitive2d::Primitive2DSequence
CreateClippedBorderPrimitives (
530 const Point
& rStart
, const Point
& rEnd
, const Style
& rBorder
,
531 const Rectangle
& rClipRect
);
533 /** Draws a horizontal frame border, regards all connected frame styles.
535 The frame style to draw is passed as parameter rBorder. The function
536 calculates the adjustment in X direction for left and right end of primary
537 and secondary line of the frame border (the style may present a double
538 line). The line ends may differ according to the connected frame styles
539 coming from top, bottom, left, right, and/or diagonal.
541 Thick frame styles are always drawn centered (in width) to the passed
542 reference points. The Y coordinates of both reference points must be equal
543 (the line cannot be drawn slanted).
545 The function preserves all settings of the passed output device.
547 All parameters starting with "rL" refer to the left end of the processed
548 frame border, all parameters starting with "rR" refer to the right end.
549 The following part of the parameter name starting with "From" specifies
550 where the frame border comes from. Example: "rLFromTR" means the frame
551 border coming from top-right, connected to the left end of rBorder (and
552 therefore a diagonal frame border).
554 The follong picture shows the meaning of all passed parameters:
558 | rLFromTR rRFromTL |
561 --- rLFromL --- ============== rBorder ============== --- rRFromR ---
564 | rLFromBR rRFromBL |
568 SVX_DLLPUBLIC
void DrawHorFrameBorder(
569 OutputDevice
& rDev
, /// The output device used to draw the frame border.
571 const Point
& rLPos
, /// Reference point for left end of the processed frame border.
572 const Point
& rRPos
, /// Reference point for right end of the processed frame border.
573 const Style
& rBorder
, /// Style of the processed frame border.
575 const DiagStyle
& rLFromTR
, /// Diagonal frame border from top-right to left end of rBorder.
576 const Style
& rLFromT
, /// Vertical frame border from top to left end of rBorder.
577 const Style
& rLFromL
, /// Horizontal frame border from left to left end of rBorder.
578 const Style
& rLFromB
, /// Vertical frame border from bottom to left end of rBorder.
579 const DiagStyle
& rLFromBR
, /// Diagonal frame border from bottom-right to left end of rBorder.
581 const DiagStyle
& rRFromTL
, /// Diagonal frame border from top-left to right end of rBorder.
582 const Style
& rRFromT
, /// Vertical frame border from top to right end of rBorder.
583 const Style
& rRFromR
, /// Horizontal frame border from right to right end of rBorder.
584 const Style
& rRFromB
, /// Vertical frame border from bottom to right end of rBorder.
585 const DiagStyle
& rRFromBL
, /// Diagonal frame border from bottom-left to right end of rBorder.
587 const Color
* pForceColor
= 0 /// If specified, overrides frame border color.
590 // ============================================================================
592 /** Draws a vertical frame border, regards all connected frame styles.
594 The frame style to draw is passed as parameter rBorder. The function
595 calculates the adjustment in Y direction for top and bottom end of primary
596 and secondary line of the frame border (the style may present a double
597 line). The line ends may differ according to the connected frame styles
598 coming from left, right, top, bottom, and/or diagonal.
600 Thick frame styles are always drawn centered (in width) to the passed
601 reference points. The X coordinates of both reference points must be equal
602 (the line cannot be drawn slanted).
604 The function preserves all settings of the passed output device.
606 All parameters starting with "rT" refer to the top end of the processed
607 frame border, all parameters starting with "rB" refer to the bottom end.
608 The following part of the parameter name starting with "From" specifies
609 where the frame border comes from. Example: "rTFromBL" means the frame
610 border coming from bottom-left, connected to the top end of rBorder (and
611 therefore a diagonal frame border).
613 The follong picture shows the meaning of all passed parameters:
619 --- rTFromL --- --- rTFromR ---
633 --- rBFromL --- --- rBFromR ---
639 SVX_DLLPUBLIC
void DrawVerFrameBorder(
640 OutputDevice
& rDev
, /// The output device used to draw the frame border.
642 const Point
& rTPos
, /// Reference point for top end of the processed frame border.
643 const Point
& rBPos
, /// Reference point for bottom end of the processed frame border.
644 const Style
& rBorder
, /// Style of the processed frame border.
646 const DiagStyle
& rTFromBL
, /// Diagonal frame border from bottom-right to top end of rBorder.
647 const Style
& rTFromL
, /// Horizontal frame border from left to top end of rBorder.
648 const Style
& rTFromT
, /// Vertical frame border from top to top end of rBorder.
649 const Style
& rTFromR
, /// Horizontal frame border from right to top end of rBorder.
650 const DiagStyle
& rTFromBR
, /// Diagonal frame border from bottom-right to top end of rBorder.
652 const DiagStyle
& rBFromTL
, /// Diagonal frame border from top-left to bottom end of rBorder.
653 const Style
& rBFromL
, /// Horizontal frame border from left to bottom end of rBorder.
654 const Style
& rBFromB
, /// Vertical frame border from bottom to bottom end of rBorder.
655 const Style
& rBFromR
, /// Horizontal frame border from right to bottom end of rBorder.
656 const DiagStyle
& rBFromTR
, /// Diagonal frame border from top-right to bottom end of rBorder.
658 const Color
* pForceColor
= 0 /// If specified, overrides frame border color.
661 // ============================================================================
663 /** Draws both diagonal frame borders, regards all connected frame styles.
665 One or both passed diagonal frame styles may be invisible.
667 The function preserves all settings of the passed output device.
669 SVX_DLLPUBLIC
void DrawDiagFrameBorders(
670 OutputDevice
& rDev
, /// The output device used to draw the frame border.
672 const Rectangle
& rRect
, /// Rectangle for both diagonal frame borders.
673 const Style
& rTLBR
, /// Style of the processed top-left to bottom-right diagonal frame border.
674 const Style
& rBLTR
, /// Style of the processed bottom-left to top-right diagonal frame border.
676 const Style
& rTLFromB
, /// Vertical frame border from bottom to top-left end of rTLBR.
677 const Style
& rTLFromR
, /// Horizontal frame border from right to top-left end of rTLBR.
678 const Style
& rBRFromT
, /// Vertical frame border from top to bottom-right end of rTLBR.
679 const Style
& rBRFromL
, /// Horizontal frame border from left to bottom-right end of rTLBR.
681 const Style
& rBLFromT
, /// Vertical frame border from top to bottom-left end of rBLTR.
682 const Style
& rBLFromR
, /// Horizontal frame border from right to bottom-left end of rBLTR.
683 const Style
& rTRFromB
, /// Vertical frame border from bottom to top-right end of rBLTR.
684 const Style
& rTRFromL
, /// Horizontal frame border from left to top-right end of rBLTR.
686 const Color
* pForceColor
= 0, /// If specified, overrides frame border color.
687 bool bDiagDblClip
= false /// true = Use clipping for crossing double frame borders.
690 // ============================================================================
695 /* Yes, I love ASCII art. :-) -DR- */
699 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */