update dev300-m58
[ooovba.git] / chart2 / source / view / axes / VAxisBase.hxx
blob717d94a49857a49e5f640804ae6a22a1f8fb93fd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: VAxisBase.hxx,v $
10 * $Revision: 1.3 $
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_VAXISBASE_HXX
31 #define _CHART2_VAXISBASE_HXX
33 #include "VAxisOrGridBase.hxx"
34 #include "VAxisProperties.hxx"
35 #include "TickmarkHelper.hxx"
36 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
38 //.............................................................................
39 namespace chart
41 //.............................................................................
43 //-----------------------------------------------------------------------------
44 /**
47 class VAxisBase : public VAxisOrGridBase
49 public:
50 VAxisBase( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
51 , const AxisProperties& rAxisProperties
52 , const ::com::sun::star::uno::Reference<
53 ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
54 virtual ~VAxisBase();
56 sal_Int32 getDimensionCount();
58 virtual void SAL_CALL createMaximumLabels()=0;
59 virtual void SAL_CALL createLabels()=0;
60 virtual void SAL_CALL updatePositions()=0;
62 virtual sal_Bool SAL_CALL isAnythingToDraw();
63 virtual void SAL_CALL initAxisLabelProperties(
64 const ::com::sun::star::awt::Size& rFontReferenceSize
65 , const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels );
67 virtual void SAL_CALL setExplicitScaleAndIncrement(
68 const ::com::sun::star::chart2::ExplicitScaleData& rScale
69 , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement )
70 throw (::com::sun::star::uno::RuntimeException);
72 virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
74 void setExrtaLinePositionAtOtherAxis( const double& fCrossingAt );
76 //-------------------------------------------------------------------------
77 //-------------------------------------------------------------------------
78 protected: //methods
79 sal_Int32 getIndexOfLongestLabel( const ::com::sun::star::uno::Sequence< rtl::OUString >& rLabels );
80 void removeTextShapesFromTicks( TickIter& rIter, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget );
81 void updateUnscaledValuesAtTicks( TickIter& rIter );
83 virtual bool prepareShapeCreation();
84 void recordMaximumTextSize( const ::com::sun::star::uno::Reference<
85 ::com::sun::star::drawing::XShape >& xShape
86 , double fRotationAngleDegree );
88 protected: //member
89 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier;
90 AxisProperties m_aAxisProperties;
91 AxisLabelProperties m_aAxisLabelProperties;
92 ::com::sun::star::uno::Sequence< rtl::OUString > m_aTextLabels;
93 bool m_bUseTextLabels;
95 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > m_xGroupShape_Shapes;
96 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > m_xTextTarget;
98 ::std::vector< ::std::vector< TickInfo > > m_aAllTickInfos;
99 bool m_bReCreateAllTickInfos;
101 bool m_bRecordMaximumTextSize;
102 sal_Int32 m_nMaximumTextWidthSoFar;
103 sal_Int32 m_nMaximumTextHeightSoFar;
106 //.............................................................................
107 } //namespace chart
108 //.............................................................................
109 #endif