LibreOffice Module svx (master)  1
Classes | Public Member Functions | Private 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>

Classes

class  implStyle
 

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...
 
bool operator== (const Style &rOther) const
 
bool operator< (const Style &rOther) const
 

Private Member Functions

void implEnsureImplStyle ()
 call to set maImplStyle on demand More...
 

Private Attributes

std::shared_ptr< implStylemaImplStyle
 the impl class holding the data More...
 

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

Constructor & Destructor Documentation

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

Constructs an invisible frame style.

Definition at line 49 of file framelink.cxx.

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

References maImplStyle, 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 62 of file framelink.cxx.

References maImplStyle, 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 70 of file framelink.cxx.

References maImplStyle, and Set().

Member Function Documentation

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

Sets the frame style to invisible state.

Definition at line 81 of file framelink.cxx.

References maImplStyle.

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

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

Definition at line 155 of file framelink.hxx.

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

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

Definition at line 153 of file framelink.hxx.

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

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

Definition at line 154 of file framelink.hxx.

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

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

Definition at line 152 of file framelink.hxx.

References svx::frame::Centered.

Referenced by operator==().

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

Returns the total width of this frame style.

Definition at line 168 of file framelink.hxx.

References svx::frame::Style::implStyle::mfDist, svx::frame::Style::implStyle::mfPrim, and svx::frame::Style::implStyle::mfSecn.

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

void svx::frame::Style::implEnsureImplStyle ( )
private

call to set maImplStyle on demand

Definition at line 41 of file framelink.cxx.

Referenced by Set(), SetColorPrim(), SetColorSecn(), SetRefMode(), and SetType().

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

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

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

Definition at line 293 of file framelink.cxx.

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

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

Definition at line 160 of file framelink.hxx.

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

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

Definition at line 157 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 
)
void svx::frame::Style::Set ( const Color rColorPrim,
const Color rColorSecn,
const Color rColorGap,
bool  bUseGapColor,
double  nP,
double  nD,
double  nS 
)
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)

Sets a new color, does not modify other settings.

Definition at line 201 of file framelink.cxx.

References implEnsureImplStyle(), and maImplStyle.

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

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

Definition at line 216 of file framelink.cxx.

References implEnsureImplStyle(), and maImplStyle.

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

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

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

Definition at line 186 of file framelink.cxx.

References svx::frame::Centered, implEnsureImplStyle(), and maImplStyle.

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

Sets whether to use dotted style for single hair lines.

Definition at line 231 of file framelink.cxx.

References implEnsureImplStyle(), and maImplStyle.

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

Definition at line 156 of file framelink.hxx.

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

Member Data Documentation

std::shared_ptr< implStyle > svx::frame::Style::maImplStyle
private

the impl class holding the data

Definition at line 137 of file framelink.hxx.

Referenced by Clear(), MirrorSelf(), operator<(), operator==(), Set(), SetColorPrim(), SetColorSecn(), SetRefMode(), SetType(), and Style().


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