xref: /AOO41X/main/reportdesign/source/core/inc/Functions.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef REPORTDESIGN_API_FUNCTIONS_HXX
28 #define REPORTDESIGN_API_FUNCTIONS_HXX
29 
30 #include <com/sun/star/report/XFunctions.hpp>
31 #include <com/sun/star/report/XFunctionsSupplier.hpp>
32 #include <cppuhelper/compbase1.hxx>
33 #include <comphelper/broadcasthelper.hxx>
34 #include <com/sun/star/uno/XComponentContext.hpp>
35 #include <list>
36 
37 
38 namespace reportdesign
39 {
40 	typedef ::cppu::WeakComponentImplHelper1< com::sun::star::report::XFunctions> FunctionsBase;
41     /** \class OFunctions Defines the implementation of a \interface com:::sun::star::report::XFunctions
42 	 * \ingroup reportdesign_api
43 	 *
44 	 */
45 	class OFunctions : public comphelper::OBaseMutex,
46 					public FunctionsBase
47 	{
48 		typedef ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > >	TFunctions;
49 		::cppu::OInterfaceContainerHelper														m_aContainerListeners;
50 		::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >			m_xContext;
51 		::com::sun::star::uno::WeakReference< ::com::sun::star::report::XFunctionsSupplier >    m_xParent;
52 		TFunctions																				m_aFunctions;
53 	private:
54 		OFunctions& operator=(const OFunctions&);
55 		OFunctions(const OFunctions&);
56 		void checkIndex(sal_Int32 _nIndex);
57 	protected:
58         // TODO: VirtualFunctionFinder: This is virtual function!
59         //
60         virtual ~OFunctions();
61 
62         /** this function is called upon disposing the component
63         */
64         // TODO: VirtualFunctionFinder: This is virtual function!
65         //
66         virtual void SAL_CALL disposing();
67 	public:
68 		explicit OFunctions( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctionsSupplier >& _xParent
69 				,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
70 
71 	// XFunctions
72 		// Methods
73 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > SAL_CALL createFunction(  ) throw (::com::sun::star::uno::RuntimeException);
74 	// XIndexContainer
75 		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);
76 		virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
77 	// XIndexReplace
78 		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);
79 	// XIndexAccess
80 		virtual ::sal_Int32 SAL_CALL getCount(  ) throw (::com::sun::star::uno::RuntimeException);
81 		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);
82 	// XElementAccess
83 		virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw (::com::sun::star::uno::RuntimeException);
84 		virtual ::sal_Bool SAL_CALL hasElements(  ) throw (::com::sun::star::uno::RuntimeException);
85 	// XChild
86 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  ) throw (::com::sun::star::uno::RuntimeException);
87 		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);
88 	// XContainer
89 		virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
90 		virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
91 
92         // XComponent
93 		virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
94 		virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
95 		{
96 			cppu::WeakComponentImplHelperBase::addEventListener(aListener);
97 		}
98 		virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
99 		{
100 			cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
101 		}
102 	};
103 }
104 #endif // REPORTDESIGN_API_FUNCTIONS_HXX
105 
106