Branch libreoffice-5-0-4
[LibreOffice.git] / include / svx / rulritem.hxx
blob2204de11acefee7436a22524bd7b3f73e0636e0b
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 SAL_OVERRIDE;
35 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
36 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
38 virtual bool GetPresentation( SfxItemPresentation ePres,
39 SfxMapUnit eCoreMetric,
40 SfxMapUnit ePresMetric,
41 OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
43 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
45 private:
46 const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &) SAL_DELETED_FUNCTION;
48 public:
49 TYPEINFO_OVERRIDE();
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 SAL_OVERRIDE;
68 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
69 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
71 virtual bool GetPresentation( SfxItemPresentation ePres,
72 SfxMapUnit eCoreMetric,
73 SfxMapUnit ePresMetric,
74 OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
76 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
78 private:
79 const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &) SAL_DELETED_FUNCTION;
81 public:
82 TYPEINFO_OVERRIDE();
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 SAL_OVERRIDE;
100 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
101 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
103 virtual bool GetPresentation( SfxItemPresentation ePres,
104 SfxMapUnit eCoreMetric,
105 SfxMapUnit ePresMetric,
106 OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
108 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
110 private:
111 const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &) SAL_DELETED_FUNCTION;
112 public:
113 TYPEINFO_OVERRIDE();
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 = true);
138 SvxColumnDescription(long start, long end,
139 long endMin, long endMax, bool bVis = true);
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 SAL_OVERRIDE;
171 virtual bool GetPresentation( SfxItemPresentation ePres,
172 SfxMapUnit eCoreMetric,
173 SfxMapUnit ePresMetric,
174 OUString &rText,
175 const IntlWrapper * = 0 ) const SAL_OVERRIDE;
177 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
178 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
179 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
181 public:
182 TYPEINFO_OVERRIDE();
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 = 0); // Table with borders
187 SvxColumnItem(const SvxColumnItem& aItem);
188 virtual ~SvxColumnItem();
190 const 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 Insert(const SvxColumnDescription& rDesc, sal_uInt16 nPos);
199 void Append(const SvxColumnDescription& rDesc);
200 void SetLeft(long aLeft);
201 void SetRight(long aRight);
202 sal_uInt16 GetActColumn() const { return nActColumn;}
203 bool IsFirstAct() const;
204 bool IsLastAct() const;
205 long GetLeft() { return nLeft;}
206 long GetRight() { return nRight;}
207 bool IsTable() const { return bTable;}
208 bool CalcOrtho() const;
209 void SetOrtho(bool bVal);
210 bool IsConsistent() const;
213 // class SvxObjectItem ---------------------------------------------------
215 class SVX_DLLPUBLIC SvxObjectItem : public SfxPoolItem
217 private:
218 long nStartX; /* Start in x direction */
219 long nEndX; /* End in x direction */
220 long nStartY; /* Start in y direction */
221 long nEndY; /* Ende in y direction */
222 bool bLimits; /* boundary limit control by the application */
224 protected:
225 virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
227 virtual bool GetPresentation( SfxItemPresentation ePres,
228 SfxMapUnit eCoreMetric,
229 SfxMapUnit ePresMetric,
230 OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
232 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
233 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
234 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
236 private:
237 const SvxObjectItem &operator=(const SvxObjectItem &) SAL_DELETED_FUNCTION;
239 public:
240 TYPEINFO_OVERRIDE();
241 SvxObjectItem(long nStartX, long nEndX,
242 long nStartY, long nEndY,
243 bool bLimits = false);
244 SvxObjectItem(const SvxObjectItem& rCopy);
246 bool HasLimits() const { return bLimits;}
248 long GetStartX() const { return nStartX;}
249 long GetEndX() const { return nEndX;}
250 long GetStartY() const { return nStartY;}
251 long GetEndY() const { return nEndY;}
253 void SetStartX(long lValue);
254 void SetEndX(long lValue);
255 void SetStartY(long lValue);
256 void SetEndY(long lValue);
260 #endif
262 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */