Line data Source code
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 : #ifndef INCLUDED_CHART2_SOURCE_INC_CHARTVIEW_EXPLICITVALUEPROVIDER_HXX
20 : #define INCLUDED_CHART2_SOURCE_INC_CHARTVIEW_EXPLICITVALUEPROVIDER_HXX
21 :
22 : #include "ExplicitScaleValues.hxx"
23 :
24 : #include <boost/shared_ptr.hpp>
25 : #include <com/sun/star/chart2/XAxis.hpp>
26 : #include <com/sun/star/chart2/XCoordinateSystem.hpp>
27 : #include <com/sun/star/chart2/XDataSeries.hpp>
28 : #include <com/sun/star/chart2/XDiagram.hpp>
29 : #include <com/sun/star/awt/Rectangle.hpp>
30 : #include <com/sun/star/frame/XModel.hpp>
31 : #include <com/sun/star/drawing/XShape.hpp>
32 : #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
33 : #include "chartviewdllapi.hxx"
34 :
35 : #include "ChartModel.hxx"
36 :
37 : namespace chart
38 : {
39 :
40 : /**
41 : */
42 :
43 : class DrawModelWrapper;
44 606 : class OOO_DLLPUBLIC_CHARTVIEW ExplicitValueProvider
45 : {
46 : public:
47 : /** Gives calculated scale and increment values for a given xAxis in the current view.
48 : In contrast to the model data these explicit values are always complete as misssing auto properties are calculated.
49 : If the given Axis could not be found or for another reason no correct output can be given false is returned.
50 : */
51 : virtual bool getExplicitValuesForAxis(
52 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > xAxis
53 : , ExplicitScaleData& rExplicitScale
54 : , ExplicitIncrementData& rExplicitIncrement )=0;
55 :
56 : /** for rotated objects the shape size and position differs from the visible rectangle
57 : if bSnapRect is set to true you get the resulting visible position (left-top) and size
58 : */
59 : virtual ::com::sun::star::awt::Rectangle
60 : getRectangleOfObject( const OUString& rObjectCID, bool bSnapRect=false )=0;
61 :
62 : virtual ::com::sun::star::awt::Rectangle getDiagramRectangleExcludingAxes()=0;
63 :
64 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
65 : getShapeForCID( const OUString& rObjectCID )=0;
66 :
67 : virtual ::boost::shared_ptr< DrawModelWrapper > getDrawModelWrapper() = 0;
68 :
69 : static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
70 : static ExplicitValueProvider* getExplicitValueProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xChartView );
71 :
72 : static ::com::sun::star::awt::Rectangle
73 : addAxisTitleSizes(
74 : ChartModel& rModel
75 : , const ::com::sun::star::uno::Reference<
76 : ::com::sun::star::uno::XInterface >& xChartView
77 : , const ::com::sun::star::awt::Rectangle& rExcludingPositionAndSize );
78 :
79 : static ::com::sun::star::awt::Rectangle
80 : substractAxisTitleSizes(
81 : ChartModel& rModel
82 : , const ::com::sun::star::uno::Reference<
83 : ::com::sun::star::uno::XInterface >& xChartView
84 : , const ::com::sun::star::awt::Rectangle& rPositionAndSizeIncludingTitles );
85 :
86 : static sal_Int32 getExplicitNumberFormatKeyForAxis(
87 : const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis
88 : , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
89 : , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument>& xChartDoc);
90 :
91 : static sal_Int32 getExplicitNumberFormatKeyForDataLabel(
92 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesOrPointProp
93 : , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries
94 : , sal_Int32 nPointIndex /*-1 for whole series*/
95 : , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram );
96 :
97 : static sal_Int32 getExplicitPercentageNumberFormatKeyForDataLabel(
98 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesOrPointProp
99 : , const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
100 :
101 : protected:
102 574 : ~ExplicitValueProvider() {}
103 : };
104 :
105 : } //namespace chart
106 : #endif
107 :
108 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|