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_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
: public cppu::BaseMutex
,
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
;
56 OFixedLine(const OFixedLine
&) = delete;
57 OFixedLine
& operator=(const OFixedLine
&) = delete;
59 template <typename T
> void set( const OUString
& _sProperty
65 ::osl::MutexGuard
aGuard(m_aMutex
);
66 prepareSet(_sProperty
, css::uno::makeAny(_member
), css::uno::makeAny(Value
), &l
);
72 virtual ~OFixedLine() override
;
74 explicit OFixedLine(css::uno::Reference
< css::uno::XComponentContext
> const & _xContext
);
75 explicit OFixedLine(css::uno::Reference
< css::uno::XComponentContext
> const & _xContext
76 ,const css::uno::Reference
< css::lang::XMultiServiceFactory
> & _xFactory
77 ,css::uno::Reference
< css::drawing::XShape
>& _xShape
78 ,sal_Int32 _nOrientation
);
81 // css::lang::XServiceInfo
82 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
83 virtual OUString SAL_CALL
getImplementationName( ) override
;
84 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
86 /// @throws css::uno::RuntimeException
87 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
88 /// @throws css::uno::RuntimeException
89 static OUString
getImplementationName_Static();
90 static css::uno::Reference
< css::uno::XInterface
>
91 create(css::uno::Reference
< css::uno::XComponentContext
> const & xContext
);
92 // css::beans::XPropertySet
93 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
94 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
95 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
96 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
97 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
98 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
99 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
102 REPORTCOMPONENT_HEADER()
108 virtual OUString SAL_CALL
getShapeType( ) override
;
110 // XReportControlModel
111 REPORTCONTROLMODEL_HEADER()
114 virtual ::sal_Int32 SAL_CALL
getOrientation() override
;
115 virtual void SAL_CALL
setOrientation( ::sal_Int32 _orientation
) override
;
116 virtual css::drawing::LineStyle SAL_CALL
getLineStyle() override
;
117 virtual void SAL_CALL
setLineStyle( css::drawing::LineStyle _linestyle
) override
;
118 virtual css::drawing::LineDash SAL_CALL
getLineDash() override
;
119 virtual void SAL_CALL
setLineDash( const css::drawing::LineDash
& _linedash
) override
;
120 virtual ::sal_Int32 SAL_CALL
getLineColor() override
;
121 virtual void SAL_CALL
setLineColor( ::sal_Int32 _linecolor
) override
;
122 virtual ::sal_Int16 SAL_CALL
getLineTransparence() override
;
123 virtual void SAL_CALL
setLineTransparence( ::sal_Int16 _linetransparence
) override
;
124 virtual ::sal_Int32 SAL_CALL
getLineWidth() override
;
125 virtual void SAL_CALL
setLineWidth( ::sal_Int32 _linewidth
) override
;
127 // css::report::XReportControlFormat
128 REPORTCONTROLFORMAT_HEADER()
131 virtual css::uno::Reference
< css::util::XCloneable
> SAL_CALL
createClone( ) override
;
134 virtual void SAL_CALL
dispose() override
;
135 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
137 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
139 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
141 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
145 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getParent( ) override
;
146 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& Parent
) override
;
149 virtual void SAL_CALL
addContainerListener( const css::uno::Reference
< css::container::XContainerListener
>& xListener
) override
;
150 virtual void SAL_CALL
removeContainerListener( const css::uno::Reference
< css::container::XContainerListener
>& xListener
) override
;
153 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
154 virtual sal_Bool SAL_CALL
hasElements( ) override
;
157 virtual void SAL_CALL
replaceByIndex( ::sal_Int32 Index
, const css::uno::Any
& Element
) override
;
160 virtual void SAL_CALL
insertByIndex( ::sal_Int32 Index
, const css::uno::Any
& Element
) override
;
161 virtual void SAL_CALL
removeByIndex( ::sal_Int32 Index
) override
;
164 virtual ::sal_Int32 SAL_CALL
getCount( ) override
;
165 virtual css::uno::Any SAL_CALL
getByIndex( ::sal_Int32 Index
) override
;
168 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDLINE_HXX
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */