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