xref: /AOO41X/main/sw/inc/tabcol.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _TABCOL_HXX
24cdf0e10cSrcweir #define _TABCOL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _SVSTDARR_HXX
27cdf0e10cSrcweir #define _SVSTDARR_LONGS
28cdf0e10cSrcweir #define _SVSTDARR_BOOLS
29cdf0e10cSrcweir #include <svl/svstdarr.hxx>
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #ifndef INCLUDED_VECTOR
33cdf0e10cSrcweir #include <vector>
34cdf0e10cSrcweir #define INCLUDED_VECTOR
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #include "swdllapi.h"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir struct SwTabColsEntry
39cdf0e10cSrcweir {
40cdf0e10cSrcweir     long    nPos;
41cdf0e10cSrcweir     long    nMin;
42cdf0e10cSrcweir     long    nMax;
43cdf0e10cSrcweir     sal_Bool    bHidden;    //Fuer jeden Eintrag ein Flag, Hidden oder nicht.
44cdf0e10cSrcweir                         //Wenn das Flag Hidden sal_True ist liegt der Spalten-
45cdf0e10cSrcweir                         //trenner nicht in der aktuellen Zeile; er muss
46cdf0e10cSrcweir                         //mit gepflegt werden, darf aber nicht angezeigt
47cdf0e10cSrcweir                         //werden.
48cdf0e10cSrcweir };
49cdf0e10cSrcweir 
50cdf0e10cSrcweir typedef std::vector< SwTabColsEntry > SwTabColsEntries;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir class SW_DLLPUBLIC SwTabCols
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	long nLeftMin,		//Linker aeusserer Rand (Bezugspunkt) in
55cdf0e10cSrcweir 						//Dokumentkordinaten.
56cdf0e10cSrcweir 						//Alle anderen Werte relativ zu diesem Punkt!
57cdf0e10cSrcweir 			nLeft,		//Linker Rand der Tabelle.
58cdf0e10cSrcweir 		   nRight,		//Rechter Rand der Tabelle.
59cdf0e10cSrcweir 		   nRightMax;	//Maximaler rechter Rand der Tabelle.
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     bool bLastRowAllowedToChange;       // if the last row of the table frame
62cdf0e10cSrcweir                                         // is split across pages, it may not
63cdf0e10cSrcweir                                         // change its size
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     SwTabColsEntries aData;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     //fuer den CopyCTor
GetData() const68cdf0e10cSrcweir     const SwTabColsEntries& GetData() const { return aData; }
69cdf0e10cSrcweir 
70cdf0e10cSrcweir public:
71cdf0e10cSrcweir 	SwTabCols( sal_uInt16 nSize = 0 );
72cdf0e10cSrcweir 	SwTabCols( const SwTabCols& );
73cdf0e10cSrcweir 	SwTabCols &operator=( const SwTabCols& );
74cdf0e10cSrcweir 	sal_Bool operator==( const SwTabCols& rCmp ) const;
operator [](sal_uInt16 nPos)75cdf0e10cSrcweir     long& operator[]( sal_uInt16 nPos ) { return aData[nPos].nPos; }
operator [](sal_uInt16 nPos) const76cdf0e10cSrcweir     long operator[]( sal_uInt16 nPos ) const { return aData[nPos].nPos; }
Count() const77cdf0e10cSrcweir     sal_uInt16 Count() const { return sal::static_int_cast< sal_uInt16 >(aData.size()); }
78cdf0e10cSrcweir 
IsHidden(sal_uInt16 nPos) const79cdf0e10cSrcweir     sal_Bool IsHidden( sal_uInt16 nPos ) const         { return aData[nPos].bHidden; }
SetHidden(sal_uInt16 nPos,sal_Bool bValue)80cdf0e10cSrcweir     void SetHidden( sal_uInt16 nPos, sal_Bool bValue ) { aData[nPos].bHidden = bValue; }
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     void Insert( long nValue, sal_Bool bValue, sal_uInt16 nPos );
83cdf0e10cSrcweir     void Insert( long nValue, long nMin, long nMax, sal_Bool bValue, sal_uInt16 nPos );
84cdf0e10cSrcweir     void Remove( sal_uInt16 nPos, sal_uInt16 nAnz = 1 );
85cdf0e10cSrcweir 
GetEntry(sal_uInt16 nPos) const86cdf0e10cSrcweir     const SwTabColsEntry& GetEntry( sal_uInt16 nPos ) const { return aData[nPos]; }
GetEntry(sal_uInt16 nPos)87cdf0e10cSrcweir           SwTabColsEntry& GetEntry( sal_uInt16 nPos )  { return aData[nPos]; }
88cdf0e10cSrcweir 
GetLeftMin() const89cdf0e10cSrcweir 	long GetLeftMin() const { return nLeftMin; }
GetLeft() const90cdf0e10cSrcweir 	long GetLeft()	const { return nLeft;	 }
GetRight() const91cdf0e10cSrcweir 	long GetRight()	const { return nRight;	 }
GetRightMax() const92cdf0e10cSrcweir 	long GetRightMax()const { return nRightMax;}
93cdf0e10cSrcweir 
SetLeftMin(long nNew)94cdf0e10cSrcweir 	void SetLeftMin ( long nNew )	{ nLeftMin = nNew; }
SetLeft(long nNew)95cdf0e10cSrcweir 	void SetLeft	( long nNew )	{ nLeft = nNew;	   }
SetRight(long nNew)96cdf0e10cSrcweir 	void SetRight	( long nNew )	{ nRight = nNew;   }
SetRightMax(long nNew)97cdf0e10cSrcweir 	void SetRightMax( long nNew )	{ nRightMax = nNew;}
98cdf0e10cSrcweir 
IsLastRowAllowedToChange() const99cdf0e10cSrcweir     bool IsLastRowAllowedToChange() const { return bLastRowAllowedToChange; }
SetLastRowAllowedToChange(bool bNew)100cdf0e10cSrcweir     void SetLastRowAllowedToChange( bool bNew ) { bLastRowAllowedToChange = bNew; }
101cdf0e10cSrcweir };
102cdf0e10cSrcweir 
103cdf0e10cSrcweir #endif	//_TABCOL_HXX
104