LibreOffice Module svx (master)  1
Public Member Functions | Private Attributes | List of all members
svx::frame::Style Class Reference

Contains the widths of primary and secondary line of a frame style. More...

#include <framelink.hxx>

Collaboration diagram for svx::frame::Style:
[legend]

Public Member Functions

 Style ()
 Constructs an invisible frame style. More...
 
 Style (double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale)
 Constructs a frame style with passed line widths. More...
 
 Style (const Color &rColorPrim, const Color &rColorSecn, const Color &rColorGap, bool bUseGapColor, double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale)
 Constructs a frame style with passed color and line widths. More...
 
 Style (const editeng::SvxBorderLine *pBorder, double fScale)
 Constructs a frame style from the passed SvxBorderLine struct. More...
 
RefMode GetRefMode () const
 
Color GetColorPrim () const
 
Color GetColorSecn () const
 
Color GetColorGap () const
 
bool UseGapColor () const
 
double Prim () const
 
double Dist () const
 
double Secn () const
 
double PatternScale () const
 
SvxBorderLineStyle Type () const
 
bool IsUsed () const
 Check if this style is used - this depends on it having any width definition. More...
 
double GetWidth () const
 Returns the total width of this frame style. More...
 
void Clear ()
 Sets the frame style to invisible state. More...
 
void Set (double nP, double nD, double nS)
 Sets the frame style to the passed line widths. More...
 
void Set (const Color &rColorPrim, const Color &rColorSecn, const Color &rColorGap, bool bUseGapColor, double nP, double nD, double nS)
 Sets the frame style to the passed line widths. More...
 
void Set (const editeng::SvxBorderLine *pBorder, double fScale, sal_uInt16 nMaxWidth=SAL_MAX_UINT16)
 Sets the frame style to the passed SvxBorderLine struct. More...
 
void SetRefMode (RefMode eRefMode)
 Sets a new reference point handling mode, does not modify other settings. More...
 
void SetColorPrim (const Color &rColor)
 Sets a new color, does not modify other settings. More...
 
void SetColorSecn (const Color &rColor)
 
void SetType (SvxBorderLineStyle nType)
 Sets whether to use dotted style for single hair lines. More...
 
StyleMirrorSelf ()
 Mirrors this style (exchanges primary and secondary), if it is a double frame style. More...
 
void SetWordTableCell (bool bWordTableCell)
 Enables the Word-compatible Style comparison code. More...
 
bool operator== (const Style &rOther) const
 
bool operator< (const Style &rOther) const
 

Private Attributes

Color maColorPrim
 
Color maColorSecn
 
Color maColorGap
 
double mfPrim
 
double mfDist
 Width of primary (single, left, or top) line. More...
 
double mfSecn
 Distance between primary and secondary line. More...
 
double mfPatternScale
 Width of secondary (right or bottom) line. More...
 
RefMode meRefMode
 Scale used for line pattern spacing. More...
 
SvxBorderLineStyle mnType
 Reference point handling for this frame border. More...
 
bool mbWordTableCell: 1
 
bool mbUseGapColor: 1
 

Detailed Description

Contains the widths of primary and secondary line of a frame style.

In the following, "frame style" is a complete style of one frame border, i.e. the double line at the left side of the frame. A "line" is always a trivial single line, i.e. the first line of a double frame style.

The following states of the members of this struct are valid:

mnPrim mnDist mnSecn frame style

0 0 0 invisible >0 0 0 single >0 >0 >0 double

The behaviour of the member functions for other states is not defined.

Per definition the primary line in double frame styles is:

The following picture shows the upper end of a vertical double frame border.

|<---------------- GetWidth() ----------------->|
|                                               |
|<----- mnPrim ----->||<- mnDist ->||<- mnSecn >|
|                    ||            ||           |
######################              #############
######################              #############
######################              #############
######################              #############
######################  |           #############
######################  |           #############
                        |
                        |<- middle of the frame border

Definition at line 100 of file framelink.hxx.

Constructor & Destructor Documentation

svx::frame::Style::Style ( )
explicit

Constructs an invisible frame style.

Definition at line 34 of file framelink.cxx.

References Clear.

svx::frame::Style::Style ( double  nP,
double  nD,
double  nS,
SvxBorderLineStyle  nType,
double  fScale 
)
explicit

Constructs a frame style with passed line widths.

Definition at line 39 of file framelink.cxx.

References Clear, mnType, and Set.

svx::frame::Style::Style ( const Color rColorPrim,
const Color rColorSecn,
const Color rColorGap,
bool  bUseGapColor,
double  nP,
double  nD,
double  nS,
SvxBorderLineStyle  nType,
double  fScale 
)
explicit

Constructs a frame style with passed color and line widths.

Definition at line 47 of file framelink.cxx.

References Clear, mnType, and Set.

svx::frame::Style::Style ( const editeng::SvxBorderLine pBorder,
double  fScale 
)
explicit

Constructs a frame style from the passed SvxBorderLine struct.

Definition at line 55 of file framelink.cxx.

References Clear, and Set.

Member Function Documentation

void svx::frame::Style::Clear ( )

Sets the frame style to invisible state.

Definition at line 65 of file framelink.cxx.

References mnType.

Referenced by svx::FrameBorder::SetState().

double svx::frame::Style::Dist ( ) const
inline
Color svx::frame::Style::GetColorGap ( ) const
inline

Definition at line 128 of file framelink.hxx.

Referenced by svx::FrameSelectorImpl::DrawAllFrameBorders(), and operator==().

Color svx::frame::Style::GetColorPrim ( ) const
inline

Definition at line 126 of file framelink.hxx.

Referenced by svx::FrameSelectorImpl::DrawAllFrameBorders(), and operator==().

Color svx::frame::Style::GetColorSecn ( ) const
inline

Definition at line 127 of file framelink.hxx.

Referenced by svx::FrameSelectorImpl::DrawAllFrameBorders(), and operator==().

RefMode svx::frame::Style::GetRefMode ( ) const
inline

Definition at line 125 of file framelink.hxx.

Referenced by operator==().

double svx::frame::Style::GetWidth ( ) const
inline

Returns the total width of this frame style.

Definition at line 141 of file framelink.hxx.

Referenced by operator<().

bool svx::frame::Style::IsUsed ( ) const
inline

Check if this style is used - this depends on it having any width definition.

As can be seen in the definition comment above, Prim() must be non zero to have a width

Definition at line 138 of file framelink.hxx.

Referenced by drawinglayer::primitive2d::SdrFrameBorderData::addSdrConnectStyleData(), svx::frame::Array::CreateB2DPrimitiveRange(), and svx::FrameBorder::SetCoreStyle().

Style & svx::frame::Style::MirrorSelf ( )

Mirrors this style (exchanges primary and secondary), if it is a double frame style.

Definition at line 167 of file framelink.cxx.

bool svx::frame::Style::operator< ( const Style rOther) const

Definition at line 292 of file framelink.cxx.

References Dist(), GetWidth(), Secn(), and Type().

bool svx::frame::Style::operator== ( const Style rOther) const
double svx::frame::Style::PatternScale ( ) const
inline

Definition at line 133 of file framelink.hxx.

Referenced by svx::FrameSelectorImpl::DrawAllFrameBorders().

double svx::frame::Style::Prim ( ) const
inline

Definition at line 130 of file framelink.hxx.

Referenced by svx::FrameSelectorImpl::DrawAllFrameBorders(), and operator==().

double svx::frame::Style::Secn ( ) const
inline
void svx::frame::Style::Set ( double  nP,
double  nD,
double  nS 
)

Sets the frame style to the passed line widths.

Definition at line 80 of file framelink.cxx.

Referenced by svx::FrameBorder::SetCoreStyle().

void svx::frame::Style::Set ( const Color rColorPrim,
const Color rColorSecn,
const Color rColorGap,
bool  bUseGapColor,
double  nP,
double  nD,
double  nS 
)

Sets the frame style to the passed line widths.

Definition at line 94 of file framelink.cxx.

References Set.

void svx::frame::Style::Set ( const editeng::SvxBorderLine pBorder,
double  fScale,
sal_uInt16  nMaxWidth = SAL_MAX_UINT16 
)
void svx::frame::Style::SetColorPrim ( const Color rColor)
inline

Sets a new color, does not modify other settings.

Definition at line 155 of file framelink.hxx.

Referenced by svx::FrameBorder::SetUIColorPrim().

void svx::frame::Style::SetColorSecn ( const Color rColor)
inline

Definition at line 156 of file framelink.hxx.

Referenced by svx::FrameBorder::SetUIColorSecn().

void svx::frame::Style::SetRefMode ( RefMode  eRefMode)
inline

Sets a new reference point handling mode, does not modify other settings.

Definition at line 153 of file framelink.hxx.

void svx::frame::Style::SetType ( SvxBorderLineStyle  nType)
inline

Sets whether to use dotted style for single hair lines.

Definition at line 158 of file framelink.hxx.

void svx::frame::Style::SetWordTableCell ( bool  bWordTableCell)
inline

Enables the Word-compatible Style comparison code.

Definition at line 164 of file framelink.hxx.

SvxBorderLineStyle svx::frame::Style::Type ( ) const
inline
bool svx::frame::Style::UseGapColor ( ) const
inline

Definition at line 129 of file framelink.hxx.

Referenced by svx::FrameSelectorImpl::DrawAllFrameBorders(), and operator==().

Member Data Documentation

Color svx::frame::Style::maColorGap
private

Definition at line 105 of file framelink.hxx.

Color svx::frame::Style::maColorPrim
private

Definition at line 103 of file framelink.hxx.

Color svx::frame::Style::maColorSecn
private

Definition at line 104 of file framelink.hxx.

bool svx::frame::Style::mbUseGapColor
private

Definition at line 113 of file framelink.hxx.

bool svx::frame::Style::mbWordTableCell
private

Definition at line 112 of file framelink.hxx.

RefMode svx::frame::Style::meRefMode
private

Scale used for line pattern spacing.

Definition at line 110 of file framelink.hxx.

double svx::frame::Style::mfDist
private

Width of primary (single, left, or top) line.

Definition at line 107 of file framelink.hxx.

double svx::frame::Style::mfPatternScale
private

Width of secondary (right or bottom) line.

Definition at line 109 of file framelink.hxx.

double svx::frame::Style::mfPrim
private

Definition at line 106 of file framelink.hxx.

double svx::frame::Style::mfSecn
private

Distance between primary and secondary line.

Definition at line 108 of file framelink.hxx.

SvxBorderLineStyle svx::frame::Style::mnType
private

Reference point handling for this frame border.

Definition at line 111 of file framelink.hxx.


The documentation for this class was generated from the following files: