LibreOffice Module sw (master) 1
fmtclds.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#ifndef INCLUDED_SW_INC_FMTCLDS_HXX
20#define INCLUDED_SW_INC_FMTCLDS_HXX
21
23#include <tools/color.hxx>
24#include <tools/solar.h>
25#include <svl/poolitem.hxx>
26#include "swdllapi.h"
27#include "hintids.hxx"
28#include "format.hxx"
29
30#include <vector>
31
34{
35 sal_uInt16 m_nWish;
38 sal_uInt16 m_nLeft;
39 sal_uInt16 m_nRight;
40
41public:
42 SwColumn();
43
44 bool operator==( const SwColumn & ) const;
45
46 void SetWishWidth( sal_uInt16 nNew ) { m_nWish = nNew; }
47 void SetLeft ( sal_uInt16 nNew ) { m_nLeft = nNew; }
48 void SetRight( sal_uInt16 nNew ) { m_nRight = nNew; }
49
50 sal_uInt16 GetWishWidth() const { return m_nWish; }
51 sal_uInt16 GetLeft () const { return m_nLeft; }
52 sal_uInt16 GetRight() const { return m_nRight; }
53
54 void dumpAsXml(xmlTextWriterPtr pWriter) const;
55};
56
57typedef std::vector<SwColumn> SwColumns;
58
60{
65};
66
68{
72
73 sal_uInt16 m_nLineHeight;
77
79 sal_uInt16 m_nWidth;
81
82 bool m_bOrtho;
88 SAL_DLLPRIVATE void Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct );
89
90public:
92 SwFormatCol( const SwFormatCol& );
93 virtual ~SwFormatCol() override;
94 //#i120133#
95 sal_Int16 GetAdjustValue() const { return m_aWidthAdjustValue; }
96 void SetAdjustValue( sal_Int16 n ) { m_aWidthAdjustValue = n; }
97
99
101 virtual bool operator==( const SfxPoolItem& ) const override;
102 virtual SwFormatCol* Clone( SfxItemPool* pPool = nullptr ) const override;
103 virtual bool GetPresentation( SfxItemPresentation ePres,
104 MapUnit eCoreMetric,
105 MapUnit ePresMetric,
106 OUString &rText,
107 const IntlWrapper& rIntl ) const override;
108
109 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
110 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
111
112 const SwColumns &GetColumns() const { return m_aColumns; }
113 SwColumns &GetColumns() { return m_aColumns; }
114 sal_uInt16 GetNumCols() const { return m_aColumns.size(); }
115
116 SvxBorderLineStyle GetLineStyle() const { return m_eLineStyle;}
117 sal_uLong GetLineWidth() const { return m_nLineWidth;}
118 const Color& GetLineColor() const { return m_aLineColor;}
119
120 SwColLineAdj GetLineAdj() const { return m_eAdj; }
121 bool IsOrtho() const { return m_bOrtho; }
122 sal_uInt16 GetWishWidth() const { return m_nWidth; }
123 sal_uInt8 GetLineHeight()const { return m_nLineHeight; }
124
127 sal_uInt16 GetGutterWidth( bool bMin = false ) const;
128
129 void SetLineStyle(SvxBorderLineStyle eStyle) { m_eLineStyle = eStyle;}
130 void SetLineWidth(sal_uLong nLWidth) { m_nLineWidth = nLWidth;}
131 void SetLineColor(const Color& rCol ) { m_aLineColor = rCol;}
132 void SetLineHeight( sal_uInt8 nNew ) { m_nLineHeight = nNew; }
133 void SetLineAdj( SwColLineAdj eNew ){ m_eAdj = eNew; }
134 void SetWishWidth( sal_uInt16 nNew ) { m_nWidth = nNew; }
135
138 void Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct );
139
144 void SetGutterWidth( sal_uInt16 nNew, sal_uInt16 nAct );
145
148 void SetOrtho( bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct );
149
151 void SetOrtho_( bool bNew ) { m_bOrtho = bNew; }
152
156 sal_uInt16 CalcColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const;
157
160 sal_uInt16 CalcPrtColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const;
161
162 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
163};
164
165inline const SwFormatCol &SwAttrSet::GetCol(bool bInP) const
166 { return Get( RES_COL,bInP); }
167
168inline const SwFormatCol &SwFormat::GetCol(bool bInP) const
169 { return m_aSet.GetCol(bInP); }
170
171#endif
172
173/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
SvxBorderLineStyle
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:165
ColumnDescriptor.
Definition: fmtclds.hxx:34
sal_uInt16 GetLeft() const
Definition: fmtclds.hxx:51
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:824
void SetRight(sal_uInt16 nNew)
Definition: fmtclds.hxx:48
sal_uInt16 GetRight() const
Definition: fmtclds.hxx:52
SwColumn()
Definition: atrfrm.cxx:810
sal_uInt16 m_nRight
Right border.
Definition: fmtclds.hxx:39
void SetLeft(sal_uInt16 nNew)
Definition: fmtclds.hxx:47
bool operator==(const SwColumn &) const
Definition: atrfrm.cxx:817
sal_uInt16 m_nWish
Desired width, borders included.
Definition: fmtclds.hxx:35
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:50
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:46
sal_uInt16 m_nLeft
Left border.
Definition: fmtclds.hxx:38
void SetLineStyle(SvxBorderLineStyle eStyle)
Definition: fmtclds.hxx:129
SvxBorderLineStyle m_eLineStyle
style of the separator line
Definition: fmtclds.hxx:69
sal_uLong m_nLineWidth
Width of the separator line.
Definition: fmtclds.hxx:70
void SetLineWidth(sal_uLong nLWidth)
Definition: fmtclds.hxx:130
void SetLineHeight(sal_uInt8 nNew)
Definition: fmtclds.hxx:132
SwColLineAdj m_eAdj
Line will be adjusted top, centered or bottom.
Definition: fmtclds.hxx:76
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
SwColumns & GetColumns()
Definition: fmtclds.hxx:113
bool IsOrtho() const
Definition: fmtclds.hxx:121
sal_Int16 GetAdjustValue() const
Definition: fmtclds.hxx:95
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:134
void SetOrtho_(bool bNew)
For the reader.
Definition: fmtclds.hxx:151
const Color & GetLineColor() const
Definition: fmtclds.hxx:118
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
void SetLineColor(const Color &rCol)
Definition: fmtclds.hxx:131
SvxBorderLineStyle GetLineStyle() const
Definition: fmtclds.hxx:116
sal_uInt16 m_nWidth
Total desired width of all columns.
Definition: fmtclds.hxx:79
void SetLineAdj(SwColLineAdj eNew)
Definition: fmtclds.hxx:133
bool m_bOrtho
Only if this flag is set, the setting of GutterWidth will be accompanied by a "visual rearrangement".
Definition: fmtclds.hxx:82
sal_uLong GetLineWidth() const
Definition: fmtclds.hxx:117
void SetAdjustValue(sal_Int16 n)
Definition: fmtclds.hxx:96
sal_uInt16 m_nLineHeight
Percentile height of lines.
Definition: fmtclds.hxx:73
SwColumns m_aColumns
Information concerning the columns.
Definition: fmtclds.hxx:78
Color m_aLineColor
Color of the separator line.
Definition: fmtclds.hxx:71
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
sal_Int16 m_aWidthAdjustValue
Definition: fmtclds.hxx:80
SwAttrSet m_aSet
Definition: format.hxx:51
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
void Init()
std::vector< SwColumn > SwColumns
Definition: fmtclds.hxx:57
SwColLineAdj
Definition: fmtclds.hxx:60
@ COLADJ_BOTTOM
Definition: fmtclds.hxx:64
@ COLADJ_CENTER
Definition: fmtclds.hxx:63
@ COLADJ_NONE
Definition: fmtclds.hxx:61
@ COLADJ_TOP
Definition: fmtclds.hxx:62
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
sal_Int64 n
MapUnit
SfxItemPresentation
sal_uIntPtr sal_uLong
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_uInt8