1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rangelst.hxx,v $
10 * $Revision: 1.9.32.3 $
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_RANGELST_HXX
32 #define SC_RANGELST_HXX
35 #include "address.hxx"
36 #include <tools/solar.h>
40 typedef ScRange
* ScRangePtr
;
41 DECLARE_LIST( ScRangeListBase
, ScRangePtr
)
42 class SC_DLLPUBLIC ScRangeList
: public ScRangeListBase
, public SvRefBase
45 using ScRangeListBase::operator==;
49 ScRangeList( const ScRangeList
& rList
);
50 virtual ~ScRangeList();
51 ScRangeList
& operator=(const ScRangeList
& rList
);
53 void Append( const ScRange
& rRange
)
55 ScRangePtr pR
= new ScRange( rRange
);
56 Insert( pR
, LIST_APPEND
);
58 USHORT
Parse( const String
&, ScDocument
* = NULL
,
59 USHORT nMask
= SCA_VALID
,
60 formula::FormulaGrammar::AddressConvention eConv
= formula::FormulaGrammar::CONV_OOO
,
61 char cDelimiter
= 0 );
62 void Format( String
&, USHORT nFlags
= 0, ScDocument
* = NULL
,
63 formula::FormulaGrammar::AddressConvention eConv
= formula::FormulaGrammar::CONV_OOO
,
64 char cDelimiter
= 0 ) const;
65 void Join( const ScRange
&, BOOL bIsInList
= FALSE
);
66 BOOL
UpdateReference( UpdateRefMode
, ScDocument
*,
67 const ScRange
& rWhere
,
68 SCsCOL nDx
, SCsROW nDy
, SCsTAB nDz
);
69 ScRange
* Find( const ScAddress
& ) const;
70 BOOL
operator==( const ScRangeList
& ) const;
71 BOOL
Intersects( const ScRange
& ) const;
72 BOOL
In( const ScRange
& ) const;
73 ULONG
GetCellCount() const;
75 SV_DECL_IMPL_REF( ScRangeList
);
78 // RangePairList: erster Range (aRange[0]) eigentlicher Range, zweiter
79 // Range (aRange[1]) Daten zu diesem Range, z.B. Rows eines ColName
80 DECLARE_LIST( ScRangePairListBase
, ScRangePair
* )
81 class ScRangePairList
: public ScRangePairListBase
, public SvRefBase
84 using ScRangePairListBase::operator==;
87 virtual ~ScRangePairList();
88 ScRangePairList
* Clone() const;
89 void Append( const ScRangePair
& rRangePair
)
91 ScRangePair
* pR
= new ScRangePair( rRangePair
);
92 Insert( pR
, LIST_APPEND
);
94 void Join( const ScRangePair
&, BOOL bIsInList
= FALSE
);
95 BOOL
UpdateReference( UpdateRefMode
, ScDocument
*,
96 const ScRange
& rWhere
,
97 SCsCOL nDx
, SCsROW nDy
, SCsTAB nDz
);
98 void DeleteOnTab( SCTAB nTab
);
99 ScRangePair
* Find( const ScAddress
& ) const;
100 ScRangePair
* Find( const ScRange
& ) const;
101 ScRangePair
** CreateNameSortedArray( ULONG
& nCount
, ScDocument
* ) const;
102 BOOL
operator==( const ScRangePairList
& ) const;
104 SV_DECL_IMPL_REF( ScRangePairList
);
110 ScRangePairList_QsortNameCompare( const void*, const void* );
112 #if defined( ICC ) && defined( SC_RANGELST_CXX ) && defined( OS2 )
113 static int _Optlink
ICCQsortRPairCompare( const void* a
, const void* b
)
114 { return ScRangePairList_QsortNameCompare(a
,b
); }