tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / chart2 / source / inc / chartview / ExplicitValueProvider.hxx
blobf4bc4aac874b8328a3dd7e7832ce19506ce714b3
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 #pragma once
21 #include <config_options.h>
22 #include <sal/types.h>
23 #include <chartview/chartviewdllapi.hxx>
24 #include <rtl/ref.hxx>
25 #include <rtl/ustring.hxx>
27 #include <memory>
29 namespace com::sun::star::beans { class XPropertySet; }
30 namespace com::sun::star::chart2 { class XAxis; }
31 namespace com::sun::star::chart2 { class XChartDocument; }
32 namespace com::sun::star::chart2 { class XCoordinateSystem; }
33 namespace com::sun::star::chart2 { class XDataSeries; }
34 namespace com::sun::star::chart2 { class XDiagram; }
35 namespace com::sun::star::drawing { class XShape; }
36 namespace com::sun::star::uno { class XInterface; }
37 namespace com::sun::star::uno { template <typename > class Reference; }
38 namespace com::sun::star::uno { template <typename > class Sequence; }
39 namespace com::sun::star::util { class XNumberFormatsSupplier; }
40 namespace com::sun::star::awt { struct Rectangle; }
41 class SvxShape;
43 namespace chart
45 class Axis;
46 class BaseCoordinateSystem;
47 class DrawModelWrapper;
48 class ChartModel;
49 struct ExplicitIncrementData;
50 struct ExplicitScaleData;
52 class UNLESS_MERGELIBS(OOO_DLLPUBLIC_CHARTVIEW) SAL_LOPLUGIN_ANNOTATE("crosscast") ExplicitValueProvider
54 public:
55 /** Gives calculated scale and increment values for a given xAxis in the current view.
56 In contrast to the model data these explicit values are always complete as missing auto properties are calculated.
57 If the given Axis could not be found or for another reason no correct output can be given false is returned.
59 virtual bool getExplicitValuesForAxis(
60 rtl::Reference< ::chart::Axis > xAxis
61 , ExplicitScaleData& rExplicitScale
62 , ExplicitIncrementData& rExplicitIncrement )=0;
64 /** for rotated objects the shape size and position differs from the visible rectangle
65 if bSnapRect is set to true you get the resulting visible position (left-top) and size
67 virtual css::awt::Rectangle
68 getRectangleOfObject( const OUString& rObjectCID, bool bSnapRect=false )=0;
70 virtual css::awt::Rectangle getDiagramRectangleExcludingAxes()=0;
72 virtual rtl::Reference< SvxShape >
73 getShapeForCID( const OUString& rObjectCID )=0;
75 virtual std::shared_ptr< DrawModelWrapper > getDrawModelWrapper() = 0;
77 static css::awt::Rectangle
78 AddSubtractAxisTitleSizes(
79 ChartModel& rModel
80 , ExplicitValueProvider* pChartView
81 , const css::awt::Rectangle& rPositionAndSize, bool bSubtract );
83 static sal_Int32 getExplicitNumberFormatKeyForAxis(
84 const rtl::Reference< ::chart::Axis >& xAxis
85 , const rtl::Reference< ::chart::BaseCoordinateSystem > & xCorrespondingCoordinateSystem
86 , const rtl::Reference<::chart::ChartModel>& xChartDoc);
88 static sal_Int32 getExplicitNumberFormatKeyForDataLabel(
89 const css::uno::Reference< css::beans::XPropertySet >& xSeriesOrPointProp );
91 static sal_Int32 getExplicitPercentageNumberFormatKeyForDataLabel(
92 const css::uno::Reference< css::beans::XPropertySet >& xSeriesOrPointProp
93 , const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
95 protected:
96 ~ExplicitValueProvider() = default;
99 } //namespace chart
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */