xref: /AOO41X/main/reportdesign/source/core/inc/Groups.hxx (revision 9ee13d1351a4b51ae8bed78e67629c7bd5f4481e)
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_GROUPS_HXX
24cdf0e10cSrcweir #define REPORTDESIGN_API_GROUPS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/report/XGroups.hpp>
27cdf0e10cSrcweir #include <cppuhelper/compbase1.hxx>
28cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx>
29cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
30cdf0e10cSrcweir #include <list>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace reportdesign
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 	typedef ::cppu::WeakComponentImplHelper1< com::sun::star::report::XGroups> GroupsBase;
36cdf0e10cSrcweir     /** \class OGroups Defines the implementation of a \interface com:::sun::star::report::XGroups
37cdf0e10cSrcweir 	 * \ingroup reportdesign_api
38cdf0e10cSrcweir 	 *
39cdf0e10cSrcweir 	 */
40cdf0e10cSrcweir 	class OGroups : public comphelper::OBaseMutex,
41cdf0e10cSrcweir 					public GroupsBase
42cdf0e10cSrcweir 	{
43cdf0e10cSrcweir 		typedef ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > >	TGroups;
44cdf0e10cSrcweir 		::cppu::OInterfaceContainerHelper														m_aContainerListeners;
45cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >			m_xContext;
46cdf0e10cSrcweir 		::com::sun::star::uno::WeakReference< ::com::sun::star::report::XReportDefinition >		m_xParent;
47cdf0e10cSrcweir 		TGroups																					m_aGroups;
48cdf0e10cSrcweir 	private:
49cdf0e10cSrcweir 		OGroups& operator=(const OGroups&);
50cdf0e10cSrcweir 		OGroups(const OGroups&);
51cdf0e10cSrcweir 		void checkIndex(sal_Int32 _nIndex);
52cdf0e10cSrcweir 	protected:
53cdf0e10cSrcweir         // TODO: VirtualFunctionFinder: This is virtual function!
54cdf0e10cSrcweir         //
55cdf0e10cSrcweir         virtual ~OGroups();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir         /** this function is called upon disposing the component
58cdf0e10cSrcweir         */
59cdf0e10cSrcweir         // TODO: VirtualFunctionFinder: This is virtual function!
60cdf0e10cSrcweir         //
61cdf0e10cSrcweir         virtual void SAL_CALL disposing();
62cdf0e10cSrcweir 	public:
63cdf0e10cSrcweir 		OGroups( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xParent
64cdf0e10cSrcweir 				,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 		void copyGroups(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups >& _xSource);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	// XGroups
69cdf0e10cSrcweir 		// Attributes
70cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > SAL_CALL getReportDefinition() throw (::com::sun::star::uno::RuntimeException);
71cdf0e10cSrcweir 		// Methods
72cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > SAL_CALL createGroup(  ) throw (::com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir 	// XIndexContainer
74cdf0e10cSrcweir 		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);
75cdf0e10cSrcweir 		virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
76cdf0e10cSrcweir 	// XIndexReplace
77cdf0e10cSrcweir 		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);
78cdf0e10cSrcweir 	// XIndexAccess
79cdf0e10cSrcweir 		virtual ::sal_Int32 SAL_CALL getCount(  ) throw (::com::sun::star::uno::RuntimeException);
80cdf0e10cSrcweir 		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);
81cdf0e10cSrcweir 	// XElementAccess
82cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw (::com::sun::star::uno::RuntimeException);
83cdf0e10cSrcweir 		virtual ::sal_Bool SAL_CALL hasElements(  ) throw (::com::sun::star::uno::RuntimeException);
84cdf0e10cSrcweir 	// XChild
85cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  ) throw (::com::sun::star::uno::RuntimeException);
86cdf0e10cSrcweir 		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);
87cdf0e10cSrcweir 	// XContainer
88cdf0e10cSrcweir 		virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
89cdf0e10cSrcweir 		virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir 
91cdf0e10cSrcweir         // XComponent
92cdf0e10cSrcweir 		virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
addEventListener(const::com::sun::star::uno::Reference<::com::sun::star::lang::XEventListener> & aListener)93cdf0e10cSrcweir 		virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
94cdf0e10cSrcweir 		{
95cdf0e10cSrcweir 			cppu::WeakComponentImplHelperBase::addEventListener(aListener);
96cdf0e10cSrcweir 		}
removeEventListener(const::com::sun::star::uno::Reference<::com::sun::star::lang::XEventListener> & aListener)97cdf0e10cSrcweir 		virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
98cdf0e10cSrcweir 		{
99cdf0e10cSrcweir 			cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
100cdf0e10cSrcweir 		}
101cdf0e10cSrcweir 	};
102cdf0e10cSrcweir }
103cdf0e10cSrcweir #endif // REPORTDESIGN_API_GROUPS_HXX
104cdf0e10cSrcweir 
105