merged tag ooo/OOO330_m14
[LibreOffice.git] / sw / inc / tabcol.hxx
blobfed5ab748b6f719b54634985775bf80106bc678c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _TABCOL_HXX
28 #define _TABCOL_HXX
30 #ifndef _SVSTDARR_HXX
31 #define _SVSTDARR_LONGS
32 #define _SVSTDARR_BOOLS
33 #include <svl/svstdarr.hxx>
34 #endif
36 #ifndef INCLUDED_VECTOR
37 #include <vector>
38 #define INCLUDED_VECTOR
39 #endif
40 #include "swdllapi.h"
42 struct SwTabColsEntry
44 long nPos;
45 long nMin;
46 long nMax;
47 BOOL bHidden; //Fuer jeden Eintrag ein Flag, Hidden oder nicht.
48 //Wenn das Flag Hidden TRUE ist liegt der Spalten-
49 //trenner nicht in der aktuellen Zeile; er muss
50 //mit gepflegt werden, darf aber nicht angezeigt
51 //werden.
54 typedef std::vector< SwTabColsEntry > SwTabColsEntries;
56 class SW_DLLPUBLIC SwTabCols
58 long nLeftMin, //Linker aeusserer Rand (Bezugspunkt) in
59 //Dokumentkordinaten.
60 //Alle anderen Werte relativ zu diesem Punkt!
61 nLeft, //Linker Rand der Tabelle.
62 nRight, //Rechter Rand der Tabelle.
63 nRightMax; //Maximaler rechter Rand der Tabelle.
65 bool bLastRowAllowedToChange; // if the last row of the table frame
66 // is split across pages, it may not
67 // change its size
69 SwTabColsEntries aData;
71 //fuer den CopyCTor
72 const SwTabColsEntries& GetData() const { return aData; }
74 public:
75 SwTabCols( USHORT nSize = 0 );
76 SwTabCols( const SwTabCols& );
77 SwTabCols &operator=( const SwTabCols& );
78 BOOL operator==( const SwTabCols& rCmp ) const;
79 long& operator[]( USHORT nPos ) { return aData[nPos].nPos; }
80 long operator[]( USHORT nPos ) const { return aData[nPos].nPos; }
81 USHORT Count() const { return sal::static_int_cast< USHORT >(aData.size()); }
83 BOOL IsHidden( USHORT nPos ) const { return aData[nPos].bHidden; }
84 void SetHidden( USHORT nPos, BOOL bValue ) { aData[nPos].bHidden = bValue; }
86 void Insert( long nValue, BOOL bValue, USHORT nPos );
87 void Insert( long nValue, long nMin, long nMax, BOOL bValue, USHORT nPos );
88 void Remove( USHORT nPos, USHORT nAnz = 1 );
90 const SwTabColsEntry& GetEntry( USHORT nPos ) const { return aData[nPos]; }
91 SwTabColsEntry& GetEntry( USHORT nPos ) { return aData[nPos]; }
93 long GetLeftMin() const { return nLeftMin; }
94 long GetLeft() const { return nLeft; }
95 long GetRight() const { return nRight; }
96 long GetRightMax()const { return nRightMax;}
98 void SetLeftMin ( long nNew ) { nLeftMin = nNew; }
99 void SetLeft ( long nNew ) { nLeft = nNew; }
100 void SetRight ( long nNew ) { nRight = nNew; }
101 void SetRightMax( long nNew ) { nRightMax = nNew;}
103 bool IsLastRowAllowedToChange() const { return bLastRowAllowedToChange; }
104 void SetLastRowAllowedToChange( bool bNew ) { bLastRowAllowedToChange = bNew; }
107 #endif //_TABCOL_HXX