Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / rulritem.hxx
blob8ee0ec0db30255d451158fcaacb663f812a7bbb4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_RULRITEM_HXX
20 #define INCLUDED_SVX_RULRITEM_HXX
22 #include <tools/gen.hxx>
23 #include <svl/poolitem.hxx>
24 #include <svx/svxdllapi.h>
25 #include <vector>
27 class SVX_DLLPUBLIC SvxLongLRSpaceItem : public SfxPoolItem
29 long mlLeft; // nLeft or the negativ first-line indentation
30 long mlRight; // the unproblematic right edge
32 protected:
34 virtual bool operator==( const SfxPoolItem& ) const override;
35 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
36 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
38 virtual bool GetPresentation( SfxItemPresentation ePres,
39 MapUnit eCoreMetric,
40 MapUnit ePresMetric,
41 OUString &rText, const IntlWrapper * = nullptr ) const override;
43 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
45 private:
46 const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &) = delete;
48 public:
49 static SfxPoolItem* CreateDefault();
50 SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
51 SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
52 SvxLongLRSpaceItem();
54 long GetLeft() const { return mlLeft;}
55 long GetRight() const { return mlRight;}
56 void SetLeft(long lArgLeft);
57 void SetRight(long lArgRight);
60 class SVX_DLLPUBLIC SvxLongULSpaceItem : public SfxPoolItem
62 long mlLeft; // nLeft or the negative first-line indentation
63 long mlRight; // the unproblematic right edge
65 protected:
67 virtual bool operator==( const SfxPoolItem& ) const override;
68 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
69 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
71 virtual bool GetPresentation( SfxItemPresentation ePres,
72 MapUnit eCoreMetric,
73 MapUnit ePresMetric,
74 OUString &rText, const IntlWrapper * = nullptr ) const override;
76 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
78 private:
79 const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &) = delete;
81 public:
82 static SfxPoolItem* CreateDefault();
83 SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
84 SvxLongULSpaceItem(const SvxLongULSpaceItem &);
85 SvxLongULSpaceItem();
87 long GetUpper() const { return mlLeft;}
88 long GetLower() const { return mlRight;}
89 void SetUpper(long lArgLeft);
90 void SetLower(long lArgRight);
93 class SVX_DLLPUBLIC SvxPagePosSizeItem : public SfxPoolItem
95 Point aPos;
96 long lWidth;
97 long lHeight;
98 protected:
99 virtual bool operator==( const SfxPoolItem& ) const override;
100 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
101 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
103 virtual bool GetPresentation( SfxItemPresentation ePres,
104 MapUnit eCoreMetric,
105 MapUnit ePresMetric,
106 OUString &rText, const IntlWrapper * = nullptr ) const override;
108 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
110 private:
111 const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &) = delete;
112 public:
113 static SfxPoolItem* CreateDefault();
114 SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
115 SvxPagePosSizeItem(const SvxPagePosSizeItem &);
116 SvxPagePosSizeItem();
118 const Point &GetPos() const { return aPos; }
119 long GetWidth() const { return lWidth; }
120 long GetHeight() const { return lHeight; }
123 struct SVX_DLLPUBLIC SvxColumnDescription
125 long nStart; /* Start of the column */
126 long nEnd; /* End of the column */
127 bool bVisible; /* Visibility */
129 long nEndMin; //min. possible position of end
130 long nEndMax; //max. possible position of end
132 SvxColumnDescription();
134 SvxColumnDescription(const SvxColumnDescription &rCopy);
136 SvxColumnDescription(long start, long end, bool bVis);
138 SvxColumnDescription(long start, long end,
139 long endMin, long endMax, bool bVis);
141 bool operator==(const SvxColumnDescription &rCmp) const;
142 bool operator!=(const SvxColumnDescription &rCmp) const;
143 long GetWidth() const;
146 template<typename charT, typename traits>
147 inline std::basic_ostream<charT, traits> & operator <<(
148 std::basic_ostream<charT, traits> & stream, SvxColumnDescription const& dsc)
150 return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd
151 << " bVisible " << dsc.bVisible << " nEndMin " << dsc.nEndMin
152 << " nEndMax " << dsc.nEndMax << " }";
156 class SVX_DLLPUBLIC SvxColumnItem : public SfxPoolItem
158 typedef std::vector<SvxColumnDescription> SvxColumnDescriptionVector;
159 SvxColumnDescriptionVector aColumns; // Column array
161 long nLeft; // Left edge for the table
162 long nRight; // Right edge for the table; for columns always
163 // equal to the surrounding frame
164 sal_uInt16 nActColumn; // the current column
165 bool bTable; // table?
166 bool bOrtho; // evenly spread columns
168 protected:
169 virtual bool operator==( const SfxPoolItem& ) const override;
171 virtual bool GetPresentation( SfxItemPresentation ePres,
172 MapUnit eCoreMetric,
173 MapUnit ePresMetric,
174 OUString &rText,
175 const IntlWrapper * = nullptr ) const override;
177 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
178 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
179 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
181 public:
182 static SfxPoolItem* CreateDefault();
183 // right edge of the surrounding frame
184 // nLeft, nRight each the distance to the surrounding frame
185 SvxColumnItem(sal_uInt16 nAct = 0);
186 SvxColumnItem(sal_uInt16 nActCol, sal_uInt16 nLeft, sal_uInt16 nRight); // Table with borders
187 SvxColumnItem(const SvxColumnItem& aItem);
188 virtual ~SvxColumnItem() override;
190 SvxColumnItem &operator=(const SvxColumnItem &);
192 SvxColumnDescription& operator[](sal_uInt16 index);
193 const SvxColumnDescription& operator[](sal_uInt16 index) const;
194 SvxColumnDescription& At(sal_uInt16 index);
195 SvxColumnDescription& GetActiveColumnDescription();
197 sal_uInt16 Count() const;
198 void Append(const SvxColumnDescription& rDesc);
199 void SetLeft(long aLeft);
200 void SetRight(long aRight);
201 sal_uInt16 GetActColumn() const { return nActColumn;}
202 bool IsFirstAct() const;
203 bool IsLastAct() const;
204 long GetLeft() { return nLeft;}
205 long GetRight() { return nRight;}
206 bool IsTable() const { return bTable;}
207 bool CalcOrtho() const;
208 void SetOrtho(bool bVal);
209 bool IsConsistent() const;
212 // class SvxObjectItem ---------------------------------------------------
214 class SVX_DLLPUBLIC SvxObjectItem : public SfxPoolItem
216 private:
217 long nStartX; /* Start in x direction */
218 long nEndX; /* End in x direction */
219 long nStartY; /* Start in y direction */
220 long nEndY; /* Ende in y direction */
221 bool bLimits; /* boundary limit control by the application */
223 protected:
224 virtual bool operator==( const SfxPoolItem& ) const override;
226 virtual bool GetPresentation( SfxItemPresentation ePres,
227 MapUnit eCoreMetric,
228 MapUnit ePresMetric,
229 OUString &rText, const IntlWrapper * = nullptr ) const override;
231 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
232 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
233 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
235 private:
236 const SvxObjectItem &operator=(const SvxObjectItem &) = delete;
238 public:
239 static SfxPoolItem* CreateDefault();
240 SvxObjectItem(long nStartX, long nEndX,
241 long nStartY, long nEndY);
242 SvxObjectItem(const SvxObjectItem& rCopy);
244 bool HasLimits() const { return bLimits;}
246 long GetStartX() const { return nStartX;}
247 long GetEndX() const { return nEndX;}
248 long GetStartY() const { return nStartY;}
249 long GetEndY() const { return nEndY;}
251 void SetStartX(long lValue);
252 void SetEndX(long lValue);
253 void SetStartY(long lValue);
254 void SetEndY(long lValue);
258 #endif
260 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */