LCOV - code coverage report
Current view: top level - libreoffice/chart2/source/view/main - ChartView.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-12-27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #ifndef _CHARTVIEWIMPL_HXX
      20             : #define _CHARTVIEWIMPL_HXX
      21             : 
      22             : #include "chartview/ExplicitValueProvider.hxx"
      23             : #include "ServiceMacros.hxx"
      24             : #include <cppuhelper/implbase10.hxx>
      25             : #include <cppuhelper/interfacecontainer.hxx>
      26             : 
      27             : // header for class SfxListener
      28             : #include <svl/lstner.hxx>
      29             : #include <com/sun/star/datatransfer/XTransferable.hpp>
      30             : #include <com/sun/star/drawing/XDrawPage.hpp>
      31             : #include <com/sun/star/frame/XModel.hpp>
      32             : #include <com/sun/star/io/XOutputStream.hpp>
      33             : #include <com/sun/star/lang/XInitialization.hpp>
      34             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      35             : #include <com/sun/star/lang/XServiceInfo.hpp>
      36             : #include <com/sun/star/lang/XUnoTunnel.hpp>
      37             : #include <com/sun/star/uno/XComponentContext.hpp>
      38             : #include <com/sun/star/util/XModifyListener.hpp>
      39             : #include <com/sun/star/util/XModeChangeBroadcaster.hpp>
      40             : #include <com/sun/star/util/XUpdatable.hpp>
      41             : #include <com/sun/star/qa/XDumper.hpp>
      42             : 
      43             : #include <vector>
      44             : #include <boost/shared_ptr.hpp>
      45             : 
      46             : class SdrPage;
      47             : 
      48             : namespace chart {
      49             : 
      50             : class VCoordinateSystem;
      51             : class DrawModelWrapper;
      52             : class SeriesPlotterContainer;
      53             : 
      54             : /**
      55             :  * The ChartView is responsible to manage the generation of Drawing Objects
      56             :  * for visualization on a given OutputDevice. The ChartModel is responsible
      57             :  * to notify changes to the view. The view than changes to state dirty. The
      58             :  * view can be updated with call 'update'.
      59             :  *
      60             :  * The View is not responsible to handle single user events (that is instead
      61             :  * done by the ChartWindow).
      62             :  */
      63             : class ChartView : public ::cppu::WeakImplHelper10<
      64             :     ::com::sun::star::lang::XInitialization
      65             :         ,::com::sun::star::lang::XServiceInfo
      66             :         ,::com::sun::star::datatransfer::XTransferable
      67             :         ,::com::sun::star::lang::XUnoTunnel
      68             :         ,::com::sun::star::util::XModifyListener
      69             :         ,::com::sun::star::util::XModeChangeBroadcaster
      70             :         ,::com::sun::star::util::XUpdatable
      71             :         ,::com::sun::star::beans::XPropertySet
      72             :         ,::com::sun::star::lang::XMultiServiceFactory
      73             :         ,::com::sun::star::qa::XDumper
      74             :         >
      75             :         , public ExplicitValueProvider
      76             :         , private SfxListener
      77             : {
      78             : public:
      79             :     ChartView(::com::sun::star::uno::Reference<
      80             :                ::com::sun::star::uno::XComponentContext > const & xContext);
      81             :     virtual ~ChartView();
      82             : 
      83             :     // ___lang::XServiceInfo___
      84             :     APPHELPER_XSERVICEINFO_DECL()
      85          41 :     APPHELPER_SERVICE_FACTORY_HELPER(ChartView)
      86             : 
      87             :     // ___lang::XInitialization___
      88             :     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
      89             :                 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
      90             : 
      91             :     // ___ExplicitValueProvider___
      92             :     virtual sal_Bool getExplicitValuesForAxis(
      93             :         ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > xAxis
      94             :         , ExplicitScaleData&  rExplicitScale
      95             :         , ExplicitIncrementData& rExplicitIncrement );
      96             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
      97             :         getShapeForCID( const rtl::OUString& rObjectCID );
      98             : 
      99             :     virtual ::com::sun::star::awt::Rectangle getRectangleOfObject( const rtl::OUString& rObjectCID, bool bSnapRect=false );
     100             : 
     101             :     virtual ::com::sun::star::awt::Rectangle getDiagramRectangleExcludingAxes();
     102             : 
     103             :     ::boost::shared_ptr< DrawModelWrapper > getDrawModelWrapper();
     104             : 
     105             :     // ___XTransferable___
     106             :     virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
     107             :                 throw (::com::sun::star::datatransfer::UnsupportedFlavorException
     108             :                      , ::com::sun::star::io::IOException
     109             :                      , ::com::sun::star::uno::RuntimeException);
     110             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors(  )
     111             :                 throw (::com::sun::star::uno::RuntimeException);
     112             :     virtual ::sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
     113             :                 throw (::com::sun::star::uno::RuntimeException);
     114             : 
     115             :     //-------------------------------------------------------------------------------------
     116             :     // ::com::sun::star::util::XEventListener (base of XCloseListener and XModifyListener)
     117             :     //-------------------------------------------------------------------------------------
     118             :     virtual void SAL_CALL
     119             :         disposing( const ::com::sun::star::lang::EventObject& Source )
     120             :                             throw (::com::sun::star::uno::RuntimeException);
     121             : 
     122             :     //-----------------------------------------------------------------
     123             :     // ::com::sun::star::util::XModifyListener
     124             :     //-----------------------------------------------------------------
     125             :     virtual void SAL_CALL modified(
     126             :         const ::com::sun::star::lang::EventObject& aEvent )
     127             :         throw (::com::sun::star::uno::RuntimeException);
     128             : 
     129             :     //SfxListener
     130             :     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
     131             : 
     132             :     //-----------------------------------------------------------------
     133             :     // ::com::sun::star::util::XModeChangeBroadcaster
     134             :     //-----------------------------------------------------------------
     135             : 
     136             :     virtual void SAL_CALL addModeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
     137             :     virtual void SAL_CALL removeModeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
     138             :     virtual void SAL_CALL addModeChangeApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeApproveListener >& _rxListener ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
     139             :     virtual void SAL_CALL removeModeChangeApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeApproveListener >& _rxListener ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
     140             : 
     141             :     //-----------------------------------------------------------------
     142             :     // ::com::sun::star::util::XUpdatable
     143             :     //-----------------------------------------------------------------
     144             :     virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
     145             : 
     146             :     //-----------------------------------------------------------------
     147             :     // ::com::sun::star::beans::XPropertySet
     148             :     //-----------------------------------------------------------------
     149             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw (::com::sun::star::uno::RuntimeException);
     150             :     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     151             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     152             :     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     153             :     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     154             :     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     155             :     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     156             : 
     157             :     //-----------------------------------------------------------------
     158             :     // ::com::sun::star::lang::XMultiServiceFactory
     159             :     //-----------------------------------------------------------------
     160             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier )
     161             :         throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
     162             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(
     163             :         const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments )
     164             :         throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
     165             :     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException);
     166             : 
     167             :     // for ExplicitValueProvider
     168             :     // ____ XUnoTunnel ___
     169             :     virtual ::sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aIdentifier )
     170             :             throw (::com::sun::star::uno::RuntimeException);
     171             : 
     172             :     // XDumper
     173             :     virtual rtl::OUString SAL_CALL dump()
     174             :             throw(::com::sun::star::uno::RuntimeException);
     175             : 
     176             : private: //methods
     177             :     ChartView();
     178             : 
     179             :     void createShapes();
     180             :     void getMetaFile( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStream
     181             :                       , bool bUseHighContrast );
     182             :     SdrPage* getSdrPage();
     183             : 
     184             :     void impl_setChartModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
     185             :     void impl_deleteCoordinateSystems();
     186             :     void impl_notifyModeChangeListener( const rtl::OUString& rNewMode );
     187             : 
     188             :     void impl_refreshAddIn();
     189             :     bool impl_AddInDrawsAllByItself();
     190             : 
     191             :     void impl_updateView();
     192             : 
     193             :     ::com::sun::star::awt::Rectangle impl_createDiagramAndContent( SeriesPlotterContainer& rSeriesPlotterContainer
     194             :         , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes>& xDiagramPlusAxes_Shapes
     195             :         , const ::com::sun::star::awt::Point& rAvailablePos
     196             :         , const ::com::sun::star::awt::Size& rAvailableSize
     197             :         , const ::com::sun::star::awt::Size& rPageSize
     198             :         , bool bUseFixedInnerSize
     199             :         , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& xDiagram_MarkHandles );
     200             : 
     201             : 
     202             : private: //member
     203             :     ::osl::Mutex m_aMutex;
     204             : 
     205             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>
     206             :             m_xCC;
     207             :     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
     208             :             m_xChartModel;
     209             : 
     210             :     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>
     211             :             m_xShapeFactory;
     212             :     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>
     213             :             m_xDrawPage;
     214             : 
     215             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDashTable;
     216             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xGradientTable;
     217             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xHatchTable;
     218             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xBitmapTable;
     219             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xTransGradientTable;
     220             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xMarkerTable;
     221             : 
     222             :     ::boost::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper;
     223             : 
     224             :     std::vector< VCoordinateSystem* > m_aVCooSysList;
     225             : 
     226             :     ::cppu::OMultiTypeInterfaceContainerHelper
     227             :                         m_aListenerContainer;
     228             : 
     229             :     bool volatile       m_bViewDirty; //states whether the view needs to be rebuild
     230             :     bool volatile       m_bInViewUpdate;
     231             :     bool volatile       m_bViewUpdatePending;
     232             :     bool volatile       m_bRefreshAddIn;
     233             : 
     234             :     //better performance for big data
     235             :     ::com::sun::star::awt::Size m_aPageResolution;
     236             :     bool m_bPointsWereSkipped;
     237             : 
     238             :     //#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
     239             :     sal_Int32 m_nScaleXNumerator;
     240             :     sal_Int32 m_nScaleXDenominator;
     241             :     sal_Int32 m_nScaleYNumerator;
     242             :     sal_Int32 m_nScaleYDenominator;
     243             : 
     244             :     sal_Bool m_bSdrViewIsInEditMode;
     245             : 
     246             :     ::com::sun::star::awt::Rectangle m_aResultingDiagramRectangleExcludingAxes;
     247             : };
     248             : 
     249             : }
     250             : 
     251             : #endif
     252             : 
     253             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10