LibreOffice Module editeng (master) 1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
editeng::SvxBorderLine Class Referencefinal

#include <borderline.hxx>

Collaboration diagram for editeng::SvxBorderLine:
[legend]

Public Member Functions

 SvxBorderLine (const Color *pCol=nullptr, tools::Long nWidth=0, SvxBorderLineStyle nStyle=SvxBorderLineStyle::SOLID, Color(*pColorOutFn)(Color)=&darkColor, Color(*pColorInFn)(Color)=&darkColor)
 
const ColorGetColor () const
 
void SetColor (const Color &rColor)
 
model::ComplexColor const & getComplexColor () const
 
void setComplexColor (model::ComplexColor const &rComplexColor)
 
bool setComplexColorFromAny (css::uno::Any const &rValue)
 
Color GetColorOut (bool bLeftOrTop=true) const
 
Color GetColorIn (bool bLeftOrTop=true) const
 
bool HasGapColor () const
 
Color GetColorGap () const
 
void SetWidth (tools::Long nWidth)
 
void GuessLinesWidths (SvxBorderLineStyle nStyle, sal_uInt16 nOut, sal_uInt16 nIn=0, sal_uInt16 nDist=0)
 Guess the style and width from the three lines widths values. More...
 
void SetMirrorWidths ()
 
tools::Long GetWidth () const
 
sal_uInt16 GetOutWidth () const
 
sal_uInt16 GetInWidth () const
 
sal_uInt16 GetDistance () const
 
SvxBorderLineStyle GetBorderLineStyle () const
 
void SetBorderLineStyle (SvxBorderLineStyle nNew)
 
void ScaleMetrics (tools::Long nMult, tools::Long nDiv)
 
bool operator== (const SvxBorderLine &rCmp) const
 
OUString GetValueString (MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper *pIntl, bool bMetricStr=false) const
 
bool HasPriority (const SvxBorderLine &rOtherLine) const
 
bool isEmpty () const
 
bool isDouble () const
 
sal_uInt16 GetScaledWidth () const
 

Static Public Member Functions

static Color darkColor (Color aMain)
 
static Color lightColor (Color aMain)
 
static Color threeDLightColor (Color aMain)
 
static Color threeDMediumColor (Color aMain)
 
static Color threeDDarkColor (Color aMain)
 
static BorderWidthImpl getWidthImpl (SvxBorderLineStyle nStyle)
 Get the BorderWithImpl object corresponding to the given #nStyle, all the units handled by the resulting object are Twips and the BorderWidthImpl::GetLine1() corresponds to the Outer Line. More...
 

Private Attributes

tools::Long m_nWidth
 
tools::Long m_nMult
 
tools::Long m_nDiv
 
Color(* m_pColorOutFn )(Color)
 
Color(* m_pColorInFn )(Color)
 
Color(* m_pColorGapFn )(Color)
 
BorderWidthImpl m_aWidthImpl
 
Color m_aColor
 
model::ComplexColor m_aComplexColor
 
SvxBorderLineStyle m_nStyle
 
bool m_bMirrorWidths
 
bool m_bUseLeftTop
 

Detailed Description

Definition at line 148 of file borderline.hxx.

Constructor & Destructor Documentation

◆ SvxBorderLine()

editeng::SvxBorderLine::SvxBorderLine ( const Color pCol = nullptr,
tools::Long  nWidth = 0,
SvxBorderLineStyle  nStyle = SvxBorderLineStyle::SOLID,
Color(*)(Color pColorOutFn = &darkColor,
Color(*)(Color pColorInFn = &darkColor 
)

Definition at line 117 of file borderline.cxx.

References m_aColor.

Member Function Documentation

◆ darkColor()

Color editeng::SvxBorderLine::darkColor ( Color  aMain)
static

Definition at line 81 of file borderline.cxx.

Referenced by SetBorderLineStyle().

◆ GetBorderLineStyle()

SvxBorderLineStyle editeng::SvxBorderLine::GetBorderLineStyle ( ) const
inline

Definition at line 225 of file borderline.hxx.

Referenced by operator==().

◆ GetColor()

const Color & editeng::SvxBorderLine::GetColor ( ) const
inline

Definition at line 170 of file borderline.hxx.

References m_aColor.

◆ GetColorGap()

Color editeng::SvxBorderLine::GetColorGap ( ) const

Definition at line 622 of file borderline.cxx.

References BorderWidthImpl::IsDouble(), m_aColor, m_aWidthImpl, and m_pColorGapFn.

◆ GetColorIn()

Color editeng::SvxBorderLine::GetColorIn ( bool  bLeftOrTop = true) const

◆ GetColorOut()

Color editeng::SvxBorderLine::GetColorOut ( bool  bLeftOrTop = true) const

◆ getComplexColor()

model::ComplexColor const & editeng::SvxBorderLine::getComplexColor ( ) const
inline

Definition at line 173 of file borderline.hxx.

◆ GetDistance()

sal_uInt16 editeng::SvxBorderLine::GetDistance ( ) const

Definition at line 532 of file borderline.cxx.

References BorderWidthImpl::GetGap(), m_aWidthImpl, m_nDiv, m_nMult, m_nWidth, and BigInt::Scale().

Referenced by GetValueString().

◆ GetInWidth()

sal_uInt16 editeng::SvxBorderLine::GetInWidth ( ) const

◆ GetOutWidth()

sal_uInt16 editeng::SvxBorderLine::GetOutWidth ( ) const

◆ GetScaledWidth()

sal_uInt16 editeng::SvxBorderLine::GetScaledWidth ( ) const
inline

Definition at line 244 of file borderline.hxx.

Referenced by editeng::BorderDistancesToWord(), and HasPriority().

◆ GetValueString()

OUString editeng::SvxBorderLine::GetValueString ( MapUnit  eSrcUnit,
MapUnit  eDestUnit,
const IntlWrapper pIntl,
bool  bMetricStr = false 
) const

◆ GetWidth()

tools::Long editeng::SvxBorderLine::GetWidth ( ) const
inline

Definition at line 220 of file borderline.hxx.

◆ getWidthImpl()

BorderWidthImpl editeng::SvxBorderLine::getWidthImpl ( SvxBorderLineStyle  nStyle)
static

◆ GuessLinesWidths()

void editeng::SvxBorderLine::GuessLinesWidths ( SvxBorderLineStyle  nStyle,
sal_uInt16  nOut,
sal_uInt16  nIn = 0,
sal_uInt16  nDist = 0 
)

Guess the style and width from the three lines widths values.

When the value of nStyle is SvxBorderLine::DOUBLE, the style set will be guessed using the three values to match the best possible style among the following:

  • SvxBorderLine::DOUBLE
  • SvxBorderLine::THINTHICK_SMALLGAP
  • SvxBorderLine::THINTHICK_MEDIUMGAP
  • SvxBorderLine::THINTHICK_LARGEGAP
  • SvxBorderLine::THICKTHIN_SMALLGAP
  • SvxBorderLine::THICKTHIN_MEDIUMGAP
  • SvxBorderLine::THICKTHIN_LARGEGAP

If no styles matches the width, then the width is set to 0.

There is one known case that could fit several styles: nIn = nDist = 0.75 pt, nOut = 1.5 pt. This case fits SvxBorderLine::THINTHICK_SMALLGAP and SvxBorderLine::THINTHICK_MEDIUMGAP with a 1.5 pt width and SvxBorderLine::THINTHICK_LARGEGAP with a 0.75 pt width. The same case happens also for thick-thin styles.

Parameters
nStylethe border style used to guess the width.
nInthe width of the inner line in 1th pt
nOutthe width of the outer line in 1th pt
nDistthe width of the gap between the lines in 1th pt

Definition at line 435 of file borderline.cxx.

References DASH_DOT, DASH_DOT_DOT, DASHED, DOTTED, DOUBLE, DOUBLE_THIN, FINE_DASHED, getWidthImpl(), BorderWidthImpl::GuessWidth(), i, m_aWidthImpl, m_nWidth, NONE, SAL_N_ELEMENTS, SetBorderLineStyle(), SOLID, THICKTHIN_LARGEGAP, THICKTHIN_MEDIUMGAP, THICKTHIN_SMALLGAP, THINTHICK_LARGEGAP, THINTHICK_MEDIUMGAP, and THINTHICK_SMALLGAP.

Referenced by legacy::SvxLine::Create(), and legacy::SvxBox::CreateBorderLine().

◆ HasGapColor()

bool editeng::SvxBorderLine::HasGapColor ( ) const
inline

Definition at line 187 of file borderline.hxx.

◆ HasPriority()

bool editeng::SvxBorderLine::HasPriority ( const SvxBorderLine rOtherLine) const

Definition at line 691 of file borderline.cxx.

References GetInWidth(), and GetScaledWidth().

◆ isDouble()

bool editeng::SvxBorderLine::isDouble ( ) const
inline

Definition at line 243 of file borderline.hxx.

References BorderWidthImpl::IsDouble().

◆ isEmpty()

bool editeng::SvxBorderLine::isEmpty ( ) const
inline

Definition at line 238 of file borderline.hxx.

References BorderWidthImpl::IsEmpty(), and NONE.

◆ lightColor()

Color editeng::SvxBorderLine::lightColor ( Color  aMain)
static

◆ operator==()

bool editeng::SvxBorderLine::operator== ( const SvxBorderLine rCmp) const

◆ ScaleMetrics()

void editeng::SvxBorderLine::ScaleMetrics ( tools::Long  nMult,
tools::Long  nDiv 
)

Definition at line 429 of file borderline.cxx.

References m_nDiv, and m_nMult.

◆ SetBorderLineStyle()

void editeng::SvxBorderLine::SetBorderLineStyle ( SvxBorderLineStyle  nNew)

◆ SetColor()

void editeng::SvxBorderLine::SetColor ( const Color rColor)
inline

Definition at line 171 of file borderline.hxx.

References m_aColor.

Referenced by SvxRTFParser::ReadBorderAttr().

◆ setComplexColor()

void editeng::SvxBorderLine::setComplexColor ( model::ComplexColor const &  rComplexColor)
inline

Definition at line 177 of file borderline.hxx.

Referenced by setComplexColorFromAny().

◆ setComplexColorFromAny()

bool editeng::SvxBorderLine::setComplexColorFromAny ( css::uno::Any const &  rValue)

Definition at line 67 of file borderline.cxx.

References model::color::getFromXComplexColor(), and setComplexColor().

◆ SetMirrorWidths()

void editeng::SvxBorderLine::SetMirrorWidths ( )
inline

Definition at line 219 of file borderline.hxx.

◆ SetWidth()

void editeng::SvxBorderLine::SetWidth ( tools::Long  nWidth)

Definition at line 634 of file borderline.cxx.

References m_nWidth.

Referenced by SvxBoxItem::PutValue(), and SvxRTFParser::ReadBorderAttr().

◆ threeDDarkColor()

Color editeng::SvxBorderLine::threeDDarkColor ( Color  aMain)
static

Definition at line 105 of file borderline.cxx.

Referenced by SetBorderLineStyle().

◆ threeDLightColor()

Color editeng::SvxBorderLine::threeDLightColor ( Color  aMain)
static

Definition at line 99 of file borderline.cxx.

Referenced by SetBorderLineStyle().

◆ threeDMediumColor()

Color editeng::SvxBorderLine::threeDMediumColor ( Color  aMain)
static

Definition at line 111 of file borderline.cxx.

Referenced by SetBorderLineStyle().

Member Data Documentation

◆ m_aColor

Color editeng::SvxBorderLine::m_aColor
private

◆ m_aComplexColor

model::ComplexColor editeng::SvxBorderLine::m_aComplexColor
private

Definition at line 158 of file borderline.hxx.

Referenced by operator==().

◆ m_aWidthImpl

BorderWidthImpl editeng::SvxBorderLine::m_aWidthImpl
private

◆ m_bMirrorWidths

bool editeng::SvxBorderLine::m_bMirrorWidths
private

Definition at line 160 of file borderline.hxx.

Referenced by GetInWidth(), GetOutWidth(), and operator==().

◆ m_bUseLeftTop

bool editeng::SvxBorderLine::m_bUseLeftTop
private

Definition at line 161 of file borderline.hxx.

Referenced by GetColorIn(), GetColorOut(), operator==(), and SetBorderLineStyle().

◆ m_nDiv

tools::Long editeng::SvxBorderLine::m_nDiv
private

Definition at line 152 of file borderline.hxx.

Referenced by GetDistance(), GetInWidth(), GetOutWidth(), and ScaleMetrics().

◆ m_nMult

tools::Long editeng::SvxBorderLine::m_nMult
private

Definition at line 151 of file borderline.hxx.

Referenced by GetDistance(), GetInWidth(), GetOutWidth(), and ScaleMetrics().

◆ m_nStyle

SvxBorderLineStyle editeng::SvxBorderLine::m_nStyle
private

Definition at line 159 of file borderline.hxx.

Referenced by GetValueString(), operator==(), and SetBorderLineStyle().

◆ m_nWidth

tools::Long editeng::SvxBorderLine::m_nWidth
private

◆ m_pColorGapFn

Color(* editeng::SvxBorderLine::m_pColorGapFn) (Color)
private

Definition at line 155 of file borderline.hxx.

Referenced by GetColorGap(), operator==(), and SetBorderLineStyle().

◆ m_pColorInFn

Color(* editeng::SvxBorderLine::m_pColorInFn) (Color)
private

Definition at line 154 of file borderline.hxx.

Referenced by GetColorIn(), operator==(), and SetBorderLineStyle().

◆ m_pColorOutFn

Color(* editeng::SvxBorderLine::m_pColorOutFn) (Color)
private

Definition at line 153 of file borderline.hxx.

Referenced by GetColorOut(), operator==(), and SetBorderLineStyle().


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