1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_INC_CHARTVIEW_DRAWMODELWRAPPER_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_CHARTVIEW_DRAWMODELWRAPPER_HXX
22 #include <svx/svdmodel.hxx>
23 #include <svx/svdobj.hxx>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <com/sun/star/drawing/XDrawPage.hpp>
28 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 #include "chartviewdllapi.hxx"
31 #include <boost/scoped_ptr.hpp>
36 class OOO_DLLPUBLIC_CHARTVIEW DrawModelWrapper
: private SdrModel
39 SfxItemPool
* m_pChartItemPool
;
41 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> m_xMainDrawPage
;
42 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> m_xHiddenDrawPage
;
44 VclPtr
<OutputDevice
> m_pRefDevice
;
46 //no default constructor
50 SAL_DLLPRIVATE
DrawModelWrapper(
51 const com::sun::star::uno::Reference
<com::sun::star::uno::XComponentContext
>& xContext
);
52 SAL_DLLPRIVATE
virtual ~DrawModelWrapper();
54 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> getShapeFactory();
56 // the main page will contain the normal view objects
57 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> getMainDrawPage();
58 SAL_DLLPRIVATE
void clearMainDrawPage();
60 // the extra page is not visible, but contains some extras like the symbols for data points
61 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> getHiddenDrawPage();
63 static ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>
64 getChartRootShape( const ::com::sun::star::uno::Reference
<
65 ::com::sun::star::drawing::XDrawPage
>& xPage
);
67 SAL_DLLPRIVATE
void lockControllers();
68 SAL_DLLPRIVATE
void unlockControllers();
70 /// tries to get an OutputDevice from the XParent of the model to use as reference device
71 SAL_DLLPRIVATE
void attachParentReferenceDevice(
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & xChartModel
);
74 OutputDevice
* getReferenceDevice() const;
76 SfxItemPool
& GetItemPool();
77 SAL_DLLPRIVATE
const SfxItemPool
& GetItemPool() const;
79 SAL_DLLPRIVATE
virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
80 createUnoModel() SAL_OVERRIDE
;
81 SAL_DLLPRIVATE ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>
83 SdrModel
& getSdrModel();
85 XColorListRef
GetColorList() const;
86 XDashListRef
GetDashList() const;
87 XLineEndListRef
GetLineEndList() const;
88 XGradientListRef
GetGradientList() const;
89 XHatchListRef
GetHatchList() const;
90 XBitmapListRef
GetBitmapList() const;
92 SdrObject
* getNamedSdrObject( const OUString
& rName
);
93 static SdrObject
* getNamedSdrObject( const OUString
& rName
, SdrObjList
* pObjList
);
95 static bool removeShape( const ::com::sun::star::uno::Reference
<
96 ::com::sun::star::drawing::XShape
>& xShape
);
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */