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_PAGEBACKGROUND_HXX 24 #define CHART_PAGEBACKGROUND_HXX 25 26 #include <com/sun/star/uno/XComponentContext.hpp> 27 #include <com/sun/star/util/XCloneable.hpp> 28 #include "MutexContainer.hxx" 29 #include "OPropertySet.hxx" 30 #include <cppuhelper/implbase3.hxx> 31 32 #include "ServiceMacros.hxx" 33 #include "ModifyListenerHelper.hxx" 34 #include <comphelper/uno3.hxx> 35 36 namespace chart 37 { 38 39 namespace impl 40 { 41 typedef ::cppu::WeakImplHelper3< 42 ::com::sun::star::util::XCloneable, 43 ::com::sun::star::util::XModifyBroadcaster, 44 ::com::sun::star::util::XModifyListener > 45 PageBackground_Base; 46 } 47 48 class PageBackground : 49 public MutexContainer, 50 public impl::PageBackground_Base, 51 public ::property::OPropertySet 52 { 53 public: 54 PageBackground( const ::com::sun::star::uno::Reference< 55 ::com::sun::star::uno::XComponentContext > & xContext ); 56 virtual ~PageBackground(); 57 58 /// establish methods for factory instantiation 59 APPHELPER_SERVICE_FACTORY_HELPER( PageBackground ) 60 61 /// XServiceInfo declarations 62 APPHELPER_XSERVICEINFO_DECL() 63 64 /// merge XInterface implementations 65 DECLARE_XINTERFACE() 66 67 protected: 68 explicit PageBackground( const PageBackground & rOther ); 69 70 // ____ OPropertySet ____ 71 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const; 72 73 // ____ OPropertySet ____ 74 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 75 76 // ____ XPropertySet ____ 77 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 78 getPropertySetInfo(); 79 80 // virtual sal_Bool SAL_CALL convertFastPropertyValue 81 // ( ::com::sun::star::uno::Any & rConvertedValue, 82 // ::com::sun::star::uno::Any & rOldValue, 83 // sal_Int32 nHandle, 84 // const ::com::sun::star::uno::Any& rValue ) 85 // throw (::com::sun::star::lang::IllegalArgumentException); 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< 112 ::com::sun::star::uno::XComponentContext > 113 m_xContext; 114 115 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 116 }; 117 118 } // namespace chart 119 120 // CHART_PAGEBACKGROUND_HXX 121 #endif 122