LibreOffice Module reportdesign (master)  1
FixedLine.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDLINE_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDLINE_HXX
21 
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>
30 
31 
32 namespace reportdesign
33 {
34  typedef ::cppu::PropertySetMixin< css::report::XFixedLine > FixedLinePropertySet;
35  typedef ::cppu::WeakComponentImplHelper< css::report::XFixedLine
36  ,css::lang::XServiceInfo > FixedLineBase;
37 
42  class OFixedLine : public cppu::BaseMutex,
43  public FixedLineBase,
44  public FixedLinePropertySet
45  {
46  friend class OShapeHelper;
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;
54 
55  private:
56  OFixedLine(const OFixedLine&) = delete;
57  OFixedLine& operator=(const OFixedLine&) = delete;
58 
59  template <typename T> void set( const OUString& _sProperty
60  ,const T& Value
61  ,T& _member)
62  {
63  BoundListeners l;
64  {
65  ::osl::MutexGuard aGuard(m_aMutex);
66  prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
67  _member = Value;
68  }
69  l.notify();
70  }
71  protected:
72  virtual ~OFixedLine() override;
73  public:
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);
79 
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;
85 
86  // css::beans::XPropertySet
87  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
88  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
89  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
90  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
91  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
92  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
93  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
94 
95  // XReportComponent
97 
98  // XShape
99  SHAPE_HEADER()
100 
101  // XShapeDescriptor
102  virtual OUString SAL_CALL getShapeType( ) override;
103 
104  // XReportControlModel
106 
107  // XFixedLine
108  virtual ::sal_Int32 SAL_CALL getOrientation() override;
109  virtual void SAL_CALL setOrientation( ::sal_Int32 _orientation ) override;
110  virtual css::drawing::LineStyle SAL_CALL getLineStyle() override;
111  virtual void SAL_CALL setLineStyle( css::drawing::LineStyle _linestyle ) override;
112  virtual css::drawing::LineDash SAL_CALL getLineDash() override;
113  virtual void SAL_CALL setLineDash( const css::drawing::LineDash& _linedash ) override;
114  virtual ::sal_Int32 SAL_CALL getLineColor() override;
115  virtual void SAL_CALL setLineColor( ::sal_Int32 _linecolor ) override;
116  virtual ::sal_Int16 SAL_CALL getLineTransparence() override;
117  virtual void SAL_CALL setLineTransparence( ::sal_Int16 _linetransparence ) override;
118  virtual ::sal_Int32 SAL_CALL getLineWidth() override;
119  virtual void SAL_CALL setLineWidth( ::sal_Int32 _linewidth ) override;
120 
121  // css::report::XReportControlFormat
123 
124  // XCloneable
125  virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
126 
127  // XComponent
128  virtual void SAL_CALL dispose() override;
129  virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
130  {
131  cppu::WeakComponentImplHelperBase::addEventListener(aListener);
132  }
133  virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
134  {
135  cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
136  }
137 
138  // XChild
139  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
140  virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
141 
142  // XContainer
143  virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
144  virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
145 
146  // XElementAccess
147  virtual css::uno::Type SAL_CALL getElementType( ) override;
148  virtual sal_Bool SAL_CALL hasElements( ) override;
149 
150  // XIndexReplace
151  virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
152 
153  // XIndexContainer
154  virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
155  virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) override;
156 
157  // XIndexAccess
158  virtual ::sal_Int32 SAL_CALL getCount( ) override;
159  virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override;
160  };
161 }
162 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDLINE_HXX
163 
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL dispose() override
Definition: FixedLine.cxx:197
virtual sal_Bool SAL_CALL hasElements() override
Definition: FixedLine.cxx:439
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: FixedLine.cxx:242
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: FixedLine.cxx:252
virtual css::uno::Type SAL_CALL getElementType() override
Definition: FixedLine.cxx:434
void set(const OUString &_sProperty, const T &Value, T &_member)
Definition: FixedLine.hxx:59
mutable::osl::Mutex m_aMutex
virtual OUString SAL_CALL getShapeType() override
Definition: FixedLine.cxx:498
#define REPORTCONTROLFORMAT_HEADER()
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: FixedLine.cxx:267
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: FixedLine.cxx:407
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
Definition: FixedLine.cxx:329
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: FixedLine.cxx:257
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: FixedLine.cxx:272
LineStyle
virtual ::sal_Int32 SAL_CALL getLineWidth() override
Definition: FixedLine.cxx:394
#define REPORTCOMPONENT_HEADER()
virtual void SAL_CALL setLineColor(::sal_Int32 _linecolor) override
Definition: FixedLine.cxx:378
virtual ::sal_Int32 SAL_CALL getCount() override
Definition: FixedLine.cxx:462
virtual void SAL_CALL setOrientation(::sal_Int32 _orientation) override
Definition: FixedLine.cxx:345
virtual void SAL_CALL insertByIndex(::sal_Int32 Index, const css::uno::Any &Element) override
Definition: FixedLine.cxx:445
virtual void SAL_CALL removeByIndex(::sal_Int32 Index) override
Definition: FixedLine.cxx:450
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: FixedLine.cxx:262
virtual ::sal_Int32 SAL_CALL getOrientation() override
Definition: FixedLine.cxx:339
OFixedLine(const OFixedLine &)=delete
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: FixedLine.cxx:247
implementation of a
Definition: FixedLine.hxx:42
virtual ~OFixedLine() override
Definition: FixedLine.cxx:180
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: FixedLine.cxx:412
#define SHAPE_HEADER()
unsigned char sal_Bool
::cppu::PropertySetMixin< css::report::XFixedLine > FixedLinePropertySet
Definition: FixedLine.hxx:34
virtual void SAL_CALL replaceByIndex(::sal_Int32 Index, const css::uno::Any &Element) override
Definition: FixedLine.cxx:456
css::drawing::LineDash m_LineDash
Definition: FixedLine.hxx:49
virtual css::uno::Any SAL_CALL getByIndex(::sal_Int32 Index) override
Definition: FixedLine.cxx:467
virtual void SAL_CALL setLineTransparence(::sal_Int16 _linetransparence) override
Definition: FixedLine.cxx:389
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: FixedLine.cxx:423
OReportControlModel m_aProps
Definition: FixedLine.hxx:47
virtual void SAL_CALL setLineStyle(css::drawing::LineStyle _linestyle) override
Definition: FixedLine.cxx:356
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: FixedLine.cxx:428
::sal_Int16 m_LineTransparence
Definition: FixedLine.hxx:52
void prepareSet(rtl::OUString const &propertyName, css::uno::Any const &oldValue, css::uno::Any const &newValue, BoundListeners *boundListeners)
virtual ::sal_Int16 SAL_CALL getLineTransparence() override
Definition: FixedLine.cxx:383
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: FixedLine.hxx:133
css::drawing::LineStyle m_LineStyle
Definition: FixedLine.hxx:48
virtual css::drawing::LineStyle SAL_CALL getLineStyle() override
Definition: FixedLine.cxx:350
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: FixedLine.cxx:208
#define REPORTCONTROLMODEL_HEADER()
virtual void SAL_CALL setLineWidth(::sal_Int32 _linewidth) override
Definition: FixedLine.cxx:400
OFixedLine & operator=(const OFixedLine &)=delete
virtual css::drawing::LineDash SAL_CALL getLineDash() override
Definition: FixedLine.cxx:361
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: FixedLine.hxx:129
struct _ADOIndex Index
virtual ::sal_Int32 SAL_CALL getLineColor() override
Definition: FixedLine.cxx:372
#define DECLARE_XINTERFACE()
::cppu::WeakComponentImplHelper< css::report::XFixedLine,css::lang::XServiceInfo > FixedLineBase
Definition: FixedLine.hxx:36
virtual void SAL_CALL setLineDash(const css::drawing::LineDash &_linedash) override
Definition: FixedLine.cxx:367
virtual OUString SAL_CALL getImplementationName() override
Definition: FixedLine.cxx:203
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: FixedLine.cxx:213