sync master with lastest vba changes
[ooovba.git] / reportdesign / source / core / inc / Group.hxx
blob54ecf0145be9c2f9f73e1dc1d3a1a2007673ef65
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: Group.hxx,v $
10 * $Revision: 1.4 $
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_GROUP_HXX
31 #define REPORTDESIGN_API_GROUP_HXX
33 #include <com/sun/star/report/XGroup.hpp>
34 #include <cppuhelper/compbase2.hxx>
35 #include <comphelper/broadcasthelper.hxx>
36 #include <comphelper/sequence.hxx>
37 #include <cppuhelper/propertysetmixin.hxx>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include "GroupProperties.hxx"
40 #include <comphelper/uno3.hxx>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
43 namespace reportdesign
45 typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XGroup
46 , ::com::sun::star::lang::XServiceInfo> GroupBase;
47 typedef ::cppu::PropertySetMixin< com::sun::star::report::XGroup> GroupPropertySet;
49 /** \class OGroup Defines the implementation of a \interface com:::sun::star::report::XGroup
50 * \ingroup reportdesign_api
53 class OGroup : public comphelper::OMutexAndBroadcastHelper
54 ,public GroupBase
55 ,public GroupPropertySet
57 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
58 ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XGroups > m_xParent;
59 ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> m_xHeader;
60 ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> m_xFooter;
61 ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions > m_xFunctions;
62 ::rptshared::GroupProperties m_aProps;
64 private:
65 OGroup& operator=(const OGroup&);
66 OGroup(const OGroup&);
68 template <typename T> void set( const ::rtl::OUString& _sProperty
69 ,const T& _Value
70 ,T& _member)
72 BoundListeners l;
74 ::osl::MutexGuard aGuard(m_aMutex);
75 if ( _member != _Value )
77 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
78 _member = _Value;
81 l.notify();
83 void setSection( const ::rtl::OUString& _sProperty
84 ,const sal_Bool& _bOn
85 ,const ::rtl::OUString& _sName
86 ,::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _member);
87 protected:
88 // TODO: VirtualFunctionFinder: This is virtual function!
89 //
90 virtual ~OGroup();
92 /** this function is called upon disposing the component
94 // TODO: VirtualFunctionFinder: This is virtual function!
95 //
96 virtual void SAL_CALL disposing();
97 public:
98 OGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups >& _xParent
99 ,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
101 void copyGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xSource);
103 DECLARE_XINTERFACE( )
104 // ::com::sun::star::lang::XServiceInfo
105 virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
106 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
107 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
109 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
111 // com::sun::star::beans::XPropertySet
112 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
113 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
114 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
115 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
116 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
117 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
118 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
120 // XGroup
121 virtual ::sal_Bool SAL_CALL getSortAscending() throw (::com::sun::star::uno::RuntimeException);
122 virtual void SAL_CALL setSortAscending( ::sal_Bool _sortascending ) throw (::com::sun::star::uno::RuntimeException);
123 virtual ::sal_Bool SAL_CALL getHeaderOn() throw (::com::sun::star::uno::RuntimeException);
124 virtual void SAL_CALL setHeaderOn( ::sal_Bool _headeron ) throw (::com::sun::star::uno::RuntimeException);
125 virtual ::sal_Bool SAL_CALL getFooterOn() throw (::com::sun::star::uno::RuntimeException);
126 virtual void SAL_CALL setFooterOn( ::sal_Bool _footeron ) throw (::com::sun::star::uno::RuntimeException);
127 virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getHeader() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
128 virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getFooter() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
129 virtual ::sal_Int16 SAL_CALL getGroupOn() throw (::com::sun::star::uno::RuntimeException);
130 virtual void SAL_CALL setGroupOn( ::sal_Int16 _groupon ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
131 virtual ::sal_Int32 SAL_CALL getGroupInterval() throw (::com::sun::star::uno::RuntimeException);
132 virtual void SAL_CALL setGroupInterval( ::sal_Int32 _groupinterval ) throw (::com::sun::star::uno::RuntimeException);
133 virtual ::sal_Int16 SAL_CALL getKeepTogether() throw (::com::sun::star::uno::RuntimeException);
134 virtual void SAL_CALL setKeepTogether( ::sal_Int16 _keeptogether ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
135 virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups > SAL_CALL getGroups() throw (::com::sun::star::uno::RuntimeException);
136 virtual ::rtl::OUString SAL_CALL getExpression() throw (::com::sun::star::uno::RuntimeException);
137 virtual void SAL_CALL setExpression( const ::rtl::OUString& _expression ) throw (::com::sun::star::uno::RuntimeException);
138 virtual ::sal_Bool SAL_CALL getStartNewColumn() throw (::com::sun::star::uno::RuntimeException);
139 virtual void SAL_CALL setStartNewColumn( ::sal_Bool _startnewcolumn ) throw (::com::sun::star::uno::RuntimeException);
140 virtual ::sal_Bool SAL_CALL getResetPageNumber() throw (::com::sun::star::uno::RuntimeException);
141 virtual void SAL_CALL setResetPageNumber( ::sal_Bool _resetpagenumber ) throw (::com::sun::star::uno::RuntimeException);
143 //XFunctionsSupplier
144 virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions > SAL_CALL getFunctions() throw (::com::sun::star::uno::RuntimeException);
146 // XChild
147 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
148 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);
150 // XComponent
151 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
152 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
154 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
156 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
158 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
161 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext(){ return m_xContext; }
163 // =============================================================================
164 } // namespace reportdesign
165 // =============================================================================
166 #endif //