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