cid#1634585 Use of auto that causes a copy
[libreoffice.git] / chart2 / source / inc / ErrorBar.hxx
blob939b95c739e84987f02861e459e2fe315e1a60e9
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 #pragma once
21 #include <config_options.h>
22 #include "charttoolsdllapi.hxx"
24 #include <cppuhelper/implbase.hxx>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/beans/XPropertyState.hpp>
28 #include <com/sun/star/chart2/data/XDataSink.hpp>
29 #include <com/sun/star/chart2/data/XDataSource.hpp>
30 #include <com/sun/star/drawing/LineStyle.hpp>
31 #include <com/sun/star/drawing/LineJoint.hpp>
32 #include <com/sun/star/drawing/LineDash.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/uno/Any.h>
35 #include <com/sun/star/util/XCloneable.hpp>
36 #include <com/sun/star/util/Color.hpp>
37 #include <com/sun/star/util/XModifyListener.hpp>
38 #include "ModifyListenerHelper.hxx"
41 #include <vector>
43 namespace chart
46 namespace impl
48 typedef ::cppu::WeakImplHelper<
49 css::lang::XServiceInfo,
50 css::util::XCloneable,
51 css::util::XModifyBroadcaster,
52 css::util::XModifyListener,
53 css::chart2::data::XDataSource,
54 css::chart2::data::XDataSink,
55 css::beans::XPropertySet,
56 css::beans::XPropertyState >
57 ErrorBar_Base;
60 class ErrorBar final : public impl::ErrorBar_Base
62 private:
63 OUString maDashName;
64 css::drawing::LineDash maLineDash;
65 sal_Int32 mnLineWidth;
66 css::drawing::LineStyle meLineStyle;
67 css::util::Color maLineColor;
68 sal_Int16 mnLineTransparence;
69 css::drawing::LineJoint meLineJoint;
70 bool mbShowPositiveError;
71 bool mbShowNegativeError;
72 double mfPositiveError;
73 double mfNegativeError;
74 double mfWeight;
75 sal_Int32 meStyle;
77 public:
78 UNLESS_MERGELIBS(OOO_DLLPUBLIC_CHARTTOOLS) explicit ErrorBar();
79 virtual ~ErrorBar() override;
81 /// XServiceInfo declarations
82 virtual OUString SAL_CALL getImplementationName() override;
83 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
84 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
86 // XPropertySet
87 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
88 getPropertySetInfo() override;
89 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
90 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
91 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
92 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
93 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
94 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
96 // XPropertyState
97 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& rPropName ) override;
98 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(
99 const css::uno::Sequence< OUString >& rPropNames ) override;
100 virtual void SAL_CALL setPropertyToDefault( const OUString& rPropName ) override;
101 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& rPropName ) override;
103 private:
104 ErrorBar( const ErrorBar & rOther );
106 // ____ XCloneable ____
107 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
109 // ____ XModifyBroadcaster ____
110 virtual void SAL_CALL addModifyListener(
111 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
112 virtual void SAL_CALL removeModifyListener(
113 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
115 // ____ XModifyListener ____
116 virtual void SAL_CALL modified(
117 const css::lang::EventObject& aEvent ) override;
119 // ____ XEventListener (base of XModifyListener) ____
120 virtual void SAL_CALL disposing(
121 const css::lang::EventObject& Source ) override;
123 // ____ XDataSink ____
124 virtual void SAL_CALL setData( const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > >& aData ) override;
126 // ____ XDataSource ____
127 virtual css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences() override;
129 typedef std::vector< css::uno::Reference<
130 css::chart2::data::XLabeledDataSequence > > tDataSequenceContainer;
131 tDataSequenceContainer m_aDataSequences;
133 rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
136 } // namespace chart
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */