1de7b3f82SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3de7b3f82SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4de7b3f82SAndrew Rist * or more contributor license agreements. See the NOTICE file 5de7b3f82SAndrew Rist * distributed with this work for additional information 6de7b3f82SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7de7b3f82SAndrew Rist * to you under the Apache License, Version 2.0 (the 8de7b3f82SAndrew Rist * "License"); you may not use this file except in compliance 9de7b3f82SAndrew Rist * with the License. You may obtain a copy of the License at 10de7b3f82SAndrew Rist * 11de7b3f82SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12de7b3f82SAndrew Rist * 13de7b3f82SAndrew Rist * Unless required by applicable law or agreed to in writing, 14de7b3f82SAndrew Rist * software distributed under the License is distributed on an 15de7b3f82SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16de7b3f82SAndrew Rist * KIND, either express or implied. See the License for the 17de7b3f82SAndrew Rist * specific language governing permissions and limitations 18de7b3f82SAndrew Rist * under the License. 19de7b3f82SAndrew Rist * 20de7b3f82SAndrew Rist *************************************************************/ 21de7b3f82SAndrew Rist 22de7b3f82SAndrew Rist 23cdf0e10cSrcweir #ifndef _CHART2_DRAWMODELWRAPPER_HXX 24cdf0e10cSrcweir #define _CHART2_DRAWMODELWRAPPER_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir //---- 27cdf0e10cSrcweir #include <svx/svdmodel.hxx> 28cdf0e10cSrcweir // header for class SdrObject 29cdf0e10cSrcweir #include <svx/svdobj.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir //---- 32cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp> 33cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 34cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPage.hpp> 35cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 36cdf0e10cSrcweir #include "chartviewdllapi.hxx" 37cdf0e10cSrcweir 38cdf0e10cSrcweir //............................................................................. 39cdf0e10cSrcweir namespace chart 40cdf0e10cSrcweir { 41cdf0e10cSrcweir //............................................................................. 42cdf0e10cSrcweir 43cdf0e10cSrcweir class OOO_DLLPUBLIC_CHARTVIEW DrawModelWrapper : private SdrModel 44cdf0e10cSrcweir { 45cdf0e10cSrcweir private: 46cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > m_xMCF; 47cdf0e10cSrcweir SfxItemPool* m_pChartItemPool; 48cdf0e10cSrcweir 49cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > m_xMainDrawPage; 50cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > m_xHiddenDrawPage; 51cdf0e10cSrcweir 52cdf0e10cSrcweir std::auto_ptr< OutputDevice > m_apRefDevice; 53cdf0e10cSrcweir 54cdf0e10cSrcweir //no default constructor 55cdf0e10cSrcweir DrawModelWrapper(); 56cdf0e10cSrcweir 57cdf0e10cSrcweir public: 58cdf0e10cSrcweir SAL_DLLPRIVATE DrawModelWrapper(::com::sun::star::uno::Reference< 59cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext > const & xContext ); 60cdf0e10cSrcweir SAL_DLLPRIVATE virtual ~DrawModelWrapper(); 61cdf0e10cSrcweir 62cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getShapeFactory(); 63cdf0e10cSrcweir 64cdf0e10cSrcweir // the main page will contain the normal view objects 65cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > getMainDrawPage(); 66cdf0e10cSrcweir SAL_DLLPRIVATE void clearMainDrawPage(); 67cdf0e10cSrcweir 68cdf0e10cSrcweir // the extra page is not visible, but contains some extras like the symbols for data points 69cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > getHiddenDrawPage(); 70cdf0e10cSrcweir 71cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > 72cdf0e10cSrcweir getChartRootShape( const ::com::sun::star::uno::Reference< 73cdf0e10cSrcweir ::com::sun::star::drawing::XDrawPage>& xPage ); 74cdf0e10cSrcweir 75cdf0e10cSrcweir 76cdf0e10cSrcweir SAL_DLLPRIVATE void lockControllers(); 77cdf0e10cSrcweir SAL_DLLPRIVATE void unlockControllers(); 78cdf0e10cSrcweir 79cdf0e10cSrcweir /// tries to get an OutputDevice from the XParent of the model to use as reference device 80cdf0e10cSrcweir SAL_DLLPRIVATE void attachParentReferenceDevice( 81cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel ); 82cdf0e10cSrcweir 83cdf0e10cSrcweir OutputDevice* getReferenceDevice() const; 84cdf0e10cSrcweir 85cdf0e10cSrcweir SfxItemPool& GetItemPool(); 86cdf0e10cSrcweir SAL_DLLPRIVATE const SfxItemPool& GetItemPool() const; 87cdf0e10cSrcweir 88cdf0e10cSrcweir SAL_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 89cdf0e10cSrcweir createUnoModel(); 90cdf0e10cSrcweir SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > 91cdf0e10cSrcweir getUnoModel(); 92cdf0e10cSrcweir SdrModel& getSdrModel(); 93cdf0e10cSrcweir 94*c7be74b1SArmin Le Grand XColorListSharedPtr GetColorTableFromSdrModel() const; 95*c7be74b1SArmin Le Grand XDashListSharedPtr GetDashListFromSdrModel() const; 96*c7be74b1SArmin Le Grand XLineEndListSharedPtr GetLineEndListFromSdrModel() const; 97*c7be74b1SArmin Le Grand XGradientListSharedPtr GetGradientListFromSdrModel() const; 98*c7be74b1SArmin Le Grand XHatchListSharedPtr GetHatchListFromSdrModel() const; 99*c7be74b1SArmin Le Grand XBitmapListSharedPtr GetBitmapListFromSdrModel() const; 100cdf0e10cSrcweir 101cdf0e10cSrcweir SdrObject* getNamedSdrObject( const rtl::OUString& rName ); 102cdf0e10cSrcweir static SdrObject* getNamedSdrObject( const String& rName, SdrObjList* pObjList ); 103cdf0e10cSrcweir 104cdf0e10cSrcweir static bool removeShape( const ::com::sun::star::uno::Reference< 105cdf0e10cSrcweir ::com::sun::star::drawing::XShape >& xShape ); 106cdf0e10cSrcweir }; 107cdf0e10cSrcweir //............................................................................. 108cdf0e10cSrcweir } //namespace chart 109cdf0e10cSrcweir //............................................................................. 110cdf0e10cSrcweir #endif 111