1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: Functions.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef REPORTDESIGN_API_FUNCTIONS_HXX
31 #define REPORTDESIGN_API_FUNCTIONS_HXX
33 #include <com/sun/star/report/XFunctions.hpp>
34 #include <com/sun/star/report/XFunctionsSupplier.hpp>
35 #include <cppuhelper/compbase1.hxx>
36 #include <comphelper/broadcasthelper.hxx>
37 #include <com/sun/star/uno/XComponentContext.hpp>
41 namespace reportdesign
43 typedef ::cppu::WeakComponentImplHelper1
< com::sun::star::report::XFunctions
> FunctionsBase
;
44 /** \class OFunctions Defines the implementation of a \interface com:::sun::star::report::XFunctions
45 * \ingroup reportdesign_api
48 class OFunctions
: public comphelper::OBaseMutex
,
51 typedef ::std::list
< ::com::sun::star::uno::Reference
< ::com::sun::star::report::XFunction
> > TFunctions
;
52 ::cppu::OInterfaceContainerHelper m_aContainerListeners
;
53 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
54 ::com::sun::star::uno::WeakReference
< ::com::sun::star::report::XFunctionsSupplier
> m_xParent
;
55 TFunctions m_aFunctions
;
57 OFunctions
& operator=(const OFunctions
&);
58 OFunctions(const OFunctions
&);
59 void checkIndex(sal_Int32 _nIndex
);
61 // TODO: VirtualFunctionFinder: This is virtual function!
63 virtual ~OFunctions();
65 /** this function is called upon disposing the component
67 // TODO: VirtualFunctionFinder: This is virtual function!
69 virtual void SAL_CALL
disposing();
71 explicit OFunctions( const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XFunctionsSupplier
>& _xParent
72 ,const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& context
);
76 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::report::XFunction
> SAL_CALL
createFunction( ) throw (::com::sun::star::uno::RuntimeException
);
78 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
);
79 virtual void SAL_CALL
removeByIndex( ::sal_Int32 Index
) throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
81 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
);
83 virtual ::sal_Int32 SAL_CALL
getCount( ) throw (::com::sun::star::uno::RuntimeException
);
84 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
);
86 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw (::com::sun::star::uno::RuntimeException
);
87 virtual ::sal_Bool SAL_CALL
hasElements( ) throw (::com::sun::star::uno::RuntimeException
);
89 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getParent( ) throw (::com::sun::star::uno::RuntimeException
);
90 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
);
92 virtual void SAL_CALL
addContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
93 virtual void SAL_CALL
removeContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
addEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
99 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
101 virtual void SAL_CALL
removeEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
103 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
107 #endif // REPORTDESIGN_API_FUNCTIONS_HXX