1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rulritem.hxx,v $
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>
38 #ifndef _SFXPOOLITEM_HXX //autogen
39 #include <bf_svtools/poolitem.hxx>
43 // class SvxLongLRSpaceItem ----------------------------------------------
45 class SvxLongLRSpaceItem
: public SfxPoolItem
47 long lLeft
; // nLeft oder der neg. Erstzeileneinzug
48 long lRight
; // der unproblematische rechte Rand
52 virtual int operator==( const SfxPoolItem
& ) const;
55 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
58 const SvxLongLRSpaceItem
& operator=(const SvxLongLRSpaceItem
&); // n.i.
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
80 virtual int operator==( const SfxPoolItem
& ) const;
83 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
86 const SvxLongULSpaceItem
& operator=(const SvxLongULSpaceItem
&); // n.i.
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
107 virtual int operator==( const SfxPoolItem
& ) const;
110 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
113 const SvxPagePosSizeItem
& operator=(const SvxPagePosSizeItem
&); // n.i.
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
&&
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();
165 virtual int operator==( const SfxPoolItem
& ) const;
168 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
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
&);
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
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 */
222 SvxObjectItem(long nStartX
, long nEndX
,
223 long nStartY
, long nEndY
,
224 BOOL bLimits
= FALSE
);
230 }//end of namespace binfilter