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 virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ); 72 virtual ::com::sun::star::awt::Size SAL_CALL getSize(); 73 virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ); 74 75 // ____ XShapeDescriptor (base of XShape) ____ 76 virtual ::rtl::OUString SAL_CALL getShapeType(); 77 78 // ____ XComponent ____ 79 virtual void SAL_CALL dispose(); 80 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< 81 ::com::sun::star::lang::XEventListener >& xListener ); 82 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< 83 ::com::sun::star::lang::XEventListener >& aListener ); 84 85 protected: 86 // ____ WrappedPropertySet ____ 87 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence(); 88 virtual const std::vector< WrappedProperty* > createWrappedProperties(); 89 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet(); 90 91 private: 92 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact; 93 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer; 94 }; 95 96 } // namespace wrapper 97 } // namespace chart 98 99 // CHART_LEGENDWRAPPER_HXX 100 #endif 101