LibreOffice Module editeng (master) 1
|
#include <borderline.hxx>
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 Color & | GetColor () 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 |
Definition at line 148 of file borderline.hxx.
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.
Definition at line 81 of file borderline.cxx.
Referenced by SetBorderLineStyle().
|
inline |
Definition at line 225 of file borderline.hxx.
Referenced by operator==().
|
inline |
Definition at line 170 of file borderline.hxx.
References m_aColor.
Color editeng::SvxBorderLine::GetColorGap | ( | ) | const |
Definition at line 622 of file borderline.cxx.
References BorderWidthImpl::IsDouble(), m_aColor, m_aWidthImpl, and m_pColorGapFn.
Color editeng::SvxBorderLine::GetColorIn | ( | bool | bLeftOrTop = true | ) | const |
Definition at line 607 of file borderline.cxx.
References BorderWidthImpl::IsDouble(), m_aColor, m_aWidthImpl, m_bUseLeftTop, and m_pColorInFn.
Color editeng::SvxBorderLine::GetColorOut | ( | bool | bLeftOrTop = true | ) | const |
Definition at line 592 of file borderline.cxx.
References BorderWidthImpl::IsDouble(), m_aColor, m_aWidthImpl, m_bUseLeftTop, and m_pColorOutFn.
|
inline |
Definition at line 173 of file borderline.hxx.
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().
sal_uInt16 editeng::SvxBorderLine::GetInWidth | ( | ) | const |
Definition at line 524 of file borderline.cxx.
References BorderWidthImpl::GetLine1(), BorderWidthImpl::GetLine2(), m_aWidthImpl, m_bMirrorWidths, m_nDiv, m_nMult, m_nWidth, and BigInt::Scale().
Referenced by GetValueString(), and HasPriority().
sal_uInt16 editeng::SvxBorderLine::GetOutWidth | ( | ) | const |
Definition at line 516 of file borderline.cxx.
References BorderWidthImpl::GetLine1(), BorderWidthImpl::GetLine2(), m_aWidthImpl, m_bMirrorWidths, m_nDiv, m_nMult, m_nWidth, and BigInt::Scale().
Referenced by GetValueString().
|
inline |
Definition at line 244 of file borderline.hxx.
Referenced by editeng::BorderDistancesToWord(), and HasPriority().
OUString editeng::SvxBorderLine::GetValueString | ( | MapUnit | eSrcUnit, |
MapUnit | eDestUnit, | ||
const IntlWrapper * | pIntl, | ||
bool | bMetricStr = false |
||
) | const |
Definition at line 639 of file borderline.cxx.
References aStr, cpDelim, EditResId(), GetColorString(), GetDistance(), GetInWidth(), GetMetricId(), GetMetricText(), GetOutWidth(), m_aColor, m_nStyle, and SAL_N_ELEMENTS.
|
inline |
Definition at line 220 of file borderline.hxx.
|
static |
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.
Definition at line 328 of file borderline.cxx.
References DASH_DOT, DASH_DOT_DOT, DASHED, DOTTED, DOUBLE, DOUBLE_THIN, EMBOSSED, ENGRAVED, FINE_DASHED, INSET, editeng::INSET_line2, NONE, OUTSET, editeng::OUTSET_line1, SOLID, THICKTHIN_LARGEGAP, editeng::THICKTHIN_LARGEGAP_line1, editeng::THICKTHIN_LARGEGAP_line2, THICKTHIN_MEDIUMGAP, THICKTHIN_SMALLGAP, editeng::THICKTHIN_SMALLGAP_gap, editeng::THICKTHIN_SMALLGAP_line1, THINTHICK_LARGEGAP, editeng::THINTHICK_LARGEGAP_line1, editeng::THINTHICK_LARGEGAP_line2, THINTHICK_MEDIUMGAP, THINTHICK_SMALLGAP, editeng::THINTHICK_SMALLGAP_gap, and editeng::THINTHICK_SMALLGAP_line2.
Referenced by GuessLinesWidths(), and SetBorderLineStyle().
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:
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.
nStyle | the border style used to guess the width. |
nIn | the width of the inner line in 1th pt |
nOut | the width of the outer line in 1th pt |
nDist | the 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().
|
inline |
Definition at line 187 of file borderline.hxx.
bool editeng::SvxBorderLine::HasPriority | ( | const SvxBorderLine & | rOtherLine | ) | const |
Definition at line 691 of file borderline.cxx.
References GetInWidth(), and GetScaledWidth().
|
inline |
Definition at line 243 of file borderline.hxx.
References BorderWidthImpl::IsDouble().
|
inline |
Definition at line 238 of file borderline.hxx.
References BorderWidthImpl::IsEmpty(), and NONE.
Definition at line 86 of file borderline.cxx.
References Color::getBColor(), basegfx::Tuple3D< typename TYPE >::getZ(), basegfx::utils::hsl2rgb(), basegfx::utils::rgb2hsl(), and basegfx::Tuple3D< typename TYPE >::setZ().
Referenced by SetBorderLineStyle().
bool editeng::SvxBorderLine::operator== | ( | const SvxBorderLine & | rCmp | ) | const |
Definition at line 538 of file borderline.cxx.
References GetBorderLineStyle(), m_aColor, m_aComplexColor, m_aWidthImpl, m_bMirrorWidths, m_bUseLeftTop, m_nStyle, m_nWidth, m_pColorGapFn, m_pColorInFn, and m_pColorOutFn.
void editeng::SvxBorderLine::ScaleMetrics | ( | tools::Long | nMult, |
tools::Long | nDiv | ||
) |
Definition at line 429 of file borderline.cxx.
void editeng::SvxBorderLine::SetBorderLineStyle | ( | SvxBorderLineStyle | nNew | ) |
Definition at line 552 of file borderline.cxx.
References darkColor(), EMBOSSED, ENGRAVED, getWidthImpl(), INSET, lightColor(), m_aWidthImpl, m_bUseLeftTop, m_nStyle, m_pColorGapFn, m_pColorInFn, m_pColorOutFn, OUTSET, threeDDarkColor(), threeDLightColor(), and threeDMediumColor().
Referenced by GuessLinesWidths(), SvxBoxItem::PutValue(), and SvxRTFParser::ReadBorderAttr().
|
inline |
Definition at line 171 of file borderline.hxx.
References m_aColor.
Referenced by SvxRTFParser::ReadBorderAttr().
|
inline |
Definition at line 177 of file borderline.hxx.
Referenced by setComplexColorFromAny().
bool editeng::SvxBorderLine::setComplexColorFromAny | ( | css::uno::Any const & | rValue | ) |
Definition at line 67 of file borderline.cxx.
References model::color::getFromXComplexColor(), and setComplexColor().
|
inline |
Definition at line 219 of file borderline.hxx.
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().
Definition at line 105 of file borderline.cxx.
Referenced by SetBorderLineStyle().
Definition at line 99 of file borderline.cxx.
Referenced by SetBorderLineStyle().
Definition at line 111 of file borderline.cxx.
Referenced by SetBorderLineStyle().
|
private |
Definition at line 157 of file borderline.hxx.
Referenced by GetColorGap(), GetColorIn(), GetColorOut(), GetValueString(), operator==(), and SvxBorderLine().
|
private |
Definition at line 158 of file borderline.hxx.
Referenced by operator==().
|
private |
Definition at line 156 of file borderline.hxx.
Referenced by GetColorGap(), GetColorIn(), GetColorOut(), GetDistance(), GetInWidth(), GetOutWidth(), GuessLinesWidths(), operator==(), and SetBorderLineStyle().
|
private |
Definition at line 160 of file borderline.hxx.
Referenced by GetInWidth(), GetOutWidth(), and operator==().
|
private |
Definition at line 161 of file borderline.hxx.
Referenced by GetColorIn(), GetColorOut(), operator==(), and SetBorderLineStyle().
|
private |
Definition at line 152 of file borderline.hxx.
Referenced by GetDistance(), GetInWidth(), GetOutWidth(), and ScaleMetrics().
|
private |
Definition at line 151 of file borderline.hxx.
Referenced by GetDistance(), GetInWidth(), GetOutWidth(), and ScaleMetrics().
|
private |
Definition at line 159 of file borderline.hxx.
Referenced by GetValueString(), operator==(), and SetBorderLineStyle().
|
private |
Definition at line 150 of file borderline.hxx.
Referenced by GetDistance(), GetInWidth(), GetOutWidth(), GuessLinesWidths(), operator==(), and SetWidth().
Definition at line 155 of file borderline.hxx.
Referenced by GetColorGap(), operator==(), and SetBorderLineStyle().
Definition at line 154 of file borderline.hxx.
Referenced by GetColorIn(), operator==(), and SetBorderLineStyle().
Definition at line 153 of file borderline.hxx.
Referenced by GetColorOut(), operator==(), and SetBorderLineStyle().