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