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 ************************************************************************/
28 #ifndef SC_MARKDATA_HXX
29 #define SC_MARKDATA_HXX
31 #include "address.hxx"
32 #include <tools/solar.h>
39 //! Es muss auch die Moeglichkeit geben, MarkArrays pro Tabelle zu halten,
40 //! damit "alle suchen" ueber mehrere Tabellen wieder funktioniert!
43 class SC_DLLPUBLIC ScMarkData
46 ScRange aMarkRange
; // Bereich
47 ScRange aMultiRange
; // maximaler Bereich insgesamt
48 ScMarkArray
* pMultiSel
; // Mehrfachselektion
49 BOOL bTabMarked
[MAXTABCOUNT
];// Tabelle selektiert
50 BOOL bMarked
; // Rechteck markiert
51 BOOL bMultiMarked
; // mehrfach markiert
53 BOOL bMarking
; // Bereich wird aufgezogen -> kein MarkToMulti
54 BOOL bMarkIsNeg
; // Aufheben bei Mehrfachselektion
58 ScMarkData(const ScMarkData
& rData
);
61 ScMarkData
& operator=(const ScMarkData
& rData
);
64 void SetMarkArea( const ScRange
& rRange
);
66 void SetMultiMarkArea( const ScRange
& rRange
, BOOL bMark
= TRUE
);
71 BOOL
IsMarked() const { return bMarked
; }
72 BOOL
IsMultiMarked() const { return bMultiMarked
; }
74 void GetMarkArea( ScRange
& rRange
) const;
75 void GetMultiMarkArea( ScRange
& rRange
) const;
77 void SetAreaTab( SCTAB nTab
);
79 void SelectTable( SCTAB nTab
, BOOL bNew
) { bTabMarked
[nTab
] = bNew
; }
80 BOOL
GetTableSelect( SCTAB nTab
) const { return bTabMarked
[nTab
]; }
82 void SelectOneTable( SCTAB nTab
);
83 SCTAB
GetSelectCount() const;
84 SCTAB
GetFirstSelected() const;
86 void SetMarkNegative( BOOL bFlag
) { bMarkIsNeg
= bFlag
; }
87 BOOL
IsMarkNegative() const { return bMarkIsNeg
; }
88 void SetMarking( BOOL bFlag
) { bMarking
= bFlag
; }
89 BOOL
GetMarkingFlag() const { return bMarking
; }
91 // fuer FillInfo / Document etc.
92 const ScMarkArray
* GetArray() const { return pMultiSel
; }
94 BOOL
IsCellMarked( SCCOL nCol
, SCROW nRow
, BOOL bNoSimple
= FALSE
) const;
95 void FillRangeListWithMarks( ScRangeList
* pList
, BOOL bClear
) const;
96 void ExtendRangeListTables( ScRangeList
* pList
) const;
98 void MarkFromRangeList( const ScRangeList
& rList
, BOOL bReset
);
100 SCCOLROW
GetMarkColumnRanges( SCCOLROW
* pRanges
);
101 SCCOLROW
GetMarkRowRanges( SCCOLROW
* pRanges
);
103 BOOL
IsColumnMarked( SCCOL nCol
) const;
104 BOOL
IsRowMarked( SCROW nRow
) const;
105 BOOL
IsAllMarked( const ScRange
& rRange
) const; // Multi
108 SCsROW
GetNextMarked( SCCOL nCol
, SCsROW nRow
, BOOL bUp
) const;
109 BOOL
HasMultiMarks( SCCOL nCol
) const;
110 BOOL
HasAnyMultiMarks() const;
112 // Tabellen-Markierungen anpassen:
113 void InsertTab( SCTAB nTab
);
114 void DeleteTab( SCTAB nTab
);