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 instatiation 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 throw(::com::sun::star::beans::UnknownPropertyException); 73 74 // ____ OPropertySet ____ 75 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 76 77 // ____ XPropertySet ____ 78 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 79 getPropertySetInfo() 80 throw (::com::sun::star::uno::RuntimeException); 81 82 // virtual sal_Bool SAL_CALL convertFastPropertyValue 83 // ( ::com::sun::star::uno::Any & rConvertedValue, 84 // ::com::sun::star::uno::Any & rOldValue, 85 // sal_Int32 nHandle, 86 // const ::com::sun::star::uno::Any& rValue ) 87 // throw (::com::sun::star::lang::IllegalArgumentException); 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< 119 ::com::sun::star::uno::XComponentContext > 120 m_xContext; 121 122 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 123 }; 124 125 } // namespace chart 126 127 // CHART_PAGEBACKGROUND_HXX 128 #endif 129