LibreOffice Module chart2 (master) 1
Chart2ModelContact.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include <com/sun/star/awt/Size.hpp>
22#include <com/sun/star/awt/Point.hpp>
23#include <com/sun/star/awt/Rectangle.hpp>
24#include <rtl/ref.hxx>
25#include <svx/unopage.hxx>
26#include <unotools/weakref.hxx>
27#include <ChartModel.hxx>
28#include <Diagram.hxx>
29#include <map>
30
31namespace chart { struct ExplicitIncrementData; }
32namespace chart { struct ExplicitScaleData; }
33namespace com::sun::star::chart2 { class XAxis; }
34namespace com::sun::star::chart2 { class XChartDocument; }
35namespace com::sun::star::chart2 { class XDataSeries; }
36namespace com::sun::star::chart2 { class XDiagram; }
37namespace com::sun::star::chart2 { class XTitle; }
38namespace com::sun::star::container { class XNameContainer; }
39namespace com::sun::star::drawing { class XDrawPage; }
40namespace com::sun::star::frame { class XModel; }
41namespace com::sun::star::lang { class XUnoTunnel; }
42namespace com::sun::star::uno { class XComponentContext; }
43
44
45namespace chart
46{
47class ExplicitValueProvider;
48class ChartModel;
49
50namespace wrapper
51{
52
54{
55public:
56 explicit Chart2ModelContact( const css::uno::Reference< css::uno::XComponentContext >& xContext );
58
59public:
60 void setDocumentModel( ChartModel* pChartModel );
61 void clear();
62
64
66
68
74 ExplicitScaleData & rOutExplicitScale,
75 ExplicitIncrementData & rOutExplicitIncrement );
76
79
81 const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
82
86 css::awt::Size GetPageSize() const;
87
90 css::awt::Rectangle SubstractAxisTitleSizes( const css::awt::Rectangle& rPositionRect );
91
95 css::awt::Rectangle GetDiagramRectangleIncludingTitle() const;
96
100 css::awt::Rectangle GetDiagramRectangleIncludingAxes() const;
101
105 css::awt::Rectangle GetDiagramRectangleExcludingAxes() const;
106
109 css::awt::Size GetLegendSize() const;
110
113 css::awt::Point GetLegendPosition() const;
114
117 css::awt::Size GetTitleSize( const css::uno::Reference< css::chart2::XTitle > & xTitle ) const;
118
121 css::awt::Point GetTitlePosition( const css::uno::Reference< css::chart2::XTitle > & xTitle ) const;
122
125 css::awt::Size GetAxisSize( const css::uno::Reference< css::chart2::XAxis > & xAxis ) const;
126
129 css::awt::Point GetAxisPosition( const css::uno::Reference< css::chart2::XAxis > & xAxis ) const;
130
131private: //methods
132 ExplicitValueProvider* getExplicitValueProvider() const;
134
135public: //member
136 css::uno::Reference< css::uno::XComponentContext > m_xContext;
137
138private: //member
140
142
143 std::map< OUString, css::uno::Reference< css::container::XNameContainer > > m_aTableMap;
144};
145
146} // namespace wrapper
147} // namespace chart
148
149/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void setDocumentModel(ChartModel *pChartModel)
rtl::Reference< ChartModel > getDocumentModel() const
rtl::Reference< ChartView > const & getChartView() const
css::awt::Point GetAxisPosition(const css::uno::Reference< css::chart2::XAxis > &xAxis) const
Returns the position of the object in logic coordinates.
css::awt::Rectangle GetDiagramRectangleExcludingAxes() const
Returns the position and size of the diagram in logic coordinates (100th mm) excluding the space used...
Chart2ModelContact(const css::uno::Reference< css::uno::XComponentContext > &xContext)
css::awt::Size GetAxisSize(const css::uno::Reference< css::chart2::XAxis > &xAxis) const
Returns the size of the object in logic coordinates.
css::awt::Point GetTitlePosition(const css::uno::Reference< css::chart2::XTitle > &xTitle) const
Returns the position of the object in logic coordinates.
css::awt::Rectangle SubstractAxisTitleSizes(const css::awt::Rectangle &rPositionRect)
calculates the current axes title sizes and subtract that space them from the given rectangle
css::awt::Point GetLegendPosition() const
Returns the position of the object in logic coordinates.
sal_Int32 getExplicitNumberFormatKeyForAxis(const rtl::Reference< ::chart::Axis > &xAxis)
css::awt::Rectangle GetDiagramRectangleIncludingAxes() const
Returns the position and size of the diagram in logic coordinates (100th mm) including the space used...
std::map< OUString, css::uno::Reference< css::container::XNameContainer > > m_aTableMap
css::awt::Rectangle GetDiagramRectangleIncludingTitle() const
Returns the position and size of the diagram in logic coordinates (100th mm) including the space used...
css::uno::Reference< css::uno::XComponentContext > m_xContext
rtl::Reference< ChartView > m_xChartView
static sal_Int32 getExplicitNumberFormatKeyForSeries(const css::uno::Reference< css::chart2::XDataSeries > &xSeries)
ExplicitValueProvider * getExplicitValueProvider() const
rtl::Reference< SvxDrawPage > getDrawPage() const
css::awt::Size GetPageSize() const
Returns the size of the page in logic coordinates.
rtl::Reference< ::chart::Diagram > getDiagram() const
css::awt::Size GetTitleSize(const css::uno::Reference< css::chart2::XTitle > &xTitle) const
Returns the size of the object in logic coordinates.
unotools::WeakReference< ChartModel > m_xChartModel
css::awt::Size GetLegendSize() const
Returns the size of the object in logic coordinates.
void getExplicitValuesForAxis(const rtl::Reference< ::chart::Axis > &xAxis, ExplicitScaleData &rOutExplicitScale, ExplicitIncrementData &rOutExplicitIncrement)
get the current values calculated for an axis in the current view in case properties are 'auto'.
describes how tickmarks are positioned on the scale of an axis.
This structure contains the explicit values for a scale like Minimum and Maximum.