LibreOffice Module chart2 (master) 1
DataSeriesPointWrapper.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#pragma once
20
25#include <com/sun/star/lang/XComponent.hpp>
26#include <com/sun/star/lang/XEventListener.hpp>
27#include <com/sun/star/lang/XInitialization.hpp>
28#include <com/sun/star/lang/XServiceInfo.hpp>
29#include <rtl/ref.hxx>
30#include <memory>
31
32namespace com::sun::star::chart2 { class XDataSeries; }
33namespace chart { class DataSeries; }
34
35namespace chart::wrapper
36{
37
38class Chart2ModelContact;
39
40class DataSeriesPointWrapper final : public ::cppu::ImplInheritanceHelper<
41 WrappedPropertySet
42 , css::lang::XServiceInfo
43 , css::lang::XInitialization
44 , css::lang::XComponent
45 , css::lang::XEventListener
46 >
48
49{
50public:
51 enum eType
52 {
55 };
56
57 //this constructor needs an initialize call afterwards
58 explicit DataSeriesPointWrapper(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
59
61 , sal_Int32 nSeriesIndexInNewAPI
62 , sal_Int32 nPointIndex //ignored for series
63 , std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
64
65 virtual ~DataSeriesPointWrapper() override;
66
68 bool isLinesForbidden() const { return !m_bLinesAllowed;}
69
71 virtual OUString SAL_CALL getImplementationName() override;
72 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
73 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
74
75 // ___lang::XInitialization___
76 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
77
78 //ReferenceSizePropertyProvider
79 virtual void updateReferenceSize() override;
80 virtual css::uno::Any getReferenceSize() override;
81 virtual css::awt::Size getCurrentSizeForReference() override;
82
83private:
84 // ____ XComponent ____
85 virtual void SAL_CALL dispose() override;
86 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
87 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
88
89 // ____ XEventListener ____
90 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
91
92 // ____ WrappedPropertySet ____
93 virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override;
94 virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override;
95 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
96 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
97 virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override;
98
99 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
100 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
101 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
102
103 //own methods
105 css::uno::Reference< css::beans::XPropertySet > getDataPointProperties();
106
107 std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
109
112 sal_Int32 m_nPointIndex;
113
115
116 //this should only be used, if the DataSeriesPointWrapper is initialized via the XInitialize interface
117 //because a big change in the chartmodel may lead to a dataseriespointer that is not connected to the model anymore
118 //with the indices instead we can always get the new dataseries
120};
121
122} // namespace chart::wrapper
123
124/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual OUString SAL_CALL getImplementationName() override
XServiceInfo declarations.
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
DataSeriesPointWrapper(std::shared_ptr< Chart2ModelContact > spChart2ModelContact)
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact
rtl::Reference< ::chart::DataSeries > getDataSeries()
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL dispose() override
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_aEventListenerContainer
virtual std::vector< std::unique_ptr< WrappedProperty > > createWrappedProperties() override
virtual css::awt::Size getCurrentSizeForReference() override
rtl::Reference< ::chart::DataSeries > m_xDataSeries
virtual css::uno::Any getReferenceSize() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
css::uno::Reference< css::beans::XPropertySet > getDataPointProperties()
virtual const css::uno::Sequence< css::beans::Property > & getPropertySequence() override
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
unsigned char sal_Bool