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 .
21 #include <sal/types.h>
22 #include <chartview/chartviewdllapi.hxx>
23 #include <rtl/ref.hxx>
24 #include <rtl/ustring.hxx>
28 namespace com::sun::star::beans
{ class XPropertySet
; }
29 namespace com::sun::star::chart2
{ class XAxis
; }
30 namespace com::sun::star::chart2
{ class XChartDocument
; }
31 namespace com::sun::star::chart2
{ class XCoordinateSystem
; }
32 namespace com::sun::star::chart2
{ class XDataSeries
; }
33 namespace com::sun::star::chart2
{ class XDiagram
; }
34 namespace com::sun::star::drawing
{ class XShape
; }
35 namespace com::sun::star::uno
{ class XInterface
; }
36 namespace com::sun::star::uno
{ template <typename
> class Reference
; }
37 namespace com::sun::star::uno
{ template <typename
> class Sequence
; }
38 namespace com::sun::star::util
{ class XNumberFormatsSupplier
; }
39 namespace com::sun::star::awt
{ struct Rectangle
; }
45 class BaseCoordinateSystem
;
46 class DrawModelWrapper
;
48 struct ExplicitIncrementData
;
49 struct ExplicitScaleData
;
51 class OOO_DLLPUBLIC_CHARTVIEW
SAL_LOPLUGIN_ANNOTATE("crosscast") ExplicitValueProvider
54 /** Gives calculated scale and increment values for a given xAxis in the current view.
55 In contrast to the model data these explicit values are always complete as missing auto properties are calculated.
56 If the given Axis could not be found or for another reason no correct output can be given false is returned.
58 virtual bool getExplicitValuesForAxis(
59 rtl::Reference
< ::chart::Axis
> xAxis
60 , ExplicitScaleData
& rExplicitScale
61 , ExplicitIncrementData
& rExplicitIncrement
)=0;
63 /** for rotated objects the shape size and position differs from the visible rectangle
64 if bSnapRect is set to true you get the resulting visible position (left-top) and size
66 virtual css::awt::Rectangle
67 getRectangleOfObject( const OUString
& rObjectCID
, bool bSnapRect
=false )=0;
69 virtual css::awt::Rectangle
getDiagramRectangleExcludingAxes()=0;
71 virtual rtl::Reference
< SvxShape
>
72 getShapeForCID( const OUString
& rObjectCID
)=0;
74 virtual std::shared_ptr
< DrawModelWrapper
> getDrawModelWrapper() = 0;
76 static css::awt::Rectangle
77 AddSubtractAxisTitleSizes(
79 , ExplicitValueProvider
* pChartView
80 , const css::awt::Rectangle
& rPositionAndSize
, bool bSubtract
);
82 static sal_Int32
getExplicitNumberFormatKeyForAxis(
83 const rtl::Reference
< ::chart::Axis
>& xAxis
84 , const rtl::Reference
< ::chart::BaseCoordinateSystem
> & xCorrespondingCoordinateSystem
85 , const rtl::Reference
<::chart::ChartModel
>& xChartDoc
);
87 static sal_Int32
getExplicitNumberFormatKeyForDataLabel(
88 const css::uno::Reference
< css::beans::XPropertySet
>& xSeriesOrPointProp
);
90 static sal_Int32
getExplicitPercentageNumberFormatKeyForDataLabel(
91 const css::uno::Reference
< css::beans::XPropertySet
>& xSeriesOrPointProp
92 , const css::uno::Reference
< css::util::XNumberFormatsSupplier
>& xNumberFormatsSupplier
);
95 ~ExplicitValueProvider() = default;
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */