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