merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / inc / rangelst.hxx
blobe00fce10da1ca5cf32e6d964bc7b44ce6c76c898
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_RANGELST_HXX
29 #define SC_RANGELST_HXX
31 #include "global.hxx"
32 #include "address.hxx"
33 #include <tools/solar.h>
35 class ScDocument;
37 typedef ScRange* ScRangePtr;
38 DECLARE_LIST( ScRangeListBase, ScRangePtr )
39 class SC_DLLPUBLIC ScRangeList : public ScRangeListBase, public SvRefBase
41 private:
42 using ScRangeListBase::operator==;
43 using ScRangeListBase::operator!=;
45 public:
46 ScRangeList() {}
47 ScRangeList( const ScRangeList& rList );
48 virtual ~ScRangeList();
49 ScRangeList& operator=(const ScRangeList& rList);
50 void RemoveAll();
51 void Append( const ScRange& rRange )
53 ScRangePtr pR = new ScRange( rRange );
54 Insert( pR, LIST_APPEND );
56 USHORT Parse( const String&, ScDocument* = NULL,
57 USHORT nMask = SCA_VALID,
58 formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO,
59 sal_Unicode cDelimiter = 0 );
60 void Format( String&, USHORT nFlags = 0, ScDocument* = NULL,
61 formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO,
62 sal_Unicode cDelimiter = 0 ) const;
63 void Join( const ScRange&, BOOL bIsInList = FALSE );
64 BOOL UpdateReference( UpdateRefMode, ScDocument*,
65 const ScRange& rWhere,
66 SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
67 ScRange* Find( const ScAddress& ) const;
68 BOOL operator==( const ScRangeList& ) const;
69 BOOL operator!=( const ScRangeList& r ) const;
70 BOOL Intersects( const ScRange& ) const;
71 BOOL In( const ScRange& ) const;
72 ULONG GetCellCount() const;
74 SV_DECL_IMPL_REF( ScRangeList );
77 // RangePairList: erster Range (aRange[0]) eigentlicher Range, zweiter
78 // Range (aRange[1]) Daten zu diesem Range, z.B. Rows eines ColName
79 DECLARE_LIST( ScRangePairListBase, ScRangePair* )
80 class ScRangePairList : public ScRangePairListBase, public SvRefBase
82 private:
83 using ScRangePairListBase::operator==;
85 public:
86 virtual ~ScRangePairList();
87 ScRangePairList* Clone() const;
88 void Append( const ScRangePair& rRangePair )
90 ScRangePair* pR = new ScRangePair( rRangePair );
91 Insert( pR, LIST_APPEND );
93 void Join( const ScRangePair&, BOOL bIsInList = FALSE );
94 BOOL UpdateReference( UpdateRefMode, ScDocument*,
95 const ScRange& rWhere,
96 SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
97 void DeleteOnTab( SCTAB nTab );
98 ScRangePair* Find( const ScAddress& ) const;
99 ScRangePair* Find( const ScRange& ) const;
100 ScRangePair** CreateNameSortedArray( ULONG& nCount, ScDocument* ) const;
101 BOOL operator==( const ScRangePairList& ) const;
103 SV_DECL_IMPL_REF( ScRangePairList );
105 extern "C" int
106 #ifdef WNT
107 __cdecl
108 #endif
109 ScRangePairList_QsortNameCompare( const void*, const void* );
111 #if defined( ICC ) && defined( SC_RANGELST_CXX ) && defined( OS2 )
112 static int _Optlink ICCQsortRPairCompare( const void* a, const void* b)
113 { return ScRangePairList_QsortNameCompare(a,b); }
114 #endif
117 #endif