1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DrawModelWrapper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CHART2_DRAWMODELWRAPPER_HXX
31 #define _CHART2_DRAWMODELWRAPPER_HXX
34 #include <svx/svdmodel.hxx>
35 // header for class SdrObject
36 #include <svx/svdobj.hxx>
39 #include <com/sun/star/frame/XModel.hpp>
40 #include <com/sun/star/uno/XComponentContext.hpp>
41 #include <com/sun/star/drawing/XDrawPage.hpp>
42 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
43 #include "chartviewdllapi.hxx"
45 //.............................................................................
48 //.............................................................................
50 class OOO_DLLPUBLIC_CHARTVIEW DrawModelWrapper
: private SdrModel
53 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiComponentFactory
> m_xMCF
;
54 SfxItemPool
* m_pChartItemPool
;
56 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> m_xMainDrawPage
;
57 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> m_xHiddenDrawPage
;
59 std::auto_ptr
< OutputDevice
> m_apRefDevice
;
61 //no default constructor
65 SAL_DLLPRIVATE
DrawModelWrapper(::com::sun::star::uno::Reference
<
66 ::com::sun::star::uno::XComponentContext
> const & xContext
);
67 SAL_DLLPRIVATE
virtual ~DrawModelWrapper();
69 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> getShapeFactory();
71 // the main page will contain the normal view objects
72 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> getMainDrawPage();
73 SAL_DLLPRIVATE
void clearMainDrawPage();
75 // the extra page is not visible, but contains some extras like the symbols for data points
76 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> getHiddenDrawPage();
78 static ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>
79 getChartRootShape( const ::com::sun::star::uno::Reference
<
80 ::com::sun::star::drawing::XDrawPage
>& xPage
);
83 SAL_DLLPRIVATE
void lockControllers();
84 SAL_DLLPRIVATE
void unlockControllers();
86 /// tries to get an OutputDevice from the XParent of the model to use as reference device
87 SAL_DLLPRIVATE
void attachParentReferenceDevice(
88 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & xChartModel
);
90 OutputDevice
* getReferenceDevice() const;
92 SfxItemPool
& GetItemPool();
93 SAL_DLLPRIVATE
const SfxItemPool
& GetItemPool() const;
95 SAL_DLLPRIVATE
virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
97 SAL_DLLPRIVATE ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>
99 SdrModel
& getSdrModel();
101 SAL_DLLPRIVATE
void updateTablesFromChartModel( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& xChartModel
);
103 XColorTable
* GetColorTable() const;
104 XDashList
* GetDashList() const;
105 XLineEndList
* GetLineEndList() const;
106 XGradientList
* GetGradientList() const;
107 XHatchList
* GetHatchList() const;
108 XBitmapList
* GetBitmapList() const;
110 SdrObject
* getNamedSdrObject( const rtl::OUString
& rName
);
111 static SdrObject
* getNamedSdrObject( const String
& rName
, SdrObjList
* pObjList
);
113 static bool removeShape( const ::com::sun::star::uno::Reference
<
114 ::com::sun::star::drawing::XShape
>& xShape
);
116 //.............................................................................
118 //.............................................................................