1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef CHART_CHARTDOCUMENTWRAPPER_HXX 28*cdf0e10cSrcweir #define CHART_CHARTDOCUMENTWRAPPER_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include "WrappedPropertySet.hxx" 31*cdf0e10cSrcweir //#include "OPropertySet.hxx" 32*cdf0e10cSrcweir #include "ServiceMacros.hxx" 33*cdf0e10cSrcweir #include <com/sun/star/chart2/XChartDocument.hpp> 34*cdf0e10cSrcweir #include <com/sun/star/chart/XChartDocument.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPageSupplier.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/uno/XAggregation.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/util/XRefreshable.hpp> 41*cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 42*cdf0e10cSrcweir #include <osl/mutex.hxx> 43*cdf0e10cSrcweir #include <unotools/eventlisteneradapter.hxx> 44*cdf0e10cSrcweir #include <comphelper/uno3.hxx> 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir namespace chart 49*cdf0e10cSrcweir { 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir namespace wrapper 52*cdf0e10cSrcweir { 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir class Chart2ModelContact; 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir class ChartDocumentWrapper_Base : public ::cppu::ImplInheritanceHelper5 57*cdf0e10cSrcweir < WrappedPropertySet 58*cdf0e10cSrcweir , ::com::sun::star::chart::XChartDocument 59*cdf0e10cSrcweir , ::com::sun::star::drawing::XDrawPageSupplier 60*cdf0e10cSrcweir , ::com::sun::star::lang::XMultiServiceFactory 61*cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo 62*cdf0e10cSrcweir , ::com::sun::star::uno::XAggregation 63*cdf0e10cSrcweir > 64*cdf0e10cSrcweir { 65*cdf0e10cSrcweir }; 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir class ChartDocumentWrapper : public ChartDocumentWrapper_Base 68*cdf0e10cSrcweir , public ::utl::OEventListenerAdapter 69*cdf0e10cSrcweir { 70*cdf0e10cSrcweir public: 71*cdf0e10cSrcweir explicit ChartDocumentWrapper( 72*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 73*cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext > & xContext ); 74*cdf0e10cSrcweir virtual ~ChartDocumentWrapper(); 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir /// XServiceInfo declarations 77*cdf0e10cSrcweir APPHELPER_XSERVICEINFO_DECL() 78*cdf0e10cSrcweir APPHELPER_SERVICE_FACTORY_HELPER(ChartDocumentWrapper) 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir void setAddIn( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshable >& xAddIn ); 81*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshable > getAddIn() const; 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir void setUpdateAddIn( sal_Bool bUpdateAddIn ); 84*cdf0e10cSrcweir sal_Bool getUpdateAddIn() const; 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir void setBaseDiagram( const rtl::OUString& rBaseDiagram ); 87*cdf0e10cSrcweir rtl::OUString getBaseDiagram() const; 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getAdditionalShapes() const; 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 92*cdf0e10cSrcweir ::com::sun::star::drawing::XDrawPage > impl_getDrawPage() const 93*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir protected: 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir // ____ chart::XChartDocument ____ 98*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 99*cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getTitle() 100*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 101*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 102*cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getSubTitle() 103*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 104*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 105*cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getLegend() 106*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 107*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 108*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getArea() 109*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 110*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 111*cdf0e10cSrcweir ::com::sun::star::chart::XDiagram > SAL_CALL getDiagram() 112*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 113*cdf0e10cSrcweir virtual void SAL_CALL setDiagram( const ::com::sun::star::uno::Reference< 114*cdf0e10cSrcweir ::com::sun::star::chart::XDiagram >& xDiagram ) 115*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 116*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 117*cdf0e10cSrcweir ::com::sun::star::chart::XChartData > SAL_CALL getData() 118*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 119*cdf0e10cSrcweir virtual void SAL_CALL attachData( const ::com::sun::star::uno::Reference< 120*cdf0e10cSrcweir ::com::sun::star::chart::XChartData >& xData ) 121*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir // ____ XModel ____ 124*cdf0e10cSrcweir virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& URL, const ::com::sun::star::uno::Sequence< 125*cdf0e10cSrcweir ::com::sun::star::beans::PropertyValue >& Arguments ) 126*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 127*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getURL() 128*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 129*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< 130*cdf0e10cSrcweir ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs() 131*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 132*cdf0e10cSrcweir virtual void SAL_CALL connectController( const ::com::sun::star::uno::Reference< 133*cdf0e10cSrcweir ::com::sun::star::frame::XController >& Controller ) 134*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 135*cdf0e10cSrcweir virtual void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference< 136*cdf0e10cSrcweir ::com::sun::star::frame::XController >& Controller ) 137*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 138*cdf0e10cSrcweir virtual void SAL_CALL lockControllers() 139*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 140*cdf0e10cSrcweir virtual void SAL_CALL unlockControllers() 141*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 142*cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasControllersLocked() 143*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 144*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 145*cdf0e10cSrcweir ::com::sun::star::frame::XController > SAL_CALL getCurrentController() 146*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 147*cdf0e10cSrcweir virtual void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference< 148*cdf0e10cSrcweir ::com::sun::star::frame::XController >& Controller ) 149*cdf0e10cSrcweir throw (::com::sun::star::container::NoSuchElementException, 150*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 151*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 152*cdf0e10cSrcweir ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection() 153*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir // ____ XComponent ____ 156*cdf0e10cSrcweir virtual void SAL_CALL dispose() 157*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 158*cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< 159*cdf0e10cSrcweir ::com::sun::star::lang::XEventListener >& xListener ) 160*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 161*cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< 162*cdf0e10cSrcweir ::com::sun::star::lang::XEventListener >& aListener ) 163*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir // ____ XInterface (for new interfaces) ____ 166*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) 167*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir // ____ ::utl::OEventListenerAdapter ____ 170*cdf0e10cSrcweir virtual void _disposing( const ::com::sun::star::lang::EventObject& rSource ); 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir // ____ XDrawPageSupplier ____ 173*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 174*cdf0e10cSrcweir ::com::sun::star::drawing::XDrawPage > SAL_CALL getDrawPage() 175*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 176*cdf0e10cSrcweir 177*cdf0e10cSrcweir // ____ XMultiServiceFactory ____ 178*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 179*cdf0e10cSrcweir ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) 180*cdf0e10cSrcweir throw (::com::sun::star::uno::Exception, 181*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 182*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 183*cdf0e10cSrcweir ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( 184*cdf0e10cSrcweir const ::rtl::OUString& ServiceSpecifier, 185*cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) 186*cdf0e10cSrcweir throw (::com::sun::star::uno::Exception, 187*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 188*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< 189*cdf0e10cSrcweir ::rtl::OUString > SAL_CALL getAvailableServiceNames() 190*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir // ____ XAggregation ____ 193*cdf0e10cSrcweir virtual void SAL_CALL setDelegator( 194*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 195*cdf0e10cSrcweir ::com::sun::star::uno::XInterface >& rDelegator ) 196*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 197*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) 198*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 199*cdf0e10cSrcweir 200*cdf0e10cSrcweir // ____ WrappedPropertySet ____ 201*cdf0e10cSrcweir virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence(); 202*cdf0e10cSrcweir virtual const std::vector< WrappedProperty* > createWrappedProperties(); 203*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet(); 204*cdf0e10cSrcweir 205*cdf0e10cSrcweir private: //methods 206*cdf0e10cSrcweir void impl_resetAddIn(); 207*cdf0e10cSrcweir 208*cdf0e10cSrcweir private: //member 209*cdf0e10cSrcweir ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact; 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDelegator; 212*cdf0e10cSrcweir 213*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xTitle; 214*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xSubTitle; 215*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xLegend; 216*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartData > m_xChartData; 217*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > m_xDiagram; 218*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xArea; 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshable > m_xAddIn; 221*cdf0e10cSrcweir rtl::OUString m_aBaseDiagram; 222*cdf0e10cSrcweir sal_Bool m_bUpdateAddIn; 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xChartView; 225*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> 226*cdf0e10cSrcweir m_xShapeFactory; 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir bool m_bIsDisposed; 229*cdf0e10cSrcweir }; 230*cdf0e10cSrcweir 231*cdf0e10cSrcweir } // namespace wrapper 232*cdf0e10cSrcweir } // namespace chart 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir // CHART_CHARTDOCUMENT_HXX 235*cdf0e10cSrcweir #endif 236