Update ooo320-m1
[ooovba.git] / sw / inc / tabcol.hxx
blob97a1215aa58d1b43824abe88e95d155a01612d11
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: tabcol.hxx,v $
10 * $Revision: 1.6 $
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 _TABCOL_HXX
31 #define _TABCOL_HXX
33 #ifndef _SVSTDARR_HXX
34 #define _SVSTDARR_LONGS
35 #define _SVSTDARR_BOOLS
36 #include <svtools/svstdarr.hxx>
37 #endif
39 #ifndef INCLUDED_VECTOR
40 #include <vector>
41 #define INCLUDED_VECTOR
42 #endif
43 #include "swdllapi.h"
45 struct SwTabColsEntry
47 long nPos;
48 long nMin;
49 long nMax;
50 BOOL bHidden; //Fuer jeden Eintrag ein Flag, Hidden oder nicht.
51 //Wenn das Flag Hidden TRUE ist liegt der Spalten-
52 //trenner nicht in der aktuellen Zeile; er muss
53 //mit gepflegt werden, darf aber nicht angezeigt
54 //werden.
57 typedef std::vector< SwTabColsEntry > SwTabColsEntries;
59 class SW_DLLPUBLIC SwTabCols
61 long nLeftMin, //Linker aeusserer Rand (Bezugspunkt) in
62 //Dokumentkordinaten.
63 //Alle anderen Werte relativ zu diesem Punkt!
64 nLeft, //Linker Rand der Tabelle.
65 nRight, //Rechter Rand der Tabelle.
66 nRightMax; //Maximaler rechter Rand der Tabelle.
68 bool bLastRowAllowedToChange; // if the last row of the table frame
69 // is split across pages, it may not
70 // change its size
72 SwTabColsEntries aData;
74 //fuer den CopyCTor
75 const SwTabColsEntries& GetData() const { return aData; }
77 public:
78 SwTabCols( USHORT nSize = 0 );
79 SwTabCols( const SwTabCols& );
80 SwTabCols &operator=( const SwTabCols& );
81 BOOL operator==( const SwTabCols& rCmp ) const;
82 long& operator[]( USHORT nPos ) { return aData[nPos].nPos; }
83 long operator[]( USHORT nPos ) const { return aData[nPos].nPos; }
84 USHORT Count() const { return sal::static_int_cast< USHORT >(aData.size()); }
86 BOOL IsHidden( USHORT nPos ) const { return aData[nPos].bHidden; }
87 void SetHidden( USHORT nPos, BOOL bValue ) { aData[nPos].bHidden = bValue; }
89 void Insert( long nValue, BOOL bValue, USHORT nPos );
90 void Insert( long nValue, long nMin, long nMax, BOOL bValue, USHORT nPos );
91 void Remove( USHORT nPos, USHORT nAnz = 1 );
93 const SwTabColsEntry& GetEntry( USHORT nPos ) const { return aData[nPos]; }
94 SwTabColsEntry& GetEntry( USHORT nPos ) { return aData[nPos]; }
96 long GetLeftMin() const { return nLeftMin; }
97 long GetLeft() const { return nLeft; }
98 long GetRight() const { return nRight; }
99 long GetRightMax()const { return nRightMax;}
101 void SetLeftMin ( long nNew ) { nLeftMin = nNew; }
102 void SetLeft ( long nNew ) { nLeft = nNew; }
103 void SetRight ( long nNew ) { nRight = nNew; }
104 void SetRightMax( long nNew ) { nRightMax = nNew;}
106 bool IsLastRowAllowedToChange() const { return bLastRowAllowedToChange; }
107 void SetLastRowAllowedToChange( bool bNew ) { bLastRowAllowedToChange = bNew; }
110 #endif //_TABCOL_HXX