merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_sc / olinetab.hxx
blob25fd614f83a58a8e45ff653282bd64a2837dbdac
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: olinetab.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 ************************************************************************/
31 #ifndef SC_OUTLINETAB_HXX
32 #define SC_OUTLINETAB_HXX
35 #ifndef SC_COLLECT_HXX
36 #include "collect.hxx"
37 #endif
38 class SvStream;
39 namespace binfilter {
42 #define SC_OL_MAXDEPTH 7
44 class ScMultipleReadHeader;
45 class ScMultipleWriteHeader;
48 class ScOutlineEntry : public DataObject
50 USHORT nStart;
51 USHORT nSize;
52 BOOL bHidden;
53 BOOL bVisible;
55 public:
56 ScOutlineEntry( USHORT nNewStart, USHORT nNewSize,
57 BOOL bNewHidden = FALSE );
58 ScOutlineEntry( const ScOutlineEntry& rEntry );
59 ScOutlineEntry( SvStream& rStream, ScMultipleReadHeader& rHdr );
61 void Store( SvStream& rStream, ScMultipleWriteHeader& rHdr );
62 virtual DataObject* Clone() const;
63 USHORT GetStart() const { return nStart; }
64 /*N*/ USHORT GetSize() const { return nSize; }
65 USHORT GetEnd() const { return nStart+nSize-1; }
66 BOOL IsHidden() const { return bHidden; } // Gruppe versteckt
67 /*N*/ void Move( short nDelta );
68 /*N*/ void SetSize( USHORT nNewSize );
69 /*N*/ void SetPosSize( USHORT nNewPos, USHORT nNewSize );
70 void SetVisible( BOOL bNewVisible );
74 class ScOutlineCollection : public SortedCollection
76 public:
77 ScOutlineCollection();
79 virtual short Compare(DataObject* pKey1, DataObject* pKey2) const;
84 class ScOutlineArray
86 friend class ScSubOutlineIterator;
88 private:
89 USHORT nDepth;
90 ScOutlineCollection aCollections[SC_OL_MAXDEPTH];
92 /*N*/ BOOL DecDepth();
93 void FindEntry( USHORT nSearchPos, USHORT& rFindLevel, USHORT& rFindIndex,
94 USHORT nMaxLevel = SC_OL_MAXDEPTH );
95 public:
96 ScOutlineArray();
97 ScOutlineArray( const ScOutlineArray& rArray );
99 USHORT GetDepth() const { return nDepth; }
102 BOOL Insert( USHORT nStartCol, USHORT nEndCol, BOOL& rSizeChanged,
103 BOOL bHidden = FALSE, BOOL bVisible = TRUE );
105 ScOutlineEntry* GetEntry( USHORT nLevel, USHORT nIndex ) const;
106 USHORT GetCount( USHORT nLevel ) const;
108 void SetVisibleBelow( USHORT nLevel, USHORT nEntry, BOOL bValue,
109 BOOL bSkipHidden = FALSE );
112 /*N*/ BOOL TestInsertSpace( USHORT nSize, USHORT nMaxVal ) const;
113 /*N*/ void InsertSpace( USHORT nStartPos, USHORT nSize );
114 /*N*/ BOOL DeleteSpace( USHORT nStartPos, USHORT nSize );
116 BOOL ManualAction( USHORT nStartPos, USHORT nEndPos,
117 BOOL bShow, BYTE* pHiddenFlags );
118 void Load( SvStream& rStream );
119 void Store( SvStream& rStream );
123 class ScOutlineTable
125 private:
126 ScOutlineArray aColOutline;
127 ScOutlineArray aRowOutline;
129 public:
130 ScOutlineTable();
131 ScOutlineTable( const ScOutlineTable& rOutline );
133 const ScOutlineArray* GetColArray() const { return &aColOutline; }
134 ScOutlineArray* GetColArray() { return &aColOutline; }
135 const ScOutlineArray* GetRowArray() const { return &aRowOutline; }
136 ScOutlineArray* GetRowArray() { return &aRowOutline; }
138 /*N*/ BOOL TestInsertCol( USHORT nSize );
139 /*N*/ void InsertCol( USHORT nStartCol, USHORT nSize );
140 /*N*/ BOOL DeleteCol( USHORT nStartCol, USHORT nSize ); // TRUE: Undo nur ueber Original
141 /*N*/ BOOL TestInsertRow( USHORT nSize );
142 /*N*/ void InsertRow( USHORT nStartRow, USHORT nSize );
143 /*N*/ BOOL DeleteRow( USHORT nStartRow, USHORT nSize );
144 void Load( SvStream& rStream );
145 void Store( SvStream& rStream );
149 class ScSubOutlineIterator
151 private:
152 ScOutlineArray* pArray;
153 USHORT nStart;
154 USHORT nEnd;
155 USHORT nSubLevel;
156 USHORT nSubEntry;
157 USHORT nCount;
158 USHORT nDepth;
160 public:
161 ScSubOutlineIterator( ScOutlineArray* pOutlineArray );
162 ScOutlineEntry* GetNext();
163 /*N*/ void DeleteLast();
166 } //namespace binfilter
167 #endif