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 
87  static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
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;
100 
101  // XReportComponent
103 
104  // XShape
105  SHAPE_HEADER()
106 
107  // XShapeDescriptor
108  virtual OUString SAL_CALL getShapeType( ) override;
109 
110  // XReportControlModel
112 
113  // XFixedLine
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;
126 
127  // css::report::XReportControlFormat
129 
130  // XCloneable
131  virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
132 
133  // XComponent
134  virtual void SAL_CALL dispose() override;
135  virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
136  {
137  cppu::WeakComponentImplHelperBase::addEventListener(aListener);
138  }
139  virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
140  {
141  cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
142  }
143 
144  // XChild
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;
147 
148  // XContainer
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;
151 
152  // XElementAccess
153  virtual css::uno::Type SAL_CALL getElementType( ) override;
154  virtual sal_Bool SAL_CALL hasElements( ) override;
155 
156  // XIndexReplace
157  virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
158 
159  // XIndexContainer
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;
162 
163  // XIndexAccess
164  virtual ::sal_Int32 SAL_CALL getCount( ) override;
165  virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override;
166  };
167 }
168 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDLINE_HXX
169 
170 /* 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:458
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: FixedLine.cxx:261
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: FixedLine.cxx:271
virtual css::uno::Type SAL_CALL getElementType() override
Definition: FixedLine.cxx:453
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:517
#define REPORTCONTROLFORMAT_HEADER()
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: FixedLine.cxx:286
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: FixedLine.cxx:426
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
Definition: FixedLine.cxx:348
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: FixedLine.cxx:276
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: FixedLine.cxx:291
LineStyle
static css::uno::Reference< css::uno::XInterface > create(css::uno::Reference< css::uno::XComponentContext > const &xContext)
Definition: FixedLine.cxx:221
virtual ::sal_Int32 SAL_CALL getLineWidth() override
Definition: FixedLine.cxx:413
#define REPORTCOMPONENT_HEADER()
virtual void SAL_CALL setLineColor(::sal_Int32 _linecolor) override
Definition: FixedLine.cxx:397
virtual ::sal_Int32 SAL_CALL getCount() override
Definition: FixedLine.cxx:481
virtual void SAL_CALL setOrientation(::sal_Int32 _orientation) override
Definition: FixedLine.cxx:364
virtual void SAL_CALL insertByIndex(::sal_Int32 Index, const css::uno::Any &Element) override
Definition: FixedLine.cxx:464
virtual void SAL_CALL removeByIndex(::sal_Int32 Index) override
Definition: FixedLine.cxx:469
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: FixedLine.cxx:281
virtual ::sal_Int32 SAL_CALL getOrientation() override
Definition: FixedLine.cxx:358
OFixedLine(const OFixedLine &)=delete
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: FixedLine.cxx:266
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:431
#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:475
css::drawing::LineDash m_LineDash
Definition: FixedLine.hxx:49
virtual css::uno::Any SAL_CALL getByIndex(::sal_Int32 Index) override
Definition: FixedLine.cxx:486
virtual void SAL_CALL setLineTransparence(::sal_Int16 _linetransparence) override
Definition: FixedLine.cxx:408
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: FixedLine.cxx:442
OReportControlModel m_aProps
Definition: FixedLine.hxx:47
virtual void SAL_CALL setLineStyle(css::drawing::LineStyle _linestyle) override
Definition: FixedLine.cxx:375
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: FixedLine.cxx:447
::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:402
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: FixedLine.hxx:139
css::drawing::LineStyle m_LineStyle
Definition: FixedLine.hxx:48
static OUString getImplementationName_Static()
Definition: FixedLine.cxx:203
virtual css::drawing::LineStyle SAL_CALL getLineStyle() override
Definition: FixedLine.cxx:369
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: FixedLine.cxx:227
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
Definition: FixedLine.cxx:214
#define REPORTCONTROLMODEL_HEADER()
virtual void SAL_CALL setLineWidth(::sal_Int32 _linewidth) override
Definition: FixedLine.cxx:419
OFixedLine & operator=(const OFixedLine &)=delete
virtual css::drawing::LineDash SAL_CALL getLineDash() override
Definition: FixedLine.cxx:380
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: FixedLine.hxx:135
struct _ADOIndex Index
virtual ::sal_Int32 SAL_CALL getLineColor() override
Definition: FixedLine.cxx:391
#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:386
virtual OUString SAL_CALL getImplementationName() override
Definition: FixedLine.cxx:209
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: FixedLine.cxx:232