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_GRIDPROPERTIES_HXX 24 #define CHART_GRIDPROPERTIES_HXX 25 26 #include "ServiceMacros.hxx" 27 #include <osl/mutex.hxx> 28 #include <cppuhelper/implbase4.hxx> 29 #include <comphelper/uno3.hxx> 30 #include <com/sun/star/lang/XServiceInfo.hpp> 31 #include <com/sun/star/uno/XComponentContext.hpp> 32 #include <com/sun/star/util/XCloneable.hpp> 33 #include <com/sun/star/util/XModifyBroadcaster.hpp> 34 #include <com/sun/star/util/XModifyListener.hpp> 35 36 #include "OPropertySet.hxx" 37 #include "MutexContainer.hxx" 38 #include "ModifyListenerHelper.hxx" 39 40 namespace chart 41 { 42 43 namespace impl 44 { 45 typedef ::cppu::WeakImplHelper4< 46 ::com::sun::star::lang::XServiceInfo, 47 ::com::sun::star::util::XCloneable, 48 ::com::sun::star::util::XModifyBroadcaster, 49 ::com::sun::star::util::XModifyListener > 50 GridProperties_Base; 51 } 52 53 class GridProperties : 54 public MutexContainer, 55 public impl::GridProperties_Base, 56 public ::property::OPropertySet 57 { 58 public: 59 GridProperties( ::com::sun::star::uno::Reference< 60 ::com::sun::star::uno::XComponentContext > const & xContext ); 61 explicit GridProperties(); 62 virtual ~GridProperties(); 63 64 /// establish methods for factory instantiation 65 APPHELPER_SERVICE_FACTORY_HELPER( GridProperties ) 66 67 /// XServiceInfo declarations 68 APPHELPER_XSERVICEINFO_DECL() 69 70 /// merge XInterface implementations 71 DECLARE_XINTERFACE() 72 /// merge XTypeProvider implementations 73 DECLARE_XTYPEPROVIDER() 74 75 protected: 76 explicit GridProperties( const GridProperties & rOther ); 77 78 // ____ OPropertySet ____ 79 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const; 80 81 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 82 83 // ____ XPropertySet ____ 84 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 85 getPropertySetInfo(); 86 87 // ____ XCloneable ____ 88 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone(); 89 90 // ____ XModifyBroadcaster ____ 91 virtual void SAL_CALL addModifyListener( 92 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ); 93 virtual void SAL_CALL removeModifyListener( 94 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ); 95 96 // ____ XModifyListener ____ 97 virtual void SAL_CALL modified( 98 const ::com::sun::star::lang::EventObject& aEvent ); 99 100 // ____ XEventListener (base of XModifyListener) ____ 101 virtual void SAL_CALL disposing( 102 const ::com::sun::star::lang::EventObject& Source ); 103 104 // ____ OPropertySet ____ 105 virtual void firePropertyChangeEvent(); 106 using OPropertySet::disposing; 107 108 void fireModifyEvent(); 109 110 private: 111 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 112 }; 113 114 } // namespace chart 115 116 // CHART_GRIDPROPERTIES_HXX 117 #endif 118