1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef CHART_AXIS_HXX 24 #define CHART_AXIS_HXX 25 26 #include <com/sun/star/uno/XComponentContext.hpp> 27 #include "MutexContainer.hxx" 28 #include "OPropertySet.hxx" 29 #include <cppuhelper/implbase6.hxx> 30 #include <comphelper/uno3.hxx> 31 32 #include "ServiceMacros.hxx" 33 #include "ModifyListenerHelper.hxx" 34 #include <com/sun/star/lang/XServiceInfo.hpp> 35 #include <com/sun/star/chart2/XAxis.hpp> 36 #include <com/sun/star/chart2/XTitled.hpp> 37 #include <com/sun/star/util/XCloneable.hpp> 38 #include <com/sun/star/util/XModifyBroadcaster.hpp> 39 #include <com/sun/star/util/XModifyListener.hpp> 40 41 namespace chart 42 { 43 44 namespace impl 45 { 46 typedef ::cppu::WeakImplHelper6< 47 ::com::sun::star::chart2::XAxis, 48 ::com::sun::star::chart2::XTitled, 49 ::com::sun::star::lang::XServiceInfo, 50 ::com::sun::star::util::XCloneable, 51 ::com::sun::star::util::XModifyBroadcaster, 52 ::com::sun::star::util::XModifyListener > 53 Axis_Base; 54 } 55 56 class Axis : 57 public MutexContainer, 58 public impl::Axis_Base, 59 public ::property::OPropertySet 60 { 61 public: 62 Axis( ::com::sun::star::uno::Reference< 63 ::com::sun::star::uno::XComponentContext > const & xContext ); 64 virtual ~Axis(); 65 66 /// establish methods for factory instatiation 67 APPHELPER_SERVICE_FACTORY_HELPER( Axis ) 68 /// XServiceInfo declarations 69 APPHELPER_XSERVICEINFO_DECL() 70 71 /// merge XInterface implementations 72 DECLARE_XINTERFACE() 73 /// merge XTypeProvider implementations 74 DECLARE_XTYPEPROVIDER() 75 76 protected: 77 explicit Axis( const Axis & rOther ); 78 79 // late initialization to call after copy-constructing 80 void Init( const Axis & rOther ); 81 82 // ____ OPropertySet ____ 83 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const 84 throw(::com::sun::star::beans::UnknownPropertyException); 85 86 // ____ OPropertySet ____ 87 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 88 89 // ____ XPropertySet ____ 90 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 91 getPropertySetInfo() 92 throw (::com::sun::star::uno::RuntimeException); 93 94 // virtual sal_Bool SAL_CALL convertFastPropertyValue 95 // ( ::com::sun::star::uno::Any & rConvertedValue, 96 // ::com::sun::star::uno::Any & rOldValue, 97 // sal_Int32 nHandle, 98 // const ::com::sun::star::uno::Any& rValue ) 99 // throw (::com::sun::star::lang::IllegalArgumentException); 100 101 // ____ XAxis ____ 102 virtual void SAL_CALL setScaleData( const ::com::sun::star::chart2::ScaleData& rScaleData ) 103 throw (::com::sun::star::uno::RuntimeException); 104 virtual ::com::sun::star::chart2::ScaleData SAL_CALL getScaleData() 105 throw (::com::sun::star::uno::RuntimeException); 106 virtual ::com::sun::star::uno::Reference< 107 ::com::sun::star::beans::XPropertySet > SAL_CALL getGridProperties() 108 throw (::com::sun::star::uno::RuntimeException); 109 virtual ::com::sun::star::uno::Sequence< 110 ::com::sun::star::uno::Reference< 111 ::com::sun::star::beans::XPropertySet > > SAL_CALL getSubGridProperties() 112 throw (::com::sun::star::uno::RuntimeException); 113 virtual ::com::sun::star::uno::Sequence< 114 ::com::sun::star::uno::Reference< 115 ::com::sun::star::beans::XPropertySet > > SAL_CALL getSubTickProperties() 116 throw (::com::sun::star::uno::RuntimeException); 117 118 // ____ XTitled ____ 119 virtual ::com::sun::star::uno::Reference< 120 ::com::sun::star::chart2::XTitle > SAL_CALL getTitleObject() 121 throw (::com::sun::star::uno::RuntimeException); 122 virtual void SAL_CALL setTitleObject( 123 const ::com::sun::star::uno::Reference< 124 ::com::sun::star::chart2::XTitle >& Title ) 125 throw (::com::sun::star::uno::RuntimeException); 126 127 // ____ XCloneable ____ 128 // Note: the coordinate systems are not cloned! 129 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() 130 throw (::com::sun::star::uno::RuntimeException); 131 132 // ____ XModifyBroadcaster ____ 133 virtual void SAL_CALL addModifyListener( 134 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 135 throw (::com::sun::star::uno::RuntimeException); 136 virtual void SAL_CALL removeModifyListener( 137 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 138 throw (::com::sun::star::uno::RuntimeException); 139 140 // ____ XModifyListener ____ 141 virtual void SAL_CALL modified( 142 const ::com::sun::star::lang::EventObject& aEvent ) 143 throw (::com::sun::star::uno::RuntimeException); 144 145 // ____ XEventListener (base of XModifyListener) ____ 146 virtual void SAL_CALL disposing( 147 const ::com::sun::star::lang::EventObject& Source ) 148 throw (::com::sun::star::uno::RuntimeException); 149 150 // ____ OPropertySet ____ 151 virtual void firePropertyChangeEvent(); 152 using OPropertySet::disposing; 153 154 void fireModifyEvent(); 155 156 private: //methods 157 void AllocateSubGrids(); 158 159 private: //member 160 161 ::com::sun::star::uno::Reference< 162 ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 163 164 ::com::sun::star::chart2::ScaleData m_aScaleData; 165 166 ::com::sun::star::uno::Reference< 167 ::com::sun::star::beans::XPropertySet > m_xGrid; 168 169 ::com::sun::star::uno::Sequence< 170 ::com::sun::star::uno::Reference< 171 ::com::sun::star::beans::XPropertySet > > m_aSubGridProperties; 172 173 ::com::sun::star::uno::Reference< 174 ::com::sun::star::chart2::XTitle > m_xTitle; 175 }; 176 177 } // namespace chart 178 179 // CHART_AXIS_HXX 180 #endif 181