LibreOffice Module chart2 (master) 1
BaseCoordinateSystem.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
21#include "OPropertySet.hxx"
23#include <comphelper/uno3.hxx>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/chart2/XCoordinateSystem.hpp>
26#include <com/sun/star/chart2/XChartTypeContainer.hpp>
27#include <com/sun/star/util/XCloneable.hpp>
29
30#include <vector>
31
32namespace chart
33{
34class Axis;
35class ChartType;
36
37namespace impl
38{
39typedef ::cppu::WeakImplHelper
40 < css::lang::XServiceInfo,
41 css::chart2::XCoordinateSystem,
42 css::chart2::XChartTypeContainer,
43 css::util::XCloneable,
44 css::util::XModifyBroadcaster,
45 css::util::XModifyListener >
47}
48
49class SAL_DLLPUBLIC_RTTI BaseCoordinateSystem :
52{
53public:
54 BaseCoordinateSystem( sal_Int32 nDimensionCount );
55 explicit BaseCoordinateSystem( const BaseCoordinateSystem & rSource );
56 virtual ~BaseCoordinateSystem() override;
57
58 // ____ OPropertySet ____
59 virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
60
61 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
62
63 // ____ XPropertySet ____
64 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
65 getPropertySetInfo() override;
66
71
72 // ____ XCoordinateSystem ____
73 virtual ::sal_Int32 SAL_CALL getDimension() override;
74 virtual void SAL_CALL setAxisByDimension(
75 ::sal_Int32 nDimension,
76 const css::uno::Reference< css::chart2::XAxis >& xAxis,
77 ::sal_Int32 nIndex ) override;
78 virtual css::uno::Reference< css::chart2::XAxis > SAL_CALL getAxisByDimension(
79 ::sal_Int32 nDimension, ::sal_Int32 nIndex ) override;
80 virtual ::sal_Int32 SAL_CALL getMaximumAxisIndexByDimension( ::sal_Int32 nDimension ) override;
81
82 // ____ XChartTypeContainer ____
83 virtual void SAL_CALL addChartType(
84 const css::uno::Reference< css::chart2::XChartType >& aChartType ) override;
85 virtual void SAL_CALL removeChartType(
86 const css::uno::Reference< css::chart2::XChartType >& aChartType ) override;
87 virtual css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > SAL_CALL getChartTypes() override;
88 virtual void SAL_CALL setChartTypes(
89 const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > >& aChartTypes ) final override;
90
91 // ____ XModifyBroadcaster ____
92 virtual void SAL_CALL addModifyListener(
93 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
94 virtual void SAL_CALL removeModifyListener(
95 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
96
97 void setAxisByDimension( sal_Int32 nDimension, const rtl::Reference< ::chart::Axis >& xAxis, sal_Int32 nIndex );
98 const rtl::Reference< ::chart::Axis > & getAxisByDimension2(sal_Int32 nDimension, sal_Int32 nIndex ) const;
99
100 void setChartTypes( const std::vector< rtl::Reference< ::chart::ChartType > >& aChartTypes );
101 const std::vector< rtl::Reference<::chart::ChartType > > & getChartTypes2() const { return m_aChartTypes; }
102
103protected:
104
105 // ____ XModifyListener ____
106 virtual void SAL_CALL modified(
107 const css::lang::EventObject& aEvent ) override;
108
109 // ____ XEventListener (base of XModifyListener) ____
110 virtual void SAL_CALL disposing(
111 const css::lang::EventObject& Source ) override;
112
113 // ____ OPropertySet ____
114 virtual void firePropertyChangeEvent() override;
115 using OPropertySet::disposing;
116
117 void fireModifyEvent();
118
119private:
122 typedef std::vector< std::vector< rtl::Reference< ::chart::Axis > > > tAxisVecVecType;
123 tAxisVecVecType m_aAllAxis; //outer sequence is the dimension; inner sequence is the axis index that indicates main or secondary axis
124 std::vector< rtl::Reference<::chart::ChartType > > m_aChartTypes;
125};
126
127} // namespace chart
128
129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void setChartTypes(const std::vector< rtl::Reference< ::chart::ChartType > > &aChartTypes)
virtual void SAL_CALL setChartTypes(const css::uno::Sequence< css::uno::Reference< css::chart2::XChartType > > &aChartTypes) final override
const std::vector< rtl::Reference<::chart::ChartType > > & getChartTypes2() const
std::vector< rtl::Reference<::chart::ChartType > > m_aChartTypes
virtual void SAL_CALL setAxisByDimension(::sal_Int32 nDimension, const css::uno::Reference< css::chart2::XAxis > &xAxis, ::sal_Int32 nIndex) override
std::vector< std::vector< rtl::Reference< ::chart::Axis > > > tAxisVecVecType
void setAxisByDimension(sal_Int32 nDimension, const rtl::Reference< ::chart::Axis > &xAxis, sal_Int32 nIndex)
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::chart2::XCoordinateSystem, css::chart2::XChartTypeContainer, css::util::XCloneable, css::util::XModifyBroadcaster, css::util::XModifyListener > BaseCoordinateSystem_Base
sal_Int32 nHandle
#define DECLARE_XTYPEPROVIDER()
#define DECLARE_XINTERFACE()