1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski #ifndef CHART_COORDINATESYSTEM_HXX 24*b1cdbd2cSJim Jagielski #define CHART_COORDINATESYSTEM_HXX 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski #include "ServiceMacros.hxx" 27*b1cdbd2cSJim Jagielski #include "OPropertySet.hxx" 28*b1cdbd2cSJim Jagielski #include "MutexContainer.hxx" 29*b1cdbd2cSJim Jagielski #include <cppuhelper/implbase6.hxx> 30*b1cdbd2cSJim Jagielski #include <comphelper/uno3.hxx> 31*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XServiceInfo.hpp> 32*b1cdbd2cSJim Jagielski #include <com/sun/star/uno/XComponentContext.hpp> 33*b1cdbd2cSJim Jagielski #include <com/sun/star/chart2/XCoordinateSystem.hpp> 34*b1cdbd2cSJim Jagielski #include <com/sun/star/chart2/XChartTypeContainer.hpp> 35*b1cdbd2cSJim Jagielski #include <com/sun/star/util/XCloneable.hpp> 36*b1cdbd2cSJim Jagielski #include <com/sun/star/util/XModifyBroadcaster.hpp> 37*b1cdbd2cSJim Jagielski #include <com/sun/star/util/XModifyListener.hpp> 38*b1cdbd2cSJim Jagielski 39*b1cdbd2cSJim Jagielski #include <vector> 40*b1cdbd2cSJim Jagielski 41*b1cdbd2cSJim Jagielski namespace chart 42*b1cdbd2cSJim Jagielski { 43*b1cdbd2cSJim Jagielski 44*b1cdbd2cSJim Jagielski namespace impl 45*b1cdbd2cSJim Jagielski { 46*b1cdbd2cSJim Jagielski typedef ::cppu::WeakImplHelper6 47*b1cdbd2cSJim Jagielski < ::com::sun::star::lang::XServiceInfo, 48*b1cdbd2cSJim Jagielski ::com::sun::star::chart2::XCoordinateSystem, 49*b1cdbd2cSJim Jagielski ::com::sun::star::chart2::XChartTypeContainer, 50*b1cdbd2cSJim Jagielski ::com::sun::star::util::XCloneable, 51*b1cdbd2cSJim Jagielski ::com::sun::star::util::XModifyBroadcaster, 52*b1cdbd2cSJim Jagielski ::com::sun::star::util::XModifyListener > 53*b1cdbd2cSJim Jagielski BaseCoordinateSystem_Base; 54*b1cdbd2cSJim Jagielski } 55*b1cdbd2cSJim Jagielski 56*b1cdbd2cSJim Jagielski class BaseCoordinateSystem : 57*b1cdbd2cSJim Jagielski public impl::BaseCoordinateSystem_Base, 58*b1cdbd2cSJim Jagielski public MutexContainer, 59*b1cdbd2cSJim Jagielski public ::property::OPropertySet 60*b1cdbd2cSJim Jagielski { 61*b1cdbd2cSJim Jagielski public: 62*b1cdbd2cSJim Jagielski BaseCoordinateSystem( 63*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< 64*b1cdbd2cSJim Jagielski ::com::sun::star::uno::XComponentContext > & xContext, 65*b1cdbd2cSJim Jagielski sal_Int32 nDimensionCount = 2, 66*b1cdbd2cSJim Jagielski sal_Bool bSwapXAndYAxis = sal_False ); 67*b1cdbd2cSJim Jagielski explicit BaseCoordinateSystem( const BaseCoordinateSystem & rSource ); 68*b1cdbd2cSJim Jagielski virtual ~BaseCoordinateSystem(); 69*b1cdbd2cSJim Jagielski 70*b1cdbd2cSJim Jagielski // ____ OPropertySet ____ 71*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const 72*b1cdbd2cSJim Jagielski throw(::com::sun::star::beans::UnknownPropertyException); 73*b1cdbd2cSJim Jagielski 74*b1cdbd2cSJim Jagielski virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 75*b1cdbd2cSJim Jagielski 76*b1cdbd2cSJim Jagielski // ____ XPropertySet ____ 77*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 78*b1cdbd2cSJim Jagielski getPropertySetInfo() 79*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 80*b1cdbd2cSJim Jagielski 81*b1cdbd2cSJim Jagielski /// merge XInterface implementations 82*b1cdbd2cSJim Jagielski DECLARE_XINTERFACE() 83*b1cdbd2cSJim Jagielski /// merge XTypeProvider implementations 84*b1cdbd2cSJim Jagielski DECLARE_XTYPEPROVIDER() 85*b1cdbd2cSJim Jagielski 86*b1cdbd2cSJim Jagielski protected: 87*b1cdbd2cSJim Jagielski // ____ XCoordinateSystem ____ 88*b1cdbd2cSJim Jagielski virtual ::sal_Int32 SAL_CALL getDimension() 89*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 90*b1cdbd2cSJim Jagielski // not implemented 91*b1cdbd2cSJim Jagielski // virtual ::rtl::OUString SAL_CALL getCoordinateSystemType() 92*b1cdbd2cSJim Jagielski // throw (::com::sun::star::uno::RuntimeException); 93*b1cdbd2cSJim Jagielski // not implemented 94*b1cdbd2cSJim Jagielski // virtual ::rtl::OUString SAL_CALL getViewServiceName() 95*b1cdbd2cSJim Jagielski // throw (::com::sun::star::uno::RuntimeException); 96*b1cdbd2cSJim Jagielski virtual void SAL_CALL setAxisByDimension( 97*b1cdbd2cSJim Jagielski ::sal_Int32 nDimension, 98*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis, 99*b1cdbd2cSJim Jagielski ::sal_Int32 nIndex ) 100*b1cdbd2cSJim Jagielski throw (::com::sun::star::lang::IndexOutOfBoundsException, 101*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException); 102*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > SAL_CALL getAxisByDimension( 103*b1cdbd2cSJim Jagielski ::sal_Int32 nDimension, ::sal_Int32 nIndex ) 104*b1cdbd2cSJim Jagielski throw (::com::sun::star::lang::IndexOutOfBoundsException, 105*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException); 106*b1cdbd2cSJim Jagielski virtual ::sal_Int32 SAL_CALL getMaximumAxisIndexByDimension( ::sal_Int32 nDimension ) 107*b1cdbd2cSJim Jagielski throw (::com::sun::star::lang::IndexOutOfBoundsException, 108*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException); 109*b1cdbd2cSJim Jagielski 110*b1cdbd2cSJim Jagielski // ____ XChartTypeContainer ____ 111*b1cdbd2cSJim Jagielski virtual void SAL_CALL addChartType( 112*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& aChartType ) 113*b1cdbd2cSJim Jagielski throw (::com::sun::star::lang::IllegalArgumentException, 114*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException); 115*b1cdbd2cSJim Jagielski virtual void SAL_CALL removeChartType( 116*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& aChartType ) 117*b1cdbd2cSJim Jagielski throw (::com::sun::star::container::NoSuchElementException, 118*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException); 119*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > > SAL_CALL getChartTypes() 120*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 121*b1cdbd2cSJim Jagielski virtual void SAL_CALL setChartTypes( 122*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > >& aChartTypes ) 123*b1cdbd2cSJim Jagielski throw (::com::sun::star::lang::IllegalArgumentException, 124*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException); 125*b1cdbd2cSJim Jagielski 126*b1cdbd2cSJim Jagielski // ____ XCloneable ____ 127*b1cdbd2cSJim Jagielski // not implemented 128*b1cdbd2cSJim Jagielski // virtual ::com::sun::star::uno::Reference< 129*b1cdbd2cSJim Jagielski // ::com::sun::star::util::XCloneable > SAL_CALL createClone() 130*b1cdbd2cSJim Jagielski // throw (::com::sun::star::uno::RuntimeException); 131*b1cdbd2cSJim Jagielski 132*b1cdbd2cSJim Jagielski // ____ XServiceInfo ____ 133*b1cdbd2cSJim Jagielski // not implemented 134*b1cdbd2cSJim Jagielski // virtual ::rtl::OUString SAL_CALL getImplementationName() 135*b1cdbd2cSJim Jagielski // throw (::com::sun::star::uno::RuntimeException); 136*b1cdbd2cSJim Jagielski // virtual ::sal_Bool SAL_CALL supportsService( 137*b1cdbd2cSJim Jagielski // const ::rtl::OUString& ServiceName ) 138*b1cdbd2cSJim Jagielski // throw (::com::sun::star::uno::RuntimeException); 139*b1cdbd2cSJim Jagielski // virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 140*b1cdbd2cSJim Jagielski // throw (::com::sun::star::uno::RuntimeException); 141*b1cdbd2cSJim Jagielski 142*b1cdbd2cSJim Jagielski // ____ XModifyBroadcaster ____ 143*b1cdbd2cSJim Jagielski virtual void SAL_CALL addModifyListener( 144*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 145*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 146*b1cdbd2cSJim Jagielski virtual void SAL_CALL removeModifyListener( 147*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 148*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 149*b1cdbd2cSJim Jagielski 150*b1cdbd2cSJim Jagielski // ____ XModifyListener ____ 151*b1cdbd2cSJim Jagielski virtual void SAL_CALL modified( 152*b1cdbd2cSJim Jagielski const ::com::sun::star::lang::EventObject& aEvent ) 153*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 154*b1cdbd2cSJim Jagielski 155*b1cdbd2cSJim Jagielski // ____ XEventListener (base of XModifyListener) ____ 156*b1cdbd2cSJim Jagielski virtual void SAL_CALL disposing( 157*b1cdbd2cSJim Jagielski const ::com::sun::star::lang::EventObject& Source ) 158*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 159*b1cdbd2cSJim Jagielski 160*b1cdbd2cSJim Jagielski // ____ OPropertySet ____ 161*b1cdbd2cSJim Jagielski virtual void firePropertyChangeEvent(); 162*b1cdbd2cSJim Jagielski using OPropertySet::disposing; 163*b1cdbd2cSJim Jagielski 164*b1cdbd2cSJim Jagielski void fireModifyEvent(); 165*b1cdbd2cSJim Jagielski 166*b1cdbd2cSJim Jagielski protected: 167*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< 168*b1cdbd2cSJim Jagielski ::com::sun::star::uno::XComponentContext > m_xContext; 169*b1cdbd2cSJim Jagielski 170*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 171*b1cdbd2cSJim Jagielski 172*b1cdbd2cSJim Jagielski private: 173*b1cdbd2cSJim Jagielski sal_Int32 m_nDimensionCount; 174*b1cdbd2cSJim Jagielski typedef ::std::vector< ::std::vector< ::com::sun::star::uno::Reference< 175*b1cdbd2cSJim Jagielski ::com::sun::star::chart2::XAxis > > > tAxisVecVecType; 176*b1cdbd2cSJim Jagielski tAxisVecVecType m_aAllAxis; //outer sequence is the dimension; inner sequence is the axis index that indicates main or secondary axis 177*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Sequence< 178*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Any > m_aOrigin; 179*b1cdbd2cSJim Jagielski ::std::vector< ::com::sun::star::uno::Reference< 180*b1cdbd2cSJim Jagielski ::com::sun::star::chart2::XChartType > > m_aChartTypes; 181*b1cdbd2cSJim Jagielski }; 182*b1cdbd2cSJim Jagielski 183*b1cdbd2cSJim Jagielski } // namespace chart 184*b1cdbd2cSJim Jagielski 185*b1cdbd2cSJim Jagielski // CHART_COORDINATESYSTEM_HXX 186*b1cdbd2cSJim Jagielski #endif 187