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_CONTROLLER_CHARTAPIWRAPPER_CHART2MODELCONTACT_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_CHART2MODELCONTACT_HXX
22 #include <cppuhelper/weakref.hxx>
23 #include <com/sun/star/awt/Size.hpp>
24 #include <com/sun/star/awt/Point.hpp>
25 #include <com/sun/star/awt/Rectangle.hpp>
29 namespace chart
{ struct ExplicitIncrementData
; }
30 namespace chart
{ struct ExplicitScaleData
; }
31 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XAxis
; } } } }
32 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XChartDocument
; } } } }
33 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XDataSeries
; } } } }
34 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XDiagram
; } } } }
35 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XTitle
; } } } }
36 namespace com
{ namespace sun
{ namespace star
{ namespace container
{ class XNameContainer
; } } } }
37 namespace com
{ namespace sun
{ namespace star
{ namespace drawing
{ class XDrawPage
; } } } }
38 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{ class XModel
; } } } }
39 namespace com
{ namespace sun
{ namespace star
{ namespace lang
{ class XUnoTunnel
; } } } }
40 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ class XComponentContext
; } } } }
45 class ExplicitValueProvider
;
51 class Chart2ModelContact final
54 explicit Chart2ModelContact( const css::uno::Reference
< css::uno::XComponentContext
>& xContext
);
55 ~Chart2ModelContact();
58 void setModel( const css::uno::Reference
< css::frame::XModel
>& xChartModel
);
61 css::uno::Reference
< css::frame::XModel
> getChartModel() const;
63 ChartModel
* getModel() const { return mpModel
;}
65 css::uno::Reference
< css::chart2::XChartDocument
> getChart2Document() const;
66 css::uno::Reference
< css::chart2::XDiagram
> getChart2Diagram() const;
68 css::uno::Reference
< css::drawing::XDrawPage
> getDrawPage() const;
70 /** get the current values calculated for an axis in the current view in
71 case properties are 'auto'.
73 void getExplicitValuesForAxis(
74 const css::uno::Reference
< css::chart2::XAxis
> & xAxis
,
75 ExplicitScaleData
& rOutExplicitScale
,
76 ExplicitIncrementData
& rOutExplicitIncrement
);
78 sal_Int32
getExplicitNumberFormatKeyForAxis(
79 const css::uno::Reference
< css::chart2::XAxis
>& xAxis
);
81 sal_Int32
getExplicitNumberFormatKeyForSeries(
82 const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
);
84 /** Returns the size of the page in logic coordinates. This value is used
85 for setting an appropriate "ReferencePageSize" for FontHeights.
87 css::awt::Size
GetPageSize() const;
89 /** calculates the current axes title sizes and subtract that space them from the given rectangle
91 css::awt::Rectangle
SubstractAxisTitleSizes( const css::awt::Rectangle
& rPositionRect
);
93 /** Returns the position and size of the diagram in logic coordinates (100th mm) including
94 the space used for axes including axes titles.
96 css::awt::Rectangle
GetDiagramRectangleIncludingTitle() const;
98 /** Returns the position and size of the diagram in logic coordinates (100th mm) including
99 the space used for axes excluding axes titles.
101 css::awt::Rectangle
GetDiagramRectangleIncludingAxes() const;
103 /** Returns the position and size of the diagram in logic coordinates (100th mm) excluding
104 the space used for axes (inner plot area).
106 css::awt::Rectangle
GetDiagramRectangleExcludingAxes() const;
108 /** Returns the size of the object in logic coordinates.
110 css::awt::Size
GetLegendSize() const;
112 /** Returns the position of the object in logic coordinates.
114 css::awt::Point
GetLegendPosition() const;
116 /** Returns the size of the object in logic coordinates.
118 css::awt::Size
GetTitleSize( const css::uno::Reference
< css::chart2::XTitle
> & xTitle
) const;
120 /** Returns the position of the object in logic coordinates.
122 css::awt::Point
GetTitlePosition( const css::uno::Reference
< css::chart2::XTitle
> & xTitle
) const;
124 /** Returns the size of the object in logic coordinates.
126 css::awt::Size
GetAxisSize( const css::uno::Reference
< css::chart2::XAxis
> & xAxis
) const;
128 /** Returns the position of the object in logic coordinates.
130 css::awt::Point
GetAxisPosition( const css::uno::Reference
< css::chart2::XAxis
> & xAxis
) const;
133 ExplicitValueProvider
* getExplicitValueProvider() const;
134 css::uno::Reference
< css::lang::XUnoTunnel
> const & getChartView() const;
137 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
140 css::uno::WeakReference
< css::frame::XModel
> m_xChartModel
;
144 mutable css::uno::Reference
< css::lang::XUnoTunnel
> m_xChartView
;
146 std::map
< OUString
, css::uno::Reference
< css::container::XNameContainer
> > m_aTableMap
;
149 } // namespace wrapper
152 // INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_CHART2MODELCONTACT_HXX
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */