1*9ee13d13SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9ee13d13SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9ee13d13SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9ee13d13SAndrew Rist * distributed with this work for additional information 6*9ee13d13SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9ee13d13SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9ee13d13SAndrew Rist * "License"); you may not use this file except in compliance 9*9ee13d13SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*9ee13d13SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*9ee13d13SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9ee13d13SAndrew Rist * software distributed under the License is distributed on an 15*9ee13d13SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9ee13d13SAndrew Rist * KIND, either express or implied. See the License for the 17*9ee13d13SAndrew Rist * specific language governing permissions and limitations 18*9ee13d13SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*9ee13d13SAndrew Rist *************************************************************/ 21*9ee13d13SAndrew Rist 22*9ee13d13SAndrew Rist 23cdf0e10cSrcweir #ifndef REPORTDESIGN_API_FUNCTIONS_HXX 24cdf0e10cSrcweir #define REPORTDESIGN_API_FUNCTIONS_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <com/sun/star/report/XFunctions.hpp> 27cdf0e10cSrcweir #include <com/sun/star/report/XFunctionsSupplier.hpp> 28cdf0e10cSrcweir #include <cppuhelper/compbase1.hxx> 29cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx> 30cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 31cdf0e10cSrcweir #include <list> 32cdf0e10cSrcweir 33cdf0e10cSrcweir 34cdf0e10cSrcweir namespace reportdesign 35cdf0e10cSrcweir { 36cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper1< com::sun::star::report::XFunctions> FunctionsBase; 37cdf0e10cSrcweir /** \class OFunctions Defines the implementation of a \interface com:::sun::star::report::XFunctions 38cdf0e10cSrcweir * \ingroup reportdesign_api 39cdf0e10cSrcweir * 40cdf0e10cSrcweir */ 41cdf0e10cSrcweir class OFunctions : public comphelper::OBaseMutex, 42cdf0e10cSrcweir public FunctionsBase 43cdf0e10cSrcweir { 44cdf0e10cSrcweir typedef ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > > TFunctions; 45cdf0e10cSrcweir ::cppu::OInterfaceContainerHelper m_aContainerListeners; 46cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 47cdf0e10cSrcweir ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XFunctionsSupplier > m_xParent; 48cdf0e10cSrcweir TFunctions m_aFunctions; 49cdf0e10cSrcweir private: 50cdf0e10cSrcweir OFunctions& operator=(const OFunctions&); 51cdf0e10cSrcweir OFunctions(const OFunctions&); 52cdf0e10cSrcweir void checkIndex(sal_Int32 _nIndex); 53cdf0e10cSrcweir protected: 54cdf0e10cSrcweir // TODO: VirtualFunctionFinder: This is virtual function! 55cdf0e10cSrcweir // 56cdf0e10cSrcweir virtual ~OFunctions(); 57cdf0e10cSrcweir 58cdf0e10cSrcweir /** this function is called upon disposing the component 59cdf0e10cSrcweir */ 60cdf0e10cSrcweir // TODO: VirtualFunctionFinder: This is virtual function! 61cdf0e10cSrcweir // 62cdf0e10cSrcweir virtual void SAL_CALL disposing(); 63cdf0e10cSrcweir public: 64cdf0e10cSrcweir explicit OFunctions( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctionsSupplier >& _xParent 65cdf0e10cSrcweir ,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context); 66cdf0e10cSrcweir 67cdf0e10cSrcweir // XFunctions 68cdf0e10cSrcweir // Methods 69cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > SAL_CALL createFunction( ) throw (::com::sun::star::uno::RuntimeException); 70cdf0e10cSrcweir // XIndexContainer 71cdf0e10cSrcweir virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 72cdf0e10cSrcweir virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 73cdf0e10cSrcweir // XIndexReplace 74cdf0e10cSrcweir virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 75cdf0e10cSrcweir // XIndexAccess 76cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException); 77cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 78cdf0e10cSrcweir // XElementAccess 79cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException); 81cdf0e10cSrcweir // XChild 82cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); 83cdf0e10cSrcweir virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir // XContainer 85cdf0e10cSrcweir virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 87cdf0e10cSrcweir 88cdf0e10cSrcweir // XComponent 89cdf0e10cSrcweir virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); addEventListener(const::com::sun::star::uno::Reference<::com::sun::star::lang::XEventListener> & aListener)90cdf0e10cSrcweir virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException) 91cdf0e10cSrcweir { 92cdf0e10cSrcweir cppu::WeakComponentImplHelperBase::addEventListener(aListener); 93cdf0e10cSrcweir } removeEventListener(const::com::sun::star::uno::Reference<::com::sun::star::lang::XEventListener> & aListener)94cdf0e10cSrcweir virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException) 95cdf0e10cSrcweir { 96cdf0e10cSrcweir cppu::WeakComponentImplHelperBase::removeEventListener(aListener); 97cdf0e10cSrcweir } 98cdf0e10cSrcweir }; 99cdf0e10cSrcweir } 100cdf0e10cSrcweir #endif // REPORTDESIGN_API_FUNCTIONS_HXX 101cdf0e10cSrcweir 102