bump product version to 5.0.4.1
[LibreOffice.git] / reportdesign / source / core / inc / Shape.hxx
blob39c14dcbf5cc7c06930d4a6f09ca457bef55be2b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SHAPE_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_SHAPE_HXX
22 #include <cppuhelper/propertysetmixin.hxx>
23 #include <com/sun/star/report/XShape.hpp>
24 #include "ReportControlModel.hxx"
25 #include <cppuhelper/compbase2.hxx>
26 #include <comphelper/broadcasthelper.hxx>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include "ReportHelperDefines.hxx"
29 #include <comphelper/propagg.hxx>
30 #include <memory>
32 namespace reportdesign
34 typedef ::cppu::PropertySetMixin< com::sun::star::report::XShape > ShapePropertySet;
35 typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XShape
36 ,com::sun::star::lang::XServiceInfo > ShapeBase;
38 /** \class OShape Defines the implementation of a \interface com:::sun::star::report::XShape
39 * \ingroup reportdesign_api
42 class OShape : public comphelper::OBaseMutex,
43 public ShapeBase,
44 public ShapePropertySet
46 friend class OShapeHelper;
47 ::std::unique_ptr< ::comphelper::OPropertyArrayAggregationHelper> m_pAggHelper;
48 OReportControlModel m_aProps;
49 com::sun::star::drawing::HomogenMatrix3 m_Transformation;
50 sal_Int32 m_nZOrder;
51 bool m_bOpaque;
53 OUString m_sServiceName;
54 OUString m_CustomShapeEngine;
55 OUString m_CustomShapeData;
56 com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
57 m_CustomShapeGeometry;
59 private:
60 OShape(const OShape&) SAL_DELETED_FUNCTION;
61 OShape& operator=(const OShape&) SAL_DELETED_FUNCTION;
63 template <typename T> void set( const OUString& _sProperty
64 ,const T& _Value
65 ,T& _member)
67 BoundListeners l;
69 ::osl::MutexGuard aGuard(m_aMutex);
70 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
71 _member = _Value;
73 l.notify();
75 void set( const OUString& _sProperty
76 ,bool _Value
77 ,bool& _member)
79 BoundListeners l;
81 ::osl::MutexGuard aGuard(m_aMutex);
82 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
83 _member = _Value;
85 l.notify();
87 void checkIndex(sal_Int32 _nIndex);
88 cppu::IPropertyArrayHelper& getInfoHelper();
89 protected:
90 virtual ~OShape();
91 public:
92 explicit OShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
93 explicit OShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
94 ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
95 ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape
96 ,const OUString& _sServiceName);
98 DECLARE_XINTERFACE( )
99 // ::com::sun::star::lang::XServiceInfo
100 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw( ::com::sun::star::uno::RuntimeException );
105 static OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
106 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
107 create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
108 // com::sun::star::beans::XPropertySet
109 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
110 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;
111 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;
112 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;
113 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;
114 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;
115 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;
117 // XReportComponent
118 REPORTCOMPONENT_HEADER()
120 // XShape
121 SHAPE_HEADER()
123 virtual OUString SAL_CALL getCustomShapeEngine() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
124 virtual void SAL_CALL setCustomShapeEngine( const OUString& _customshapeengine ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 virtual OUString SAL_CALL getCustomShapeData() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
126 virtual void SAL_CALL setCustomShapeData( const OUString& _customshapedata ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCustomShapeGeometry() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 virtual void SAL_CALL setCustomShapeGeometry( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _customshapegeometry ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
130 virtual sal_Bool SAL_CALL getOpaque() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
131 virtual void SAL_CALL setOpaque( sal_Bool _opaque ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 // XShapeDescriptor
134 virtual OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
136 // XReportControlModel
137 REPORTCONTROLMODEL_HEADER()
139 // XReportControlFormat
140 REPORTCONTROLFORMAT_HEADER()
141 // XShape
142 virtual ::sal_Int32 SAL_CALL getZOrder() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
143 virtual void SAL_CALL setZOrder( ::sal_Int32 _zorder ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
144 virtual ::com::sun::star::drawing::HomogenMatrix3 SAL_CALL getTransformation() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
145 virtual void SAL_CALL setTransformation( const ::com::sun::star::drawing::HomogenMatrix3& _transformation ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
147 // XCloneable
148 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 // XComponent
151 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
152 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
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, std::exception) SAL_OVERRIDE
158 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
161 // XChild
162 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 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;
165 // XContainer
166 virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
167 virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
169 // XElementAccess
170 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
171 virtual sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
173 // XIndexReplace
174 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, std::exception) SAL_OVERRIDE;
176 // XIndexContainer
177 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, std::exception) SAL_OVERRIDE;
178 virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
180 // XIndexAccess
181 virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
182 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, std::exception) SAL_OVERRIDE;
185 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_SHAPE_HXX
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */