bump product version to 4.1.6.2
[LibreOffice.git] / chart2 / source / model / inc / BaseCoordinateSystem.hxx
blob122faee3dfbe2b68a2eccdfec8cb17e3134cc4ed
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 #ifndef CHART_COORDINATESYSTEM_HXX
20 #define CHART_COORDINATESYSTEM_HXX
22 #include "ServiceMacros.hxx"
23 #include "OPropertySet.hxx"
24 #include "MutexContainer.hxx"
25 #include <cppuhelper/implbase6.hxx>
26 #include <comphelper/uno3.hxx>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
30 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
31 #include <com/sun/star/util/XCloneable.hpp>
32 #include <com/sun/star/util/XModifyBroadcaster.hpp>
33 #include <com/sun/star/util/XModifyListener.hpp>
35 #include <vector>
37 namespace chart
40 namespace impl
42 typedef ::cppu::WeakImplHelper6
43 < ::com::sun::star::lang::XServiceInfo,
44 ::com::sun::star::chart2::XCoordinateSystem,
45 ::com::sun::star::chart2::XChartTypeContainer,
46 ::com::sun::star::util::XCloneable,
47 ::com::sun::star::util::XModifyBroadcaster,
48 ::com::sun::star::util::XModifyListener >
49 BaseCoordinateSystem_Base;
52 class BaseCoordinateSystem :
53 public impl::BaseCoordinateSystem_Base,
54 public MutexContainer,
55 public ::property::OPropertySet
57 public:
58 BaseCoordinateSystem(
59 const ::com::sun::star::uno::Reference<
60 ::com::sun::star::uno::XComponentContext > & xContext,
61 sal_Int32 nDimensionCount = 2,
62 sal_Bool bSwapXAndYAxis = sal_False );
63 explicit BaseCoordinateSystem( const BaseCoordinateSystem & rSource );
64 virtual ~BaseCoordinateSystem();
66 // ____ OPropertySet ____
67 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
68 throw(::com::sun::star::beans::UnknownPropertyException);
70 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
72 // ____ XPropertySet ____
73 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
74 getPropertySetInfo()
75 throw (::com::sun::star::uno::RuntimeException);
77 /// merge XInterface implementations
78 DECLARE_XINTERFACE()
79 /// merge XTypeProvider implementations
80 DECLARE_XTYPEPROVIDER()
82 protected:
83 // ____ XCoordinateSystem ____
84 virtual ::sal_Int32 SAL_CALL getDimension()
85 throw (::com::sun::star::uno::RuntimeException);
86 virtual void SAL_CALL setAxisByDimension(
87 ::sal_Int32 nDimension,
88 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis,
89 ::sal_Int32 nIndex )
90 throw (::com::sun::star::lang::IndexOutOfBoundsException,
91 ::com::sun::star::uno::RuntimeException);
92 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > SAL_CALL getAxisByDimension(
93 ::sal_Int32 nDimension, ::sal_Int32 nIndex )
94 throw (::com::sun::star::lang::IndexOutOfBoundsException,
95 ::com::sun::star::uno::RuntimeException);
96 virtual ::sal_Int32 SAL_CALL getMaximumAxisIndexByDimension( ::sal_Int32 nDimension )
97 throw (::com::sun::star::lang::IndexOutOfBoundsException,
98 ::com::sun::star::uno::RuntimeException);
100 // ____ XChartTypeContainer ____
101 virtual void SAL_CALL addChartType(
102 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& aChartType )
103 throw (::com::sun::star::lang::IllegalArgumentException,
104 ::com::sun::star::uno::RuntimeException);
105 virtual void SAL_CALL removeChartType(
106 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& aChartType )
107 throw (::com::sun::star::container::NoSuchElementException,
108 ::com::sun::star::uno::RuntimeException);
109 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > > SAL_CALL getChartTypes()
110 throw (::com::sun::star::uno::RuntimeException);
111 virtual void SAL_CALL setChartTypes(
112 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > >& aChartTypes )
113 throw (::com::sun::star::lang::IllegalArgumentException,
114 ::com::sun::star::uno::RuntimeException);
116 // ____ XModifyBroadcaster ____
117 virtual void SAL_CALL addModifyListener(
118 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
119 throw (::com::sun::star::uno::RuntimeException);
120 virtual void SAL_CALL removeModifyListener(
121 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
122 throw (::com::sun::star::uno::RuntimeException);
124 // ____ XModifyListener ____
125 virtual void SAL_CALL modified(
126 const ::com::sun::star::lang::EventObject& aEvent )
127 throw (::com::sun::star::uno::RuntimeException);
129 // ____ XEventListener (base of XModifyListener) ____
130 virtual void SAL_CALL disposing(
131 const ::com::sun::star::lang::EventObject& Source )
132 throw (::com::sun::star::uno::RuntimeException);
134 // ____ OPropertySet ____
135 virtual void firePropertyChangeEvent();
136 using OPropertySet::disposing;
138 void fireModifyEvent();
140 protected:
141 ::com::sun::star::uno::Reference<
142 ::com::sun::star::uno::XComponentContext > m_xContext;
144 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
146 private:
147 sal_Int32 m_nDimensionCount;
148 typedef ::std::vector< ::std::vector< ::com::sun::star::uno::Reference<
149 ::com::sun::star::chart2::XAxis > > > tAxisVecVecType;
150 tAxisVecVecType m_aAllAxis; //outer sequence is the dimension; inner sequence is the axis index that indicates main or secondary axis
151 ::com::sun::star::uno::Sequence<
152 ::com::sun::star::uno::Any > m_aOrigin;
153 ::std::vector< ::com::sun::star::uno::Reference<
154 ::com::sun::star::chart2::XChartType > > m_aChartTypes;
157 } // namespace chart
159 // CHART_COORDINATESYSTEM_HXX
160 #endif
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */