update credits
[LibreOffice.git] / include / svx / rulritem.hxx
blob545edb4cda85b7caac1f8d3c61b165126f352f3f
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 _SVX_RULRITEM_HXX
20 #define _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 lLeft; // nLeft or the negativ first-line indentation
30 long lRight; // the unproblematic right edge
32 protected:
34 virtual int operator==( const SfxPoolItem& ) const;
35 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
36 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
38 virtual String GetValueText() const;
39 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
40 SfxMapUnit eCoreMetric,
41 SfxMapUnit ePresMetric,
42 OUString &rText, const IntlWrapper * = 0 ) const;
44 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
46 private:
47 SVX_DLLPRIVATE const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &); // n.i.
49 public:
50 TYPEINFO();
51 SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
52 SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
53 SvxLongLRSpaceItem();
55 long GetLeft() const { return lLeft; }
56 long GetRight() const { return lRight; }
57 void SetLeft(long lArgLeft) {lLeft=lArgLeft;}
58 void SetRight(long lArgRight) {lRight=lArgRight;}
61 class SVX_DLLPUBLIC SvxLongULSpaceItem : public SfxPoolItem
63 long lLeft; // nLeft or the negative first-line indentation
64 long lRight; // the unproblematic right edge
66 protected:
68 virtual int operator==( const SfxPoolItem& ) const;
69 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
70 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
72 virtual String GetValueText() const;
73 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
74 SfxMapUnit eCoreMetric,
75 SfxMapUnit ePresMetric,
76 OUString &rText, const IntlWrapper * = 0 ) const;
78 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
80 private:
81 SVX_DLLPRIVATE const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &); // n.i.
83 public:
84 TYPEINFO();
85 SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
86 SvxLongULSpaceItem(const SvxLongULSpaceItem &);
87 SvxLongULSpaceItem();
89 long GetUpper() const { return lLeft; }
90 long GetLower() const { return lRight; }
91 void SetUpper(long lArgLeft) {lLeft=lArgLeft;}
92 void SetLower(long lArgRight) {lRight=lArgRight;}
95 class SVX_DLLPUBLIC SvxPagePosSizeItem : public SfxPoolItem
97 Point aPos;
98 long lWidth;
99 long lHeight;
100 protected:
101 virtual int operator==( const SfxPoolItem& ) const;
102 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
103 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
105 virtual String GetValueText() const;
106 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
107 SfxMapUnit eCoreMetric,
108 SfxMapUnit ePresMetric,
109 OUString &rText, const IntlWrapper * = 0 ) const;
111 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
113 private:
114 SVX_DLLPRIVATE const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &); // n.i.
115 public:
116 TYPEINFO();
117 SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
118 SvxPagePosSizeItem(const SvxPagePosSizeItem &);
119 SvxPagePosSizeItem();
121 const Point &GetPos() const { return aPos; }
122 long GetWidth() const { return lWidth; }
123 long GetHeight() const { return lHeight; }
126 struct SvxColumnDescription
128 long nStart; /* Start of the column */
129 long nEnd; /* End of the column */
130 sal_Bool bVisible; /* Visibility */
132 long nEndMin; //min. possible position of end
133 long nEndMax; //max. possible position of end
135 SvxColumnDescription():
136 nStart(0), nEnd(0), bVisible(sal_True), nEndMin(0), nEndMax(0) {}
138 SvxColumnDescription(const SvxColumnDescription &rCopy) :
139 nStart(rCopy.nStart), nEnd(rCopy.nEnd),
140 bVisible(rCopy.bVisible),
141 nEndMin(rCopy.nEndMin), nEndMax(rCopy.nEndMax)
144 SvxColumnDescription(long start, long end, sal_Bool bVis = sal_True):
145 nStart(start), nEnd(end),
146 bVisible(bVis),
147 nEndMin(0), nEndMax(0) {}
149 SvxColumnDescription(long start, long end,
150 long endMin, long endMax, sal_Bool bVis = sal_True):
151 nStart(start), nEnd(end),
152 bVisible(bVis),
153 nEndMin(endMin), nEndMax(endMax)
156 int operator==(const SvxColumnDescription &rCmp) const {
157 return nStart == rCmp.nStart &&
158 bVisible == rCmp.bVisible &&
159 nEnd == rCmp.nEnd &&
160 nEndMin == rCmp.nEndMin &&
161 nEndMax == rCmp.nEndMax;
163 int operator!=(const SvxColumnDescription &rCmp) const {
164 return !operator==(rCmp);
166 long GetWidth() const { return nEnd - nStart; }
169 class SVX_DLLPUBLIC SvxColumnItem : public SfxPoolItem
171 std::vector<SvxColumnDescription> aColumns;// Column array
172 long nLeft, // Left edge for the table
173 nRight; // Right edge for the table; for columns always
174 // equal to the surrounding frame
175 sal_uInt16 nActColumn; // the current column
176 sal_uInt8 bTable; // table?
177 sal_uInt8 bOrtho; // evenly spread columns
179 protected:
180 virtual int operator==( const SfxPoolItem& ) const;
182 virtual String GetValueText() const;
183 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
184 SfxMapUnit eCoreMetric,
185 SfxMapUnit ePresMetric,
186 OUString &rText, const IntlWrapper * = 0 ) const;
188 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
189 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
190 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
191 public:
192 TYPEINFO();
193 // right edge of the surrounding frame
194 // nLeft, nRight each the distance to the surrounding frame
195 SvxColumnItem(sal_uInt16 nAct = 0); // columns
196 SvxColumnItem(sal_uInt16 nActCol,
197 sal_uInt16 nLeft, sal_uInt16 nRight = 0); // Table with borders
198 SvxColumnItem(const SvxColumnItem &);
199 ~SvxColumnItem();
201 const SvxColumnItem &operator=(const SvxColumnItem &);
203 sal_uInt16 Count() const { return aColumns.size(); }
204 SvxColumnDescription &operator[](sal_uInt16 i)
205 { return aColumns[i]; }
206 const SvxColumnDescription &operator[](sal_uInt16 i) const
207 { return aColumns[i]; }
208 void Insert(const SvxColumnDescription &rDesc, sal_uInt16 nPos) {
209 aColumns.insert(aColumns.begin() + nPos, rDesc);
211 void Append(const SvxColumnDescription &rDesc) { Insert(rDesc, Count()); }
212 void SetLeft(long left) { nLeft = left; }
213 void SetRight(long right) { nRight = right; }
214 void SetActColumn(sal_uInt16 nCol) { nActColumn = nCol; }
216 sal_uInt16 GetActColumn() const { return nActColumn; }
217 sal_Bool IsFirstAct() const { return nActColumn == 0; }
218 sal_Bool IsLastAct() const { return nActColumn == Count()-1; }
219 long GetLeft() { return nLeft; }
220 long GetRight() { return nRight; }
222 sal_Bool IsTable() const { return bTable; }
224 sal_Bool CalcOrtho() const;
225 void SetOrtho(sal_Bool bVal) { bOrtho = bVal; }
226 sal_Bool IsOrtho () const { return sal_False ; }
228 sal_Bool IsConsistent() const { return nActColumn < aColumns.size(); }
231 // class SvxObjectItem ---------------------------------------------------
233 class SVX_DLLPUBLIC SvxObjectItem : public SfxPoolItem
235 private:
236 long nStartX; /* Start in x direction */
237 long nEndX; /* End in x direction */
238 long nStartY; /* Start in y direction */
239 long nEndY; /* Ende in y direction */
240 sal_Bool bLimits; /* boundary limit control by the application */
241 protected:
242 virtual int operator==( const SfxPoolItem& ) const;
244 virtual String GetValueText() const;
245 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
246 SfxMapUnit eCoreMetric,
247 SfxMapUnit ePresMetric,
248 OUString &rText, const IntlWrapper * = 0 ) const;
250 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
251 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
252 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
253 private:
254 SVX_DLLPRIVATE const SvxObjectItem &operator=(const SvxObjectItem &); // n.i.
255 public:
256 TYPEINFO();
257 SvxObjectItem(long nStartX, long nEndX,
258 long nStartY, long nEndY,
259 sal_Bool bLimits = sal_False);
260 SvxObjectItem(const SvxObjectItem &);
262 sal_Bool HasLimits() const { return bLimits; }
264 long GetStartX() const { return nStartX; }
265 long GetEndX() const { return nEndX; }
266 long GetStartY() const { return nStartY; }
267 long GetEndY() const { return nEndY; }
269 void SetStartX(long l) { nStartX = l; }
270 void SetEndX(long l) { nEndX = l; }
271 void SetStartY(long l) { nStartY = l; }
272 void SetEndY(long l) { nEndY = l; }
276 #endif
278 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */