LibreOffice Module svx (master) 1
framelink.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SVX_FRAMELINK_HXX
21#define INCLUDED_SVX_FRAMELINK_HXX
22
23#include <sal/types.h>
24#include <tools/color.hxx>
25#include <svx/svxdllapi.h>
27
28namespace svx::frame {
29
30
31// Enums
32
33
36enum class RefMode : sal_uInt8
37{
40
46 Begin,
47
53 End
54};
55
56
57// Classes
58
59
99{
100private:
104 double mfPrim;
105 double mfDist;
106 double mfSecn;
112
113public:
115 explicit Style();
117 explicit Style( double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale );
119 explicit Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale );
121 explicit Style( const editeng::SvxBorderLine* pBorder, double fScale );
122
123 RefMode GetRefMode() const { return meRefMode; }
124 Color GetColorPrim() const { return maColorPrim; }
125 Color GetColorSecn() const { return maColorSecn; }
126 Color GetColorGap() const { return maColorGap; }
127 bool UseGapColor() const { return mbUseGapColor; }
128 double Prim() const { return mfPrim; }
129 double Dist() const { return mfDist; }
130 double Secn() const { return mfSecn; }
131 double PatternScale() const { return mfPatternScale;}
132 SvxBorderLineStyle Type() const { return mnType; }
133
136 bool IsUsed() const { return 0.0 != mfPrim; }
137
139 double GetWidth() const { return mfPrim + mfDist + mfSecn; }
140
142 void Clear();
144 void Set( double nP, double nD, double nS );
146 void Set( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, double nP, double nD, double nS );
148 void Set( const editeng::SvxBorderLine* pBorder, double fScale, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 );
149
151 void SetRefMode( RefMode eRefMode ) { meRefMode = eRefMode; }
153 void SetColorPrim( const Color& rColor ) { maColorPrim = rColor; }
154 void SetColorSecn( const Color& rColor ) { maColorSecn = rColor; }
157
159 Style& MirrorSelf();
160
162 void SetWordTableCell(bool bWordTableCell) { mbWordTableCell = bWordTableCell; }
163
164 bool operator==( const Style& rOther) const;
165 bool operator<( const Style& rOther) const;
166};
167
168inline bool operator>( const Style& rL, const Style& rR ) { return rR.operator<(rL); }
169
171 : mfPrim(0)
172 , mfDist(0)
173 , mfSecn(0)
174 , mfPatternScale(1.0)
175 , meRefMode(RefMode::Centered)
177 , mbWordTableCell(false)
178 , mbUseGapColor(false)
179{}
180
181}
182
183
184#endif
185/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxBorderLineStyle
Contains the widths of primary and secondary line of a frame style.
Definition: framelink.hxx:99
double Secn() const
Definition: framelink.hxx:130
void SetColorSecn(const Color &rColor)
Definition: framelink.hxx:154
double mfDist
Width of primary (single, left, or top) line.
Definition: framelink.hxx:105
void SetType(SvxBorderLineStyle nType)
Sets whether to use dotted style for single hair lines.
Definition: framelink.hxx:156
double mfPatternScale
Width of secondary (right or bottom) line.
Definition: framelink.hxx:107
Color GetColorGap() const
Definition: framelink.hxx:126
Color GetColorSecn() const
Definition: framelink.hxx:125
void SetRefMode(RefMode eRefMode)
Sets a new reference point handling mode, does not modify other settings.
Definition: framelink.hxx:151
double GetWidth() const
Returns the total width of this frame style.
Definition: framelink.hxx:139
RefMode meRefMode
Scale used for line pattern spacing.
Definition: framelink.hxx:108
Color GetColorPrim() const
Definition: framelink.hxx:124
bool UseGapColor() const
Definition: framelink.hxx:127
double Prim() const
Definition: framelink.hxx:128
SvxBorderLineStyle mnType
Reference point handling for this frame border.
Definition: framelink.hxx:109
Style()
Constructs an invisible frame style.
Definition: framelink.hxx:170
void SetWordTableCell(bool bWordTableCell)
Enables the Word-compatible Style comparison code.
Definition: framelink.hxx:162
RefMode GetRefMode() const
Definition: framelink.hxx:123
void SetColorPrim(const Color &rColor)
Sets a new color, does not modify other settings.
Definition: framelink.hxx:153
double mfSecn
Distance between primary and secondary line.
Definition: framelink.hxx:106
SvxBorderLineStyle Type() const
Definition: framelink.hxx:132
bool IsUsed() const
Check if this style is used - this depends on it having any width definition.
Definition: framelink.hxx:136
double PatternScale() const
Definition: framelink.hxx:131
double Dist() const
Definition: framelink.hxx:129
void Clear(EHistoryType eHistory)
RefMode
Specifies how the reference points for frame borders are used.
Definition: framelink.hxx:37
@ Centered
Frame borders are drawn centered to the reference points.
bool operator>(const Style &rL, const Style &rR)
Definition: framelink.hxx:168
QPRO_FUNC_TYPE nType
sal_Int32 mnType
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
unsigned char sal_uInt8
#define SAL_WARN_UNUSED
bool operator<(const Subset &rLHS, const Subset &rRHS)
Definition: ucsubset.hxx:50
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)