Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / rulritem.hxx
blob6e255af9e5b9a034a765653f633adf236d794a8b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rulritem.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_RULRITEM_HXX
31 #define _SVX_RULRITEM_HXX
33 // include ---------------------------------------------------------------
35 #ifndef _GEN_HXX //autogen
36 #include <tools/gen.hxx>
37 #endif
38 #ifndef _SFXPOOLITEM_HXX //autogen
39 #include <bf_svtools/poolitem.hxx>
40 #endif
41 namespace binfilter {
43 // class SvxLongLRSpaceItem ----------------------------------------------
45 class SvxLongLRSpaceItem : public SfxPoolItem
47 long lLeft; // nLeft oder der neg. Erstzeileneinzug
48 long lRight; // der unproblematische rechte Rand
50 protected:
52 virtual int operator==( const SfxPoolItem& ) const;
55 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
57 private:
58 const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &); // n.i.
60 public:
61 TYPEINFO();
62 SvxLongLRSpaceItem(long lLeft, long lRight, USHORT nId);
63 SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
65 long GetLeft() const { return lLeft; }
66 long GetRight() const { return lRight; }
67 void SetLeft(long lArgLeft) {lLeft=lArgLeft;}
68 void SetRight(long lArgRight) {lRight=lArgRight;}
71 // class SvxLongULSpaceItem ----------------------------------------------
73 class SvxLongULSpaceItem : public SfxPoolItem
75 long lLeft; // nLeft oder der neg. Erstzeileneinzug
76 long lRight; // der unproblematische rechte Rand
78 protected:
80 virtual int operator==( const SfxPoolItem& ) const;
83 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
85 private:
86 const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &); // n.i.
88 public:
89 TYPEINFO();
90 SvxLongULSpaceItem(long lUpper, long lLower, USHORT nId);
91 SvxLongULSpaceItem(const SvxLongULSpaceItem &);
93 long GetUpper() const { return lLeft; }
94 long GetLower() const { return lRight; }
95 void SetUpper(long lArgLeft) {lLeft=lArgLeft;}
96 void SetLower(long lArgRight) {lRight=lArgRight;}
99 // class SvxPagePosSizeItem ----------------------------------------------
101 class SvxPagePosSizeItem : public SfxPoolItem
103 Point aPos;
104 long lWidth;
105 long lHeight;
106 protected:
107 virtual int operator==( const SfxPoolItem& ) const;
110 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
112 private:
113 const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &); // n.i.
114 public:
115 TYPEINFO();
116 SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
117 SvxPagePosSizeItem(const SvxPagePosSizeItem &);
119 const Point &GetPos() const { return aPos; }
120 long GetWidth() const { return lWidth; }
121 long GetHeight() const { return lHeight; }
124 // struct SvxColumnDescription -------------------------------------------
126 struct SvxColumnDescription
128 USHORT nStart; /* Spaltenbeginn */
129 USHORT nEnd; /* Spaltenende */
130 BOOL bVisible; /* Sichtbarkeit */
131 SvxColumnDescription():
132 nStart(0), nEnd(0), bVisible(TRUE) {}
133 SvxColumnDescription(const SvxColumnDescription &rCopy) :
134 nStart(rCopy.nStart), nEnd(rCopy.nEnd), bVisible(rCopy.bVisible) {}
135 SvxColumnDescription(USHORT start, USHORT end, BOOL bVis = TRUE):
136 nStart(start), nEnd(end), bVisible(bVis) {}
137 int operator==(const SvxColumnDescription &rCmp) const {
138 return nStart == rCmp.nStart &&
139 bVisible == rCmp.bVisible &&
140 nEnd == rCmp.nEnd;
142 int operator!=(const SvxColumnDescription &rCmp) const {
143 return !operator==(rCmp);
145 USHORT GetWidth() const { return nEnd - nStart; }
148 // class SvxColumnItem ---------------------------------------------------
150 typedef SvPtrarr SvxColumns;
152 class SvxColumnItem : public SfxPoolItem
154 SvxColumns aColumns;// Spaltenarray
155 long nLeft, // Linker Rand bei Tabelle
156 nRight; // Rechter Rand bei Tabelle; bei Spalten immer gleich
157 // zum umgebenden Rahmen
158 USHORT nActColumn; // die aktuelle Spalte
159 BOOL bTable; // Tabelle?
160 BOOL bOrtho; // Gleichverteilte Spalten
162 void DeleteAndDestroyColumns();
164 protected:
165 virtual int operator==( const SfxPoolItem& ) const;
168 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
169 public:
170 TYPEINFO();
171 // rechter Rand des umgebenden Rahmens
172 // nLeft, nRight jeweils der Abstand zum umgebenden Rahmen
173 SvxColumnItem(USHORT nAct = 0); // Spalten
174 SvxColumnItem(const SvxColumnItem &);
175 ~SvxColumnItem();
178 USHORT Count() const { return aColumns.Count(); }
179 SvxColumnDescription &operator[](USHORT i)
180 { return *(SvxColumnDescription*)aColumns[i]; }
181 const SvxColumnDescription &operator[](USHORT i) const
182 { return *(SvxColumnDescription*)aColumns[i]; }
183 void Insert(const SvxColumnDescription &rDesc, USHORT nPos) {
184 SvxColumnDescription* pDesc = new SvxColumnDescription(rDesc);
185 aColumns.Insert(pDesc, nPos);
187 void Append(const SvxColumnDescription &rDesc) { Insert(rDesc, Count()); }
188 void SetLeft(long left) { nLeft = left; }
189 void SetRight(long right) { nRight = right; }
190 void SetActColumn(USHORT nCol) { nActColumn = nCol; }
192 USHORT GetActColumn() const { return nActColumn; }
193 BOOL IsFirstAct() const { return nActColumn == 0; }
194 BOOL IsLastAct() const { return nActColumn == Count()-1; }
195 long GetLeft() { return nLeft; }
196 long GetRight() { return nRight; }
198 BOOL IsTable() const { return bTable; }
200 void SetOrtho(BOOL bVal) { bOrtho = bVal; }
201 BOOL IsOrtho () const { return FALSE ; }
203 BOOL IsConsistent() const { return nActColumn < aColumns.Count(); }
206 // class SvxObjectItem ---------------------------------------------------
208 class SvxObjectItem : public SfxPoolItem
210 private:
211 long nStartX; /* Beginn in X-Richtung */
212 long nEndX; /* Ende in X-Richtung */
213 long nStartY; /* Beginn in Y-Richtung */
214 long nEndY; /* Ende in Y-Richtung */
215 BOOL bLimits; /* Grenzwertkontrolle durch die Applikation */
216 protected:
219 private:
220 public:
221 TYPEINFO();
222 SvxObjectItem(long nStartX, long nEndX,
223 long nStartY, long nEndY,
224 BOOL bLimits = FALSE);
230 }//end of namespace binfilter
231 #endif