cid#1636693 COPY_INSTEAD_OF_MOVE
[LibreOffice.git] / reportdesign / source / core / inc / FixedLine.hxx
blob7014ef1538f111c26a7cb9d8e927a86740d027e3
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_FIXEDLINE_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDLINE_HXX
22 #include <cppuhelper/propertysetmixin.hxx>
23 #include <com/sun/star/report/XFixedLine.hpp>
24 #include "ReportControlModel.hxx"
25 #include <comphelper/uno3.hxx>
26 #include <cppuhelper/compbase.hxx>
27 #include <cppuhelper/basemutex.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <ReportHelperDefines.hxx>
32 namespace reportdesign
34 typedef ::cppu::PropertySetMixin< css::report::XFixedLine > FixedLinePropertySet;
35 typedef ::cppu::WeakComponentImplHelper< css::report::XFixedLine
36 ,css::lang::XServiceInfo > FixedLineBase;
38 /** \class OFixedLine Defines the implementation of a \interface com:::sun::star::report::XFixedLine
39 * \ingroup reportdesign_api
42 class OFixedLine final : public cppu::BaseMutex,
43 public FixedLineBase,
44 public FixedLinePropertySet
46 friend class OShapeHelper;
47 OReportControlModel m_aProps;
48 css::drawing::LineStyle m_LineStyle;
49 css::drawing::LineDash m_LineDash;
50 sal_Int32 m_nOrientation;
51 ::sal_Int32 m_LineColor;
52 ::sal_Int16 m_LineTransparence;
53 ::sal_Int32 m_LineWidth;
55 private:
56 OFixedLine(const OFixedLine&) = delete;
57 OFixedLine& operator=(const OFixedLine&) = delete;
59 template <typename T> void set( const OUString& _sProperty
60 ,const T& Value
61 ,T& _member)
63 BoundListeners l;
65 ::osl::MutexGuard aGuard(m_aMutex);
66 prepareSet(_sProperty, css::uno::Any(_member), css::uno::Any(Value), &l);
67 _member = Value;
69 l.notify();
71 virtual ~OFixedLine() override;
72 public:
73 explicit OFixedLine(css::uno::Reference< css::uno::XComponentContext > const & _xContext);
74 explicit OFixedLine(css::uno::Reference< css::uno::XComponentContext > const & _xContext
75 ,const css::uno::Reference< css::lang::XMultiServiceFactory > & _xFactory
76 ,css::uno::Reference< css::drawing::XShape >& _xShape
77 ,sal_Int32 _nOrientation);
79 DECLARE_XINTERFACE( )
80 // css::lang::XServiceInfo
81 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
82 virtual OUString SAL_CALL getImplementationName( ) override;
83 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
85 /// @throws css::uno::RuntimeException
86 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
87 /// @throws css::uno::RuntimeException
88 static OUString getImplementationName_Static();
89 static css::uno::Reference< css::uno::XInterface >
90 create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
91 // css::beans::XPropertySet
92 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
93 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
94 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
95 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
96 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
97 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
98 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
100 // XReportComponent
101 REPORTCOMPONENT_HEADER()
103 // XShape
104 SHAPE_HEADER()
106 // XShapeDescriptor
107 virtual OUString SAL_CALL getShapeType( ) override;
109 // XReportControlModel
110 REPORTCONTROLMODEL_HEADER()
112 // XFixedLine
113 virtual ::sal_Int32 SAL_CALL getOrientation() override;
114 virtual void SAL_CALL setOrientation( ::sal_Int32 _orientation ) override;
115 virtual css::drawing::LineStyle SAL_CALL getLineStyle() override;
116 virtual void SAL_CALL setLineStyle( css::drawing::LineStyle _linestyle ) override;
117 virtual css::drawing::LineDash SAL_CALL getLineDash() override;
118 virtual void SAL_CALL setLineDash( const css::drawing::LineDash& _linedash ) override;
119 virtual ::sal_Int32 SAL_CALL getLineColor() override;
120 virtual void SAL_CALL setLineColor( ::sal_Int32 _linecolor ) override;
121 virtual ::sal_Int16 SAL_CALL getLineTransparence() override;
122 virtual void SAL_CALL setLineTransparence( ::sal_Int16 _linetransparence ) override;
123 virtual ::sal_Int32 SAL_CALL getLineWidth() override;
124 virtual void SAL_CALL setLineWidth( ::sal_Int32 _linewidth ) override;
126 // css::report::XReportControlFormat
127 REPORTCONTROLFORMAT_HEADER()
129 // XCloneable
130 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
132 // XComponent
133 virtual void SAL_CALL dispose() override;
134 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
136 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
138 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
140 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
143 // XChild
144 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
145 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
147 // XContainer
148 virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
149 virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
151 // XElementAccess
152 virtual css::uno::Type SAL_CALL getElementType( ) override;
153 virtual sal_Bool SAL_CALL hasElements( ) override;
155 // XIndexReplace
156 virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
158 // XIndexContainer
159 virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
160 virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) override;
162 // XIndexAccess
163 virtual ::sal_Int32 SAL_CALL getCount( ) override;
164 virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override;
167 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDLINE_HXX
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */