1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ExplicitValueProvider.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CHART2_EXPLICITVALUEPROVIDER_HXX
31 #define _CHART2_EXPLICITVALUEPROVIDER_HXX
33 #include <boost/shared_ptr.hpp>
34 #include <com/sun/star/chart2/ExplicitIncrementData.hpp>
35 #include <com/sun/star/chart2/ExplicitScaleData.hpp>
36 #include <com/sun/star/chart2/XAxis.hpp>
37 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
38 #include <com/sun/star/chart2/XDataSeries.hpp>
39 #include <com/sun/star/chart2/XDiagram.hpp>
40 #include <com/sun/star/awt/Rectangle.hpp>
41 #include <com/sun/star/frame/XModel.hpp>
42 #include <com/sun/star/drawing/XShape.hpp>
43 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
44 #include "chartviewdllapi.hxx"
46 //.............................................................................
49 //.............................................................................
51 //-----------------------------------------------------------------------------
55 class DrawModelWrapper
;
56 class OOO_DLLPUBLIC_CHARTVIEW ExplicitValueProvider
59 /** Gives calculated scale and increment values for a given xAxis in the current view.
60 In contrast to the model data these explicit values are always complete as misssing auto properties are calculated.
61 If the given Axis could not be found or for another reason no correct output can be given false is returned.
63 virtual sal_Bool
getExplicitValuesForAxis(
64 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XAxis
> xAxis
65 , ::com::sun::star::chart2::ExplicitScaleData
& rExplicitScale
66 , ::com::sun::star::chart2::ExplicitIncrementData
& rExplicitIncrement
)=0;
68 /** for rotated objects the shape size and position differs from the visible rectangle
69 if bSnapRect is set to true you get the resulting visible position (left-top) and size
71 virtual ::com::sun::star::awt::Rectangle
72 getRectangleOfObject( const rtl::OUString
& rObjectCID
, bool bSnapRect
=false )=0;
74 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>
75 getShapeForCID( const rtl::OUString
& rObjectCID
)=0;
77 virtual ::boost::shared_ptr
< DrawModelWrapper
> getDrawModelWrapper() = 0;
79 static const com::sun::star::uno::Sequence
<sal_Int8
>& getUnoTunnelId();
80 static ExplicitValueProvider
* getExplicitValueProvider( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xChartView
);
82 static ::com::sun::star::awt::Rectangle
83 calculateDiagramPositionAndSizeInclusiveTitle(
84 const ::com::sun::star::uno::Reference
<
85 ::com::sun::star::frame::XModel
>& xChartModel
86 , const ::com::sun::star::uno::Reference
<
87 ::com::sun::star::uno::XInterface
>& xChartView
88 , const ::com::sun::star::awt::Rectangle
& rExclusivePositionAndSize
);
90 static sal_Int32
getExplicitNumberFormatKeyForAxis(
91 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XAxis
>& xAxis
92 , const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XCoordinateSystem
> & xCorrespondingCoordinateSystem
93 , const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
>& xNumberFormatsSupplier
);
95 SAL_DLLPRIVATE
static sal_Int32
getPercentNumberFormat( const ::com::sun::star::uno::Reference
<
96 ::com::sun::star::util::XNumberFormatsSupplier
>& xNumberFormatsSupplier
);
98 static sal_Int32
getExplicitNumberFormatKeyForDataLabel(
99 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xSeriesOrPointProp
100 , const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>& xSeries
101 , sal_Int32 nPointIndex
/*-1 for whole series*/
102 , const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDiagram
>& xDiagram
);
104 static sal_Int32
getExplicitPercentageNumberFormatKeyForDataLabel(
105 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xSeriesOrPointProp
106 , const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
>& xNumberFormatsSupplier
);
109 //.............................................................................
111 //.............................................................................