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_LEGENDWRAPPER_HXX 24 #define CHART_LEGENDWRAPPER_HXX 25 26 #include "WrappedPropertySet.hxx" 27 #include "ReferenceSizePropertyProvider.hxx" 28 #include "ServiceMacros.hxx" 29 #include <cppuhelper/implbase3.hxx> 30 #include <comphelper/uno3.hxx> 31 #include <cppuhelper/interfacecontainer.hxx> 32 #include <com/sun/star/drawing/XShape.hpp> 33 #include <com/sun/star/lang/XComponent.hpp> 34 #include <com/sun/star/lang/XServiceInfo.hpp> 35 #include <com/sun/star/chart2/XChartDocument.hpp> 36 #include <com/sun/star/uno/XComponentContext.hpp> 37 #include <com/sun/star/chart2/XLegend.hpp> 38 39 #include <boost/shared_ptr.hpp> 40 41 namespace chart 42 { 43 44 namespace wrapper 45 { 46 47 class Chart2ModelContact; 48 49 class LegendWrapper : public ::cppu::ImplInheritanceHelper3< 50 WrappedPropertySet 51 , com::sun::star::drawing::XShape 52 , com::sun::star::lang::XComponent 53 , com::sun::star::lang::XServiceInfo 54 > 55 , public ReferenceSizePropertyProvider 56 { 57 public: 58 LegendWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ); 59 virtual ~LegendWrapper(); 60 61 /// XServiceInfo declarations 62 APPHELPER_XSERVICEINFO_DECL() 63 64 //ReferenceSizePropertyProvider 65 virtual void updateReferenceSize(); 66 virtual ::com::sun::star::uno::Any getReferenceSize(); 67 virtual ::com::sun::star::awt::Size getCurrentSizeForReference(); 68 69 // ____ XShape ____ 70 virtual ::com::sun::star::awt::Point SAL_CALL getPosition() 71 throw (::com::sun::star::uno::RuntimeException); 72 virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) 73 throw (::com::sun::star::uno::RuntimeException); 74 virtual ::com::sun::star::awt::Size SAL_CALL getSize() 75 throw (::com::sun::star::uno::RuntimeException); 76 virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) 77 throw (::com::sun::star::beans::PropertyVetoException, 78 ::com::sun::star::uno::RuntimeException); 79 80 // ____ XShapeDescriptor (base of XShape) ____ 81 virtual ::rtl::OUString SAL_CALL getShapeType() 82 throw (::com::sun::star::uno::RuntimeException); 83 84 // ____ XComponent ____ 85 virtual void SAL_CALL dispose() 86 throw (::com::sun::star::uno::RuntimeException); 87 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< 88 ::com::sun::star::lang::XEventListener >& xListener ) 89 throw (::com::sun::star::uno::RuntimeException); 90 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< 91 ::com::sun::star::lang::XEventListener >& aListener ) 92 throw (::com::sun::star::uno::RuntimeException); 93 94 protected: 95 // ____ WrappedPropertySet ____ 96 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence(); 97 virtual const std::vector< WrappedProperty* > createWrappedProperties(); 98 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet(); 99 100 private: 101 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact; 102 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer; 103 }; 104 105 } // namespace wrapper 106 } // namespace chart 107 108 // CHART_LEGENDWRAPPER_HXX 109 #endif 110