update dev300-m57
[ooovba.git] / sc / inc / markdata.hxx
bloba2ac8993518a2a6fffc7ec2e56e437639ed53f07
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: markdata.hxx,v $
10 * $Revision: 1.5 $
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_MARKDATA_HXX
32 #define SC_MARKDATA_HXX
34 #include "address.hxx"
35 #include <tools/solar.h>
36 #include "scdllapi.h"
38 class ScMarkArray;
39 class ScRangeList;
41 //! todo:
42 //! Es muss auch die Moeglichkeit geben, MarkArrays pro Tabelle zu halten,
43 //! damit "alle suchen" ueber mehrere Tabellen wieder funktioniert!
46 class SC_DLLPUBLIC ScMarkData
48 private:
49 ScRange aMarkRange; // Bereich
50 ScRange aMultiRange; // maximaler Bereich insgesamt
51 ScMarkArray* pMultiSel; // Mehrfachselektion
52 BOOL bTabMarked[MAXTABCOUNT];// Tabelle selektiert
53 BOOL bMarked; // Rechteck markiert
54 BOOL bMultiMarked; // mehrfach markiert
56 BOOL bMarking; // Bereich wird aufgezogen -> kein MarkToMulti
57 BOOL bMarkIsNeg; // Aufheben bei Mehrfachselektion
59 public:
60 ScMarkData();
61 ScMarkData(const ScMarkData& rData);
62 ~ScMarkData();
64 ScMarkData& operator=(const ScMarkData& rData);
66 void ResetMark();
67 void SetMarkArea( const ScRange& rRange );
69 void SetMultiMarkArea( const ScRange& rRange, BOOL bMark = TRUE );
71 void MarkToMulti();
72 void MarkToSimple();
74 BOOL IsMarked() const { return bMarked; }
75 BOOL IsMultiMarked() const { return bMultiMarked; }
77 void GetMarkArea( ScRange& rRange ) const;
78 void GetMultiMarkArea( ScRange& rRange ) const;
80 void SetAreaTab( SCTAB nTab );
82 void SelectTable( SCTAB nTab, BOOL bNew ) { bTabMarked[nTab] = bNew; }
83 BOOL GetTableSelect( SCTAB nTab ) const { return bTabMarked[nTab]; }
85 void SelectOneTable( SCTAB nTab );
86 SCTAB GetSelectCount() const;
87 SCTAB GetFirstSelected() const;
89 void SetMarkNegative( BOOL bFlag ) { bMarkIsNeg = bFlag; }
90 BOOL IsMarkNegative() const { return bMarkIsNeg; }
91 void SetMarking( BOOL bFlag ) { bMarking = bFlag; }
92 BOOL GetMarkingFlag() const { return bMarking; }
94 // fuer FillInfo / Document etc.
95 const ScMarkArray* GetArray() const { return pMultiSel; }
97 BOOL IsCellMarked( SCCOL nCol, SCROW nRow, BOOL bNoSimple = FALSE ) const;
98 void FillRangeListWithMarks( ScRangeList* pList, BOOL bClear ) const;
99 void ExtendRangeListTables( ScRangeList* pList ) const;
101 void MarkFromRangeList( const ScRangeList& rList, BOOL bReset );
103 SCCOLROW GetMarkColumnRanges( SCCOLROW* pRanges );
104 SCCOLROW GetMarkRowRanges( SCCOLROW* pRanges );
106 BOOL IsColumnMarked( SCCOL nCol ) const;
107 BOOL IsRowMarked( SCROW nRow ) const;
108 BOOL IsAllMarked( const ScRange& rRange ) const; // Multi
110 /// May return -1
111 SCsROW GetNextMarked( SCCOL nCol, SCsROW nRow, BOOL bUp ) const;
112 BOOL HasMultiMarks( SCCOL nCol ) const;
113 BOOL HasAnyMultiMarks() const;
115 // Tabellen-Markierungen anpassen:
116 void InsertTab( SCTAB nTab );
117 void DeleteTab( SCTAB nTab );
122 #endif