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 instatiation 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 throw(::com::sun::star::beans::UnknownPropertyException); 81 82 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 83 84 // ____ XPropertySet ____ 85 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 86 getPropertySetInfo() 87 throw (::com::sun::star::uno::RuntimeException); 88 89 // ____ XCloneable ____ 90 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() 91 throw (::com::sun::star::uno::RuntimeException); 92 93 // ____ XModifyBroadcaster ____ 94 virtual void SAL_CALL addModifyListener( 95 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 96 throw (::com::sun::star::uno::RuntimeException); 97 virtual void SAL_CALL removeModifyListener( 98 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 99 throw (::com::sun::star::uno::RuntimeException); 100 101 // ____ XModifyListener ____ 102 virtual void SAL_CALL modified( 103 const ::com::sun::star::lang::EventObject& aEvent ) 104 throw (::com::sun::star::uno::RuntimeException); 105 106 // ____ XEventListener (base of XModifyListener) ____ 107 virtual void SAL_CALL disposing( 108 const ::com::sun::star::lang::EventObject& Source ) 109 throw (::com::sun::star::uno::RuntimeException); 110 111 // ____ OPropertySet ____ 112 virtual void firePropertyChangeEvent(); 113 using OPropertySet::disposing; 114 115 void fireModifyEvent(); 116 117 private: 118 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 119 }; 120 121 } // namespace chart 122 123 // CHART_GRIDPROPERTIES_HXX 124 #endif 125