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