138d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 338d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 438d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 538d50f7bSAndrew Rist * distributed with this work for additional information 638d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 738d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 838d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 938d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 1038d50f7bSAndrew Rist * 1138d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 1238d50f7bSAndrew Rist * 1338d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 1438d50f7bSAndrew Rist * software distributed under the License is distributed on an 1538d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1638d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 1738d50f7bSAndrew Rist * specific language governing permissions and limitations 1838d50f7bSAndrew Rist * under the License. 1938d50f7bSAndrew Rist * 2038d50f7bSAndrew Rist *************************************************************/ 2138d50f7bSAndrew Rist 2238d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_NAMEUNO_HXX 25cdf0e10cSrcweir #define SC_NAMEUNO_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svl/lstner.hxx> 28cdf0e10cSrcweir #include "address.hxx" 29cdf0e10cSrcweir #include "formula/grammar.hxx" 30cdf0e10cSrcweir #include <com/sun/star/sheet/XLabelRange.hpp> 31cdf0e10cSrcweir #include <com/sun/star/sheet/XLabelRanges.hpp> 32cdf0e10cSrcweir #include <com/sun/star/sheet/XCellRangeReferrer.hpp> 33*102b8ff7SWang Lei #include <com/sun/star/sheet/XNamedRange2.hpp> 34cdf0e10cSrcweir #include <com/sun/star/sheet/XFormulaTokens.hpp> 35*102b8ff7SWang Lei #include <com/sun/star/sheet/XNamedRanges2.hpp> 36cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp> 37*102b8ff7SWang Lei #include <com/sun/star/sheet/RangeScopeName.hpp> 38cdf0e10cSrcweir #include <com/sun/star/lang/XServiceName.hpp> 39cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 40cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 41cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 42cdf0e10cSrcweir #include <com/sun/star/document/XActionLockable.hpp> 43cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 44cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> 45cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 46cdf0e10cSrcweir #include <cppuhelper/implbase6.hxx> 47cdf0e10cSrcweir 48dffa72deSWang Lei #include <global.hxx> //for EMPTY_STRING 49dffa72deSWang Lei 50cdf0e10cSrcweir class ScDocShell; 51cdf0e10cSrcweir class ScRangeData; 52cdf0e10cSrcweir class ScTokenArray; 53cdf0e10cSrcweir 54cdf0e10cSrcweir 55cdf0e10cSrcweir class ScNamedRangeObj : public ::cppu::WeakImplHelper6< 56*102b8ff7SWang Lei ::com::sun::star::sheet::XNamedRange2, 57cdf0e10cSrcweir ::com::sun::star::sheet::XFormulaTokens, 58cdf0e10cSrcweir ::com::sun::star::sheet::XCellRangeReferrer, 59cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet, 60cdf0e10cSrcweir ::com::sun::star::lang::XUnoTunnel, 61cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo >, 62cdf0e10cSrcweir public SfxListener 63cdf0e10cSrcweir { 64cdf0e10cSrcweir private: 65cdf0e10cSrcweir ScDocShell* pDocShell; 66cdf0e10cSrcweir String aName; 67dffa72deSWang Lei String aScopeName; 68cdf0e10cSrcweir 69cdf0e10cSrcweir private: 70cdf0e10cSrcweir ScRangeData* GetRangeData_Impl(); 71cdf0e10cSrcweir void Modify_Impl( const String* pNewName, 72cdf0e10cSrcweir const ScTokenArray* pNewTokens, const String* pNewContent, 73cdf0e10cSrcweir const ScAddress* pNewPos, const sal_uInt16* pNewType, 74dffa72deSWang Lei const formula::FormulaGrammar::Grammar eGrammar, const String* pNewScopeName = NULL ); 75cdf0e10cSrcweir 76cdf0e10cSrcweir public: 77dffa72deSWang Lei ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm, const String& rScopeName = EMPTY_STRING); 78cdf0e10cSrcweir virtual ~ScNamedRangeObj(); 79cdf0e10cSrcweir 80cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir // XNamedRange 83cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getContent() throw(::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir virtual void SAL_CALL setContent( const ::rtl::OUString& aContent ) 85cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir virtual ::com::sun::star::table::CellAddress SAL_CALL getReferencePosition() 87cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 88cdf0e10cSrcweir virtual void SAL_CALL setReferencePosition( 89cdf0e10cSrcweir const ::com::sun::star::table::CellAddress& aReferencePosition ) 90cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 91cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getType() throw(::com::sun::star::uno::RuntimeException); 92cdf0e10cSrcweir virtual void SAL_CALL setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException); 93dffa72deSWang Lei virtual ::rtl::OUString SAL_CALL getScopeName() throw(::com::sun::star::uno::RuntimeException); 94dffa72deSWang Lei virtual void SAL_CALL setScopeAndRangeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName ) throw(::com::sun::star::uno::RuntimeException); 95cdf0e10cSrcweir 96cdf0e10cSrcweir // XFormulaTokens 97cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getTokens() 98cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 99cdf0e10cSrcweir virtual void SAL_CALL setTokens( const ::com::sun::star::uno::Sequence< 100cdf0e10cSrcweir ::com::sun::star::sheet::FormulaToken >& aTokens ) 101cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 102cdf0e10cSrcweir 103cdf0e10cSrcweir // XNamed 104cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); 105cdf0e10cSrcweir virtual void SAL_CALL setName( const ::rtl::OUString& aName ) 106cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 107cdf0e10cSrcweir 108cdf0e10cSrcweir // XCellRangeReferrer 109cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL 110cdf0e10cSrcweir getReferredCells() throw(::com::sun::star::uno::RuntimeException); 111cdf0e10cSrcweir 112cdf0e10cSrcweir // XPropertySet 113cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 114cdf0e10cSrcweir SAL_CALL getPropertySetInfo() 115cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 116cdf0e10cSrcweir virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 117cdf0e10cSrcweir const ::com::sun::star::uno::Any& aValue ) 118cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 119cdf0e10cSrcweir ::com::sun::star::beans::PropertyVetoException, 120cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 121cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 122cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 123cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 124cdf0e10cSrcweir const ::rtl::OUString& PropertyName ) 125cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 126cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 127cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 128cdf0e10cSrcweir virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, 129cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 130cdf0e10cSrcweir ::com::sun::star::beans::XPropertyChangeListener >& xListener ) 131cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 132cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 133cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 134cdf0e10cSrcweir virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, 135cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 136cdf0e10cSrcweir ::com::sun::star::beans::XPropertyChangeListener >& aListener ) 137cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 138cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 139cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 140cdf0e10cSrcweir virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, 141cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 142cdf0e10cSrcweir ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 143cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 144cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 145cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 146cdf0e10cSrcweir virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, 147cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 148cdf0e10cSrcweir ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 149cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 150cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 151cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 152cdf0e10cSrcweir 153cdf0e10cSrcweir // XUnoTunnel 154cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< 155cdf0e10cSrcweir sal_Int8 >& aIdentifier ) 156cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 157cdf0e10cSrcweir 158cdf0e10cSrcweir static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); 159cdf0e10cSrcweir static ScNamedRangeObj* getImplementation( const com::sun::star::uno::Reference< 160cdf0e10cSrcweir com::sun::star::uno::XInterface> xObj ); 161cdf0e10cSrcweir 162cdf0e10cSrcweir // XServiceInfo 163cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 164cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 165cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 166cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 167cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 168cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 169cdf0e10cSrcweir 170cdf0e10cSrcweir // methods accessible via getImplementation() 171cdf0e10cSrcweir void SetContentWithGrammar( const ::rtl::OUString& aContent, 172cdf0e10cSrcweir const formula::FormulaGrammar::Grammar eGrammar ) 173cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 174cdf0e10cSrcweir }; 175cdf0e10cSrcweir 176cdf0e10cSrcweir 177cdf0e10cSrcweir class ScNamedRangesObj : public ::cppu::WeakImplHelper5< 178*102b8ff7SWang Lei ::com::sun::star::sheet::XNamedRanges2, 179cdf0e10cSrcweir ::com::sun::star::container::XEnumerationAccess, 180cdf0e10cSrcweir ::com::sun::star::container::XIndexAccess, 181cdf0e10cSrcweir ::com::sun::star::document::XActionLockable, 182cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo >, 183cdf0e10cSrcweir public SfxListener 184cdf0e10cSrcweir { 185cdf0e10cSrcweir private: 186cdf0e10cSrcweir ScDocShell* pDocShell; 187cdf0e10cSrcweir 188cdf0e10cSrcweir ScNamedRangeObj* GetObjectByIndex_Impl(sal_uInt16 nIndex); 189cdf0e10cSrcweir ScNamedRangeObj* GetObjectByName_Impl(const ::rtl::OUString& aName); 190dffa72deSWang Lei ScNamedRangeObj* GetObjectByScopeName_Impl(const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName); 191dffa72deSWang Lei 192dffa72deSWang Lei void ImplAddNewByScopeAndName(SCTAB aScope,const ::rtl::OUString& aRangeName, const ::rtl::OUString& aContent, 193dffa72deSWang Lei const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType) 194dffa72deSWang Lei throw(::com::sun::star::uno::RuntimeException); 195dffa72deSWang Lei 196dffa72deSWang Lei void ImplRemoveByScopeAndName(SCTAB aScope,const ::rtl::OUString& aRangeName) 197dffa72deSWang Lei throw(::com::sun::star::uno::RuntimeException); 198cdf0e10cSrcweir 199cdf0e10cSrcweir protected: 200cdf0e10cSrcweir /** called from the XActionLockable interface methods on initial locking */ 201cdf0e10cSrcweir virtual void lock(); 202cdf0e10cSrcweir 203cdf0e10cSrcweir /** called from the XActionLockable interface methods on final unlock */ 204cdf0e10cSrcweir virtual void unlock(); 205cdf0e10cSrcweir 206cdf0e10cSrcweir public: 207cdf0e10cSrcweir ScNamedRangesObj(ScDocShell* pDocSh); 208cdf0e10cSrcweir virtual ~ScNamedRangesObj(); 209cdf0e10cSrcweir 210cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 211cdf0e10cSrcweir 212cdf0e10cSrcweir // XNamedRanges 213cdf0e10cSrcweir virtual void SAL_CALL addNewByName( const ::rtl::OUString& aName, const ::rtl::OUString& aContent, 214cdf0e10cSrcweir const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType ) 215cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 216dffa72deSWang Lei 217dffa72deSWang Lei virtual void SAL_CALL addNewByScopeName( const ::rtl::OUString& aScopeName,const ::rtl::OUString& aRangeName, const ::rtl::OUString& aContent, 218dffa72deSWang Lei const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType ) 219dffa72deSWang Lei throw(::com::sun::star::uno::RuntimeException); 220cdf0e10cSrcweir virtual void SAL_CALL addNewFromTitles( const ::com::sun::star::table::CellRangeAddress& aSource, 221cdf0e10cSrcweir ::com::sun::star::sheet::Border aBorder ) 222cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 223cdf0e10cSrcweir virtual void SAL_CALL removeByName( const ::rtl::OUString& aName ) 224cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 225dffa72deSWang Lei virtual void SAL_CALL removeByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName ) 226dffa72deSWang Lei throw(::com::sun::star::uno::RuntimeException); 227cdf0e10cSrcweir virtual void SAL_CALL outputList( const ::com::sun::star::table::CellAddress& aOutputPosition ) 228cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 229dffa72deSWang Lei virtual sal_Bool SAL_CALL hasByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName ) 230dffa72deSWang Lei throw(::com::sun::star::uno::RuntimeException); 231dffa72deSWang Lei virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::RangeScopeName > SAL_CALL getElementScopeNames() 232dffa72deSWang Lei throw(::com::sun::star::uno::RuntimeException); 233dffa72deSWang Lei virtual ::com::sun::star::uno::Any SAL_CALL getByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName ) 234dffa72deSWang Lei throw(::com::sun::star::container::NoSuchElementException, 235dffa72deSWang Lei ::com::sun::star::lang::WrappedTargetException, 236dffa72deSWang Lei ::com::sun::star::uno::RuntimeException); 237cdf0e10cSrcweir 238cdf0e10cSrcweir // XNameAccess 239cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) 240cdf0e10cSrcweir throw(::com::sun::star::container::NoSuchElementException, 241cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 242cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 243cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() 244cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 245cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) 246cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 247cdf0e10cSrcweir 248cdf0e10cSrcweir // XIndexAccess 249cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 250cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 251cdf0e10cSrcweir throw(::com::sun::star::lang::IndexOutOfBoundsException, 252cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 253cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 254cdf0e10cSrcweir 255cdf0e10cSrcweir // XEnumerationAccess 256cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 257cdf0e10cSrcweir createEnumeration() throw(::com::sun::star::uno::RuntimeException); 258cdf0e10cSrcweir 259cdf0e10cSrcweir // XElementAccess 260cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 261cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 262cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 263cdf0e10cSrcweir 264cdf0e10cSrcweir // XActionLockable 265cdf0e10cSrcweir virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException); 266cdf0e10cSrcweir virtual void SAL_CALL addActionLock() throw(::com::sun::star::uno::RuntimeException); 267cdf0e10cSrcweir virtual void SAL_CALL removeActionLock() throw(::com::sun::star::uno::RuntimeException); 268cdf0e10cSrcweir virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) throw(::com::sun::star::uno::RuntimeException); 269cdf0e10cSrcweir virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException); 270cdf0e10cSrcweir 271cdf0e10cSrcweir // XServiceInfo 272cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 273cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 274cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 275cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 276cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 277cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 278cdf0e10cSrcweir }; 279cdf0e10cSrcweir 280cdf0e10cSrcweir 281cdf0e10cSrcweir class ScLabelRangeObj : public ::cppu::WeakImplHelper2< 282cdf0e10cSrcweir ::com::sun::star::sheet::XLabelRange, 283cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo >, 284cdf0e10cSrcweir public SfxListener 285cdf0e10cSrcweir { 286cdf0e10cSrcweir private: 287cdf0e10cSrcweir ScDocShell* pDocShell; 288cdf0e10cSrcweir sal_Bool bColumn; 289cdf0e10cSrcweir ScRange aRange; // Kriterium um Bereich zu finden 290cdf0e10cSrcweir 291cdf0e10cSrcweir private: 292cdf0e10cSrcweir ScRangePair* GetData_Impl(); 293cdf0e10cSrcweir void Modify_Impl( const ScRange* pLabel, const ScRange* pData ); 294cdf0e10cSrcweir 295cdf0e10cSrcweir public: 296cdf0e10cSrcweir ScLabelRangeObj(ScDocShell* pDocSh, sal_Bool bCol, const ScRange& rR); 297cdf0e10cSrcweir virtual ~ScLabelRangeObj(); 298cdf0e10cSrcweir 299cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 300cdf0e10cSrcweir 301cdf0e10cSrcweir // XLabelRange 302cdf0e10cSrcweir virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getLabelArea() 303cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 304cdf0e10cSrcweir virtual void SAL_CALL setLabelArea( const ::com::sun::star::table::CellRangeAddress& aLabelArea ) 305cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 306cdf0e10cSrcweir virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getDataArea() 307cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 308cdf0e10cSrcweir virtual void SAL_CALL setDataArea( const ::com::sun::star::table::CellRangeAddress& aDataArea ) 309cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 310cdf0e10cSrcweir 311cdf0e10cSrcweir // XServiceInfo 312cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 313cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 314cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 315cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 316cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 317cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 318cdf0e10cSrcweir }; 319cdf0e10cSrcweir 320cdf0e10cSrcweir 321cdf0e10cSrcweir class ScLabelRangesObj : public ::cppu::WeakImplHelper3< 322cdf0e10cSrcweir ::com::sun::star::sheet::XLabelRanges, 323cdf0e10cSrcweir ::com::sun::star::container::XEnumerationAccess, 324cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo >, 325cdf0e10cSrcweir public SfxListener 326cdf0e10cSrcweir { 327cdf0e10cSrcweir private: 328cdf0e10cSrcweir ScDocShell* pDocShell; 329cdf0e10cSrcweir sal_Bool bColumn; 330cdf0e10cSrcweir 331cdf0e10cSrcweir ScLabelRangeObj* GetObjectByIndex_Impl(sal_uInt16 nIndex); 332cdf0e10cSrcweir 333cdf0e10cSrcweir public: 334cdf0e10cSrcweir ScLabelRangesObj(ScDocShell* pDocSh, sal_Bool bCol); 335cdf0e10cSrcweir virtual ~ScLabelRangesObj(); 336cdf0e10cSrcweir 337cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 338cdf0e10cSrcweir 339cdf0e10cSrcweir // XLabelRanges 340cdf0e10cSrcweir virtual void SAL_CALL addNew( const ::com::sun::star::table::CellRangeAddress& aLabelArea, 341cdf0e10cSrcweir const ::com::sun::star::table::CellRangeAddress& aDataArea ) 342cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 343cdf0e10cSrcweir virtual void SAL_CALL removeByIndex( sal_Int32 nIndex ) 344cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 345cdf0e10cSrcweir 346cdf0e10cSrcweir // XIndexAccess 347cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 348cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 349cdf0e10cSrcweir throw(::com::sun::star::lang::IndexOutOfBoundsException, 350cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 351cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 352cdf0e10cSrcweir 353cdf0e10cSrcweir // XEnumerationAccess 354cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 355cdf0e10cSrcweir createEnumeration() throw(::com::sun::star::uno::RuntimeException); 356cdf0e10cSrcweir 357cdf0e10cSrcweir // XElementAccess 358cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 359cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 360cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 361cdf0e10cSrcweir 362cdf0e10cSrcweir // XServiceInfo 363cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 364cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 365cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 366cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 367cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 368cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 369cdf0e10cSrcweir }; 370cdf0e10cSrcweir 371cdf0e10cSrcweir 372cdf0e10cSrcweir 373cdf0e10cSrcweir 374cdf0e10cSrcweir #endif 375cdf0e10cSrcweir 376