LibreOffice Module svx (master) 1
rulritem.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_SVX_RULRITEM_HXX
20#define INCLUDED_SVX_RULRITEM_HXX
21
22#include <tools/gen.hxx>
23#include <svl/poolitem.hxx>
24#include <svx/svxdllapi.h>
25#include <vector>
26
28{
29 tools::Long mlLeft; // nLeft or the negative first-line indentation
30 tools::Long mlRight; // the unproblematic right edge
31
32 virtual bool operator==( const SfxPoolItem& ) const override;
33 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
34 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
35
36 virtual bool GetPresentation( SfxItemPresentation ePres,
37 MapUnit eCoreMetric,
38 MapUnit ePresMetric,
39 OUString &rText, const IntlWrapper& ) const override;
40
42
43public:
44 static SfxPoolItem* CreateDefault();
48
49 virtual SvxLongLRSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override;
50
51 tools::Long GetLeft() const { return mlLeft;}
52 tools::Long GetRight() const { return mlRight;}
53 void SetLeft(tools::Long lArgLeft);
54 void SetRight(tools::Long lArgRight);
55};
56
58{
59 tools::Long mlLeft; // nLeft or the negative first-line indentation
60 tools::Long mlRight; // the unproblematic right edge
61
62 virtual bool operator==( const SfxPoolItem& ) const override;
63 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
64 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
65
66 virtual bool GetPresentation( SfxItemPresentation ePres,
67 MapUnit eCoreMetric,
68 MapUnit ePresMetric,
69 OUString &rText, const IntlWrapper& ) const override;
70
72
73public:
74 static SfxPoolItem* CreateDefault();
78
79 virtual SvxLongULSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override;
80
81 tools::Long GetUpper() const { return mlLeft;}
82 tools::Long GetLower() const { return mlRight;}
83 void SetUpper(tools::Long lArgLeft);
84 void SetLower(tools::Long lArgRight);
85};
86
88{
92
93 virtual bool operator==( const SfxPoolItem& ) const override;
94 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
95 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
96
97 virtual bool GetPresentation( SfxItemPresentation ePres,
98 MapUnit eCoreMetric,
99 MapUnit ePresMetric,
100 OUString &rText, const IntlWrapper& ) const override;
101
102 virtual SvxPagePosSizeItem* Clone( SfxItemPool *pPool = nullptr ) const override;
103
104private:
106public:
107 static SfxPoolItem* CreateDefault();
108 SvxPagePosSizeItem(const Point &rPos, tools::Long lWidth, tools::Long lHeight);
111
112 const Point &GetPos() const { return aPos; }
113 tools::Long GetWidth() const { return lWidth; }
114 tools::Long GetHeight() const { return lHeight; }
115};
116
118{
119 tools::Long nStart; /* Start of the column */
120 tools::Long nEnd; /* End of the column */
121 bool bVisible; /* Visibility */
122
123 tools::Long nEndMin; //min. possible position of end
124 tools::Long nEndMax; //max. possible position of end
125
126 SvxColumnDescription(tools::Long start, tools::Long end, bool bVis);
127
129 tools::Long endMin, tools::Long endMax, bool bVis);
130
131 bool operator==(const SvxColumnDescription &rCmp) const;
132 bool operator!=(const SvxColumnDescription &rCmp) const;
133 tools::Long GetWidth() const;
134};
135
136template<typename charT, typename traits>
137inline std::basic_ostream<charT, traits> & operator <<(
138 std::basic_ostream<charT, traits> & stream, SvxColumnDescription const& dsc)
139{
140 return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd
141 << " bVisible " << dsc.bVisible << " nEndMin " << dsc.nEndMin
142 << " nEndMax " << dsc.nEndMax << " }";
143}
144
145
147{
148 std::vector<SvxColumnDescription> aColumns; // Column array
149
150 tools::Long nLeft; // Left edge for the table
151 tools::Long nRight; // Right edge for the table; for columns always
152 // equal to the surrounding frame
153 sal_uInt16 nActColumn; // the current column
154 bool bTable; // table?
155 bool bOrtho; // evenly spread columns
156
157 virtual bool operator==( const SfxPoolItem& ) const override;
158
159 virtual bool GetPresentation( SfxItemPresentation ePres,
160 MapUnit eCoreMetric,
161 MapUnit ePresMetric,
162 OUString &rText,
163 const IntlWrapper& ) const override;
164
165 virtual SvxColumnItem* Clone( SfxItemPool *pPool = nullptr ) const override;
166 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
167 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
168
169public:
170 static SfxPoolItem* CreateDefault();
171 // right edge of the surrounding frame
172 // nLeft, nRight each the distance to the surrounding frame
173 SvxColumnItem(sal_uInt16 nAct = 0);
174 SvxColumnItem(sal_uInt16 nActCol, sal_uInt16 nLeft, sal_uInt16 nRight); // Table with borders
175
176 SvxColumnDescription& operator[](sal_uInt16 index);
177 const SvxColumnDescription& operator[](sal_uInt16 index) const;
178 SvxColumnDescription& At(sal_uInt16 index);
179 SvxColumnDescription& GetActiveColumnDescription();
180
181 sal_uInt16 Count() const;
182 void Append(const SvxColumnDescription& rDesc);
183 void SetLeft(tools::Long aLeft);
184 void SetRight(tools::Long aRight);
185 sal_uInt16 GetActColumn() const { return nActColumn;}
186 bool IsFirstAct() const;
187 bool IsLastAct() const;
188 tools::Long GetLeft() const { return nLeft;}
189 tools::Long GetRight() const { return nRight;}
190 bool IsTable() const { return bTable;}
191 bool CalcOrtho() const;
192 void SetOrtho(bool bVal);
193 bool IsConsistent() const;
194};
195
197{
198 tools::Long nStartX; /* Start in x direction */
199 tools::Long nEndX; /* End in x direction */
200 tools::Long nStartY; /* Start in y direction */
201 tools::Long nEndY; /* End in y direction */
202 bool bLimits; /* boundary limit control by the application */
203
204 virtual bool operator==( const SfxPoolItem& ) const override;
205
206 virtual bool GetPresentation( SfxItemPresentation ePres,
207 MapUnit eCoreMetric,
208 MapUnit ePresMetric,
209 OUString &rText, const IntlWrapper& ) const override;
210
211 virtual SvxObjectItem* Clone( SfxItemPool *pPool = nullptr ) const override;
212 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
213 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
214
215 const SvxObjectItem &operator=(const SvxObjectItem &) = delete;
216
217public:
218 static SfxPoolItem* CreateDefault();
220 tools::Long nStartY, tools::Long nEndY);
221 SvxObjectItem(SvxObjectItem const &) = default;
222
223 tools::Long GetStartX() const { return nStartX;}
224 tools::Long GetEndX() const { return nEndX;}
225 tools::Long GetStartY() const { return nStartY;}
226 tools::Long GetEndY() const { return nEndY;}
227
228 void SetStartX(tools::Long lValue);
229 void SetEndX(tools::Long lValue);
230 void SetStartY(tools::Long lValue);
231 void SetEndY(tools::Long lValue);
232};
233
234#endif
235
236/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
bool operator!=(const SfxPoolItem &rItem) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
bool IsTable() const
Definition: rulritem.hxx:190
tools::Long nRight
Definition: rulritem.hxx:151
tools::Long GetLeft() const
Definition: rulritem.hxx:188
tools::Long nLeft
Definition: rulritem.hxx:150
sal_uInt16 GetActColumn() const
Definition: rulritem.hxx:185
sal_uInt16 nActColumn
Definition: rulritem.hxx:153
std::vector< SvxColumnDescription > aColumns
Definition: rulritem.hxx:148
tools::Long GetRight() const
Definition: rulritem.hxx:189
const SvxLongLRSpaceItem & operator=(const SvxLongLRSpaceItem &)=delete
SvxLongLRSpaceItem(SvxLongLRSpaceItem const &)=default
tools::Long GetRight() const
Definition: rulritem.hxx:52
tools::Long mlRight
Definition: rulritem.hxx:30
tools::Long mlLeft
Definition: rulritem.hxx:29
tools::Long GetLeft() const
Definition: rulritem.hxx:51
tools::Long GetLower() const
Definition: rulritem.hxx:82
tools::Long mlLeft
Definition: rulritem.hxx:59
tools::Long GetUpper() const
Definition: rulritem.hxx:81
const SvxLongULSpaceItem & operator=(const SvxLongULSpaceItem &)=delete
tools::Long mlRight
Definition: rulritem.hxx:60
SvxLongULSpaceItem(SvxLongULSpaceItem const &)=default
SvxObjectItem(SvxObjectItem const &)=default
tools::Long nStartY
Definition: rulritem.hxx:200
tools::Long GetStartX() const
Definition: rulritem.hxx:223
tools::Long GetEndY() const
Definition: rulritem.hxx:226
const SvxObjectItem & operator=(const SvxObjectItem &)=delete
tools::Long GetEndX() const
Definition: rulritem.hxx:224
tools::Long nEndX
Definition: rulritem.hxx:199
tools::Long GetStartY() const
Definition: rulritem.hxx:225
tools::Long nStartX
Definition: rulritem.hxx:198
tools::Long nEndY
Definition: rulritem.hxx:201
tools::Long GetHeight() const
Definition: rulritem.hxx:114
tools::Long lHeight
Definition: rulritem.hxx:91
tools::Long lWidth
Definition: rulritem.hxx:90
const Point & GetPos() const
Definition: rulritem.hxx:112
tools::Long GetWidth() const
Definition: rulritem.hxx:113
SvxPagePosSizeItem(SvxPagePosSizeItem const &)=default
const SvxPagePosSizeItem & operator=(const SvxPagePosSizeItem &)=delete
Reference< XOutputStream > stream
MapUnit
long Long
SfxItemPresentation
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, SvxColumnDescription const &dsc)
Definition: rulritem.hxx:137
tools::Long nStart
Definition: rulritem.hxx:119
tools::Long nEnd
Definition: rulritem.hxx:120
tools::Long nEndMax
Definition: rulritem.hxx:124
tools::Long nEndMin
Definition: rulritem.hxx:123
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
unsigned char sal_uInt8
Count