Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / inc / chartview / ExplicitValueProvider.hxx
blob7fec9b254625b15496d5c564e5642523abf349a5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_EXPLICITVALUEPROVIDER_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_CHARTVIEW_EXPLICITVALUEPROVIDER_HXX
22 #include <com/sun/star/awt/Rectangle.hpp>
23 #include <chartview/chartviewdllapi.hxx>
25 #include <memory>
27 namespace chart { class ChartModel; }
28 namespace chart { struct ExplicitIncrementData; }
29 namespace chart { struct ExplicitScaleData; }
30 namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
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 XCoordinateSystem; } } } }
34 namespace com { namespace sun { namespace star { namespace chart2 { class XDataSeries; } } } }
35 namespace com { namespace sun { namespace star { namespace chart2 { class XDiagram; } } } }
36 namespace com { namespace sun { namespace star { namespace drawing { class XShape; } } } }
37 namespace com { namespace sun { namespace star { namespace uno { class XInterface; } } } }
38 namespace com { namespace sun { namespace star { namespace uno { template <typename > class Reference; } } } }
39 namespace com { namespace sun { namespace star { namespace uno { template <typename > class Sequence; } } } }
40 namespace com { namespace sun { namespace star { namespace util { class XNumberFormatsSupplier; } } } }
42 namespace chart
45 class DrawModelWrapper;
46 class OOO_DLLPUBLIC_CHARTVIEW ExplicitValueProvider
48 public:
49 /** Gives calculated scale and increment values for a given xAxis in the current view.
50 In contrast to the model data these explicit values are always complete as missing auto properties are calculated.
51 If the given Axis could not be found or for another reason no correct output can be given false is returned.
53 virtual bool getExplicitValuesForAxis(
54 css::uno::Reference< css::chart2::XAxis > xAxis
55 , ExplicitScaleData& rExplicitScale
56 , ExplicitIncrementData& rExplicitIncrement )=0;
58 /** for rotated objects the shape size and position differs from the visible rectangle
59 if bSnapRect is set to true you get the resulting visible position (left-top) and size
61 virtual css::awt::Rectangle
62 getRectangleOfObject( const OUString& rObjectCID, bool bSnapRect=false )=0;
64 virtual css::awt::Rectangle getDiagramRectangleExcludingAxes()=0;
66 virtual css::uno::Reference< css::drawing::XShape >
67 getShapeForCID( const OUString& rObjectCID )=0;
69 virtual std::shared_ptr< DrawModelWrapper > getDrawModelWrapper() = 0;
71 static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
73 static css::awt::Rectangle
74 AddSubtractAxisTitleSizes(
75 ChartModel& rModel
76 , const css::uno::Reference< css::uno::XInterface >& xChartView
77 , const css::awt::Rectangle& rPositionAndSize, bool bSubtract );
79 static sal_Int32 getExplicitNumberFormatKeyForAxis(
80 const css::uno::Reference< css::chart2::XAxis >& xAxis
81 , const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
82 , const css::uno::Reference< css::chart2::XChartDocument>& xChartDoc);
84 static sal_Int32 getExplicitNumberFormatKeyForDataLabel(
85 const css::uno::Reference< css::beans::XPropertySet >& xSeriesOrPointProp
86 , const css::uno::Reference< css::chart2::XDataSeries >& xSeries
87 , sal_Int32 nPointIndex /*-1 for whole series*/
88 , const css::uno::Reference< css::chart2::XDiagram >& xDiagram );
90 static sal_Int32 getExplicitPercentageNumberFormatKeyForDataLabel(
91 const css::uno::Reference< css::beans::XPropertySet >& xSeriesOrPointProp
92 , const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
94 protected:
95 ~ExplicitValueProvider() {}
98 } //namespace chart
99 #endif
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */