1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUP_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_GROUP_HXX
22 #include <com/sun/star/report/XGroup.hpp>
23 #include <cppuhelper/compbase2.hxx>
24 #include <comphelper/broadcasthelper.hxx>
25 #include <comphelper/sequence.hxx>
26 #include <cppuhelper/propertysetmixin.hxx>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include "GroupProperties.hxx"
29 #include <comphelper/uno3.hxx>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
32 namespace reportdesign
34 typedef ::cppu::WeakComponentImplHelper2
< com::sun::star::report::XGroup
35 , ::com::sun::star::lang::XServiceInfo
> GroupBase
;
36 typedef ::cppu::PropertySetMixin
< com::sun::star::report::XGroup
> GroupPropertySet
;
38 /** \class OGroup Defines the implementation of a \interface com:::sun::star::report::XGroup
39 * \ingroup reportdesign_api
42 class OGroup
: public comphelper::OMutexAndBroadcastHelper
44 ,public GroupPropertySet
46 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
47 ::com::sun::star::uno::WeakReference
< ::com::sun::star::report::XGroups
> m_xParent
;
48 ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
> m_xHeader
;
49 ::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
> m_xFooter
;
50 ::com::sun::star::uno::Reference
< ::com::sun::star::report::XFunctions
> m_xFunctions
;
51 ::rptshared::GroupProperties m_aProps
;
54 OGroup
& operator=(const OGroup
&) SAL_DELETED_FUNCTION
;
55 OGroup(const OGroup
&) SAL_DELETED_FUNCTION
;
57 template <typename T
> void set( const OUString
& _sProperty
63 ::osl::MutexGuard
aGuard(m_aMutex
);
64 if ( _member
!= _Value
)
66 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
72 void set( const OUString
& _sProperty
78 ::osl::MutexGuard
aGuard(m_aMutex
);
79 if ( _member
!= _Value
)
81 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
87 void setSection( const OUString
& _sProperty
89 ,const OUString
& _sName
90 ,::com::sun::star::uno::Reference
< ::com::sun::star::report::XSection
>& _member
);
92 // TODO: VirtualFunctionFinder: This is virtual function!
96 /** this function is called upon disposing the component
98 // TODO: VirtualFunctionFinder: This is virtual function!
100 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
102 OGroup(const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XGroups
>& _xParent
103 ,const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& context
);
105 DECLARE_XINTERFACE( )
106 // ::com::sun::star::lang::XServiceInfo
107 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 virtual OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 static ::com::sun::star::uno::Sequence
< OUString
> getSupportedServiceNames_Static() throw( ::com::sun::star::uno::RuntimeException
);
113 // com::sun::star::beans::XPropertySet
114 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 virtual void SAL_CALL
setPropertyValue( const 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
, std::exception
) SAL_OVERRIDE
;
116 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
117 virtual void SAL_CALL
addPropertyChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
118 virtual void SAL_CALL
removePropertyChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
119 virtual void SAL_CALL
addVetoableChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
120 virtual void SAL_CALL
removeVetoableChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
123 virtual sal_Bool SAL_CALL
getSortAscending() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 virtual void SAL_CALL
setSortAscending( sal_Bool _sortascending
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
125 virtual sal_Bool SAL_CALL
getHeaderOn() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
126 virtual void SAL_CALL
setHeaderOn( sal_Bool _headeron
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
127 virtual sal_Bool SAL_CALL
getFooterOn() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
128 virtual void SAL_CALL
setFooterOn( sal_Bool _footeron
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
129 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
, std::exception
) SAL_OVERRIDE
;
130 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
, std::exception
) SAL_OVERRIDE
;
131 virtual ::sal_Int16 SAL_CALL
getGroupOn() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
132 virtual void SAL_CALL
setGroupOn( ::sal_Int16 _groupon
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 virtual ::sal_Int32 SAL_CALL
getGroupInterval() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
134 virtual void SAL_CALL
setGroupInterval( ::sal_Int32 _groupinterval
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
135 virtual ::sal_Int16 SAL_CALL
getKeepTogether() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
136 virtual void SAL_CALL
setKeepTogether( ::sal_Int16 _keeptogether
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
137 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::report::XGroups
> SAL_CALL
getGroups() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
138 virtual OUString SAL_CALL
getExpression() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
139 virtual void SAL_CALL
setExpression( const OUString
& _expression
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
140 virtual sal_Bool SAL_CALL
getStartNewColumn() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
141 virtual void SAL_CALL
setStartNewColumn( sal_Bool _startnewcolumn
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
142 virtual sal_Bool SAL_CALL
getResetPageNumber() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
143 virtual void SAL_CALL
setResetPageNumber( sal_Bool _resetpagenumber
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
146 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::report::XFunctions
> SAL_CALL
getFunctions() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
149 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getParent( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
150 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
, std::exception
) SAL_OVERRIDE
;
153 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
154 virtual void SAL_CALL
addEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
156 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
158 virtual void SAL_CALL
removeEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
160 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
163 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> getContext(){ return m_xContext
; }
166 } // namespace reportdesign
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */