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: Chart2ModelContact.hxx,v $
10 * $Revision: 1.3.44.2 $
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 CHART_CHART2MODELCONTACT_HXX
31 #define CHART_CHART2MODELCONTACT_HXX
33 #include <com/sun/star/chart2/ExplicitScaleData.hpp>
34 #include <com/sun/star/chart2/ExplicitIncrementData.hpp>
35 #include <com/sun/star/chart2/XAxis.hpp>
36 #include <com/sun/star/chart2/XChartDocument.hpp>
37 #include <com/sun/star/chart2/XDataSeries.hpp>
38 #include <com/sun/star/chart2/XDiagram.hpp>
39 #include <com/sun/star/chart2/XTitle.hpp>
40 #include <cppuhelper/weakref.hxx>
41 #include <com/sun/star/awt/Size.hpp>
42 #include <com/sun/star/container/XNameContainer.hpp>
43 #include <com/sun/star/drawing/XDrawPage.hpp>
44 #include <com/sun/star/frame/XModel.hpp>
45 #include <com/sun/star/lang/XUnoTunnel.hpp>
46 #include <com/sun/star/uno/XComponentContext.hpp>
52 class ExplicitValueProvider
;
57 class Chart2ModelContact
60 Chart2ModelContact( const ::com::sun::star::uno::Reference
<
61 ::com::sun::star::uno::XComponentContext
>& xContext
);
62 virtual ~Chart2ModelContact();
65 void setModel( const ::com::sun::star::uno::Reference
<
66 ::com::sun::star::frame::XModel
>& xChartModel
);
69 ::com::sun::star::uno::Reference
<
70 ::com::sun::star::frame::XModel
> getChartModel() const;
72 ::com::sun::star::uno::Reference
<
73 ::com::sun::star::chart2::XChartDocument
> getChart2Document() const;
74 ::com::sun::star::uno::Reference
<
75 ::com::sun::star::chart2::XDiagram
> getChart2Diagram() const;
77 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> getDrawPage();
79 /** get the current values calculated for an axis in the current view in
80 case properties are 'auto'.
82 sal_Bool
getExplicitValuesForAxis(
83 const ::com::sun::star::uno::Reference
<
84 ::com::sun::star::chart2::XAxis
> & xAxis
,
85 ::com::sun::star::chart2::ExplicitScaleData
& rOutExplicitScale
,
86 ::com::sun::star::chart2::ExplicitIncrementData
& rOutExplicitIncrement
);
88 sal_Int32
getExplicitNumberFormatKeyForAxis(
89 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XAxis
>& xAxis
);
91 sal_Int32
getExplicitNumberFormatKeyForSeries(
92 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>& xSeries
);
94 /** Returns the size of the page in logic coordinates. This value is used
95 for setting an appropriate "ReferencePageSize" for FontHeights.
97 ::com::sun::star::awt::Size
GetPageSize() const;
99 /** Returns the size of the diagram object in logic coordinates inclusive
100 the space reserved for axis titles.
102 ::com::sun::star::awt::Size
GetDiagramSizeInclusive() const;
104 /** Returns the position of the diagram in logic coordinates inclusive
105 the space reserved for axis titles.
107 ::com::sun::star::awt::Point
GetDiagramPositionInclusive() const;
109 /** Returns the size of the object in logic coordinates.
111 ::com::sun::star::awt::Size
GetLegendSize() const;
113 /** Returns the position of the object in logic coordinates.
115 ::com::sun::star::awt::Point
GetLegendPosition() const;
117 /** Returns the size of the object in logic coordinates.
119 ::com::sun::star::awt::Size
GetTitleSize( const ::com::sun::star::uno::Reference
<
120 ::com::sun::star::chart2::XTitle
> & xTitle
) const;
122 /** Returns the position of the object in logic coordinates.
124 ::com::sun::star::awt::Point
GetTitlePosition( const ::com::sun::star::uno::Reference
<
125 ::com::sun::star::chart2::XTitle
> & xTitle
) const;
128 /** Returns the size of the object in logic coordinates.
130 ::com::sun::star::awt::Size
GetAxisSize( const ::com::sun::star::uno::Reference
<
131 ::com::sun::star::chart2::XAxis
> & xAxis
) const;
133 /** Returns the position of the object in logic coordinates.
135 ::com::sun::star::awt::Point
GetAxisPosition( const ::com::sun::star::uno::Reference
<
136 ::com::sun::star::chart2::XAxis
> & xAxis
) const;
139 ExplicitValueProvider
* getExplicitValueProvider() const;
140 ::com::sun::star::awt::Rectangle
GetDiagramRectangleInclusive() const;
143 ::com::sun::star::uno::Reference
<
144 ::com::sun::star::uno::XComponentContext
>
148 ::com::sun::star::uno::WeakReference
<
149 ::com::sun::star::frame::XModel
> m_xChartModel
;
151 mutable ::com::sun::star::uno::Reference
<
152 ::com::sun::star::lang::XUnoTunnel
> m_xChartView
;
154 typedef std::map
< ::rtl::OUString
, ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> > tTableMap
;//GradientTable, HatchTable etc.
155 tTableMap m_aTableMap
;
158 } // namespace wrapper
161 // CHART_CHART2MODELCONTACT_HXX