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...
 
SvxBorderLineStyle mnType
 Scale used for line pattern spacing. More...
 
RefMode meRefMode
 
bool mbWordTableCell: 1
 Reference point handling for this frame border. More...
 
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 98 of file framelink.hxx.

Constructor & Destructor Documentation

◆ Style() [1/4]

svx::frame::Style::Style ( )
inlineexplicit

Constructs an invisible frame style.

Definition at line 170 of file framelink.hxx.

References svx::frame::Centered, mnType, and SOLID.

◆ Style() [2/4]

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 34 of file framelink.cxx.

References Clear(), mfPatternScale, mnType, nType, and Set().

◆ Style() [3/4]

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 42 of file framelink.cxx.

References Clear(), mfPatternScale, mnType, nType, and Set().

◆ Style() [4/4]

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

Constructs a frame style from the passed SvxBorderLine struct.

Definition at line 50 of file framelink.cxx.

References Clear(), mfPatternScale, and Set().

Member Function Documentation

◆ Clear()

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

Sets the frame style to invisible state.

Definition at line 60 of file framelink.cxx.

References svx::frame::Centered, maColorGap, maColorPrim, maColorSecn, mbUseGapColor, mbWordTableCell, meRefMode, mfDist, mfPatternScale, mfPrim, mfSecn, and mnType.

Referenced by Set(), svx::FrameBorder::SetState(), and Style().

◆ Dist()

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

◆ GetColorGap()

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

Definition at line 126 of file framelink.hxx.

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

◆ GetColorPrim()

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

Definition at line 124 of file framelink.hxx.

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

◆ GetColorSecn()

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

Definition at line 125 of file framelink.hxx.

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

◆ GetRefMode()

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

Definition at line 123 of file framelink.hxx.

Referenced by operator==().

◆ GetWidth()

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

Returns the total width of this frame style.

Definition at line 139 of file framelink.hxx.

Referenced by operator<(), and Set().

◆ IsUsed()

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 136 of file framelink.hxx.

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

◆ MirrorSelf()

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

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

Definition at line 162 of file framelink.cxx.

References svx::frame::Begin, svx::frame::Centered, svx::frame::End, maColorPrim, maColorSecn, meRefMode, mfPrim, and mfSecn.

◆ operator<()

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

Definition at line 287 of file framelink.cxx.

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

◆ operator==()

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

◆ PatternScale()

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

Definition at line 131 of file framelink.hxx.

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

◆ Prim()

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

Definition at line 128 of file framelink.hxx.

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

◆ Secn()

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

◆ Set() [1/3]

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 89 of file framelink.cxx.

References maColorGap, maColorPrim, maColorSecn, mbUseGapColor, and Set().

◆ Set() [2/3]

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

◆ Set() [3/3]

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

Sets the frame style to the passed line widths.

Definition at line 75 of file framelink.cxx.

References mfDist, mfPrim, and mfSecn.

Referenced by Set(), svx::FrameBorder::SetCoreStyle(), and Style().

◆ SetColorPrim()

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

Sets a new color, does not modify other settings.

Definition at line 153 of file framelink.hxx.

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

◆ SetColorSecn()

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

Definition at line 154 of file framelink.hxx.

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

◆ SetRefMode()

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

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

Definition at line 151 of file framelink.hxx.

◆ SetType()

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

Sets whether to use dotted style for single hair lines.

Definition at line 156 of file framelink.hxx.

References mnType, and nType.

◆ SetWordTableCell()

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

Enables the Word-compatible Style comparison code.

Definition at line 162 of file framelink.hxx.

◆ Type()

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

Definition at line 132 of file framelink.hxx.

References mnType.

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

◆ UseGapColor()

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

Definition at line 127 of file framelink.hxx.

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

Member Data Documentation

◆ maColorGap

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

Definition at line 103 of file framelink.hxx.

Referenced by Clear(), and Set().

◆ maColorPrim

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

Definition at line 101 of file framelink.hxx.

Referenced by Clear(), MirrorSelf(), and Set().

◆ maColorSecn

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

Definition at line 102 of file framelink.hxx.

Referenced by Clear(), MirrorSelf(), and Set().

◆ mbUseGapColor

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

Definition at line 111 of file framelink.hxx.

Referenced by Clear(), and Set().

◆ mbWordTableCell

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

Reference point handling for this frame border.

Definition at line 110 of file framelink.hxx.

Referenced by Clear(), and operator<().

◆ meRefMode

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

Definition at line 109 of file framelink.hxx.

Referenced by Clear(), and MirrorSelf().

◆ mfDist

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

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

Definition at line 105 of file framelink.hxx.

Referenced by Clear(), and Set().

◆ mfPatternScale

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

Width of secondary (right or bottom) line.

Definition at line 107 of file framelink.hxx.

Referenced by Clear(), Set(), and Style().

◆ mfPrim

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

Definition at line 104 of file framelink.hxx.

Referenced by Clear(), MirrorSelf(), and Set().

◆ mfSecn

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

Distance between primary and secondary line.

Definition at line 106 of file framelink.hxx.

Referenced by Clear(), MirrorSelf(), and Set().

◆ mnType

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

Scale used for line pattern spacing.

Definition at line 108 of file framelink.hxx.

Referenced by Clear(), Set(), and Style().


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