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