sync master with lastest vba changes
[ooovba.git] / sc / inc / markarr.hxx
blob86ec32e66393b0555fab1c66276630853dbfb8a8
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: markarr.hxx,v $
10 * $Revision: 1.6.32.1 $
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_MARKARR_HXX
32 #define SC_MARKARR_HXX
34 #include "address.hxx"
35 #include <tools/solar.h>
37 #define SC_MARKARRAY_DELTA 4
39 struct ScMarkEntry
41 SCROW nRow;
42 BOOL bMarked;
45 class ScMarkArray
47 SCSIZE nCount;
48 SCSIZE nLimit;
49 ScMarkEntry* pData;
51 friend class ScMarkArrayIter;
52 friend class ScDocument; // fuer FillInfo
54 public:
55 ScMarkArray();
56 ~ScMarkArray();
57 void Reset( BOOL bMarked = FALSE );
58 BOOL GetMark( SCROW nRow ) const;
59 void SetMarkArea( SCROW nStartRow, SCROW nEndRow, BOOL bMarked );
60 BOOL IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const;
61 BOOL HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const;
63 BOOL HasMarks() const { return ( nCount > 1 || ( nCount == 1 && pData[0].bMarked ) ); }
65 void CopyMarksTo( ScMarkArray& rDestMarkArray ) const;
67 BOOL Search( SCROW nRow, SCSIZE& nIndex ) const;
68 void DeleteArea(SCROW nStartRow, SCROW nEndRow);
70 /// Including current row, may return -1 if bUp and not found
71 SCsROW GetNextMarked( SCsROW nRow, BOOL bUp ) const;
72 SCROW GetMarkEnd( SCROW nRow, BOOL bUp ) const;
76 class ScMarkArrayIter // selektierte Bereiche durchgehen
78 const ScMarkArray* pArray;
79 SCSIZE nPos;
80 public:
81 ScMarkArrayIter( const ScMarkArray* pNewArray );
82 ~ScMarkArrayIter();
84 BOOL Next( SCROW& rTop, SCROW& rBottom );
89 #endif