xref: /trunk/main/chart2/source/view/axes/VAxisBase.hxx (revision de7b3f82)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _CHART2_VAXISBASE_HXX
24 #define _CHART2_VAXISBASE_HXX
25 
26 #include "VAxisOrGridBase.hxx"
27 #include "VAxisProperties.hxx"
28 #include "Tickmarks.hxx"
29 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
30 
31 //.............................................................................
32 namespace chart
33 {
34 //.............................................................................
35 
36 //-----------------------------------------------------------------------------
37 /**
38 */
39 
40 class VAxisBase : public VAxisOrGridBase
41 {
42 public:
43     VAxisBase( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
44            , const AxisProperties& rAxisProperties
45            , const ::com::sun::star::uno::Reference<
46                     ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
47     virtual ~VAxisBase();
48 
49     sal_Int32 getDimensionCount();
50 
51     virtual void createMaximumLabels()=0;
52     virtual void createLabels()=0;
53     virtual void updatePositions()=0;
54 
55     virtual sal_Bool isAnythingToDraw();
56     virtual void initAxisLabelProperties(
57                     const ::com::sun::star::awt::Size& rFontReferenceSize
58                   , const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels );
59 
60     virtual void setExplicitScaleAndIncrement(
61             const ExplicitScaleData& rScale
62           , const ExplicitIncrementData& rIncrement )
63                 throw (::com::sun::star::uno::RuntimeException);
64 
65     virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
66     virtual void createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos );
67 
68     void setExrtaLinePositionAtOtherAxis( const double& fCrossingAt );
69 
70     //-------------------------------------------------------------------------
71     //-------------------------------------------------------------------------
72 protected: //methods
73     sal_Int32 getIndexOfLongestLabel( const ::com::sun::star::uno::Sequence< rtl::OUString >& rLabels );
74     void removeTextShapesFromTicks();
75     void updateUnscaledValuesAtTicks( TickIter& rIter );
76 
77     virtual bool prepareShapeCreation();
78     void recordMaximumTextSize( const ::com::sun::star::uno::Reference<
79                     ::com::sun::star::drawing::XShape >& xShape
80                     , double fRotationAngleDegree );
81 
82     bool isDateAxis() const;
83     bool isComplexCategoryAxis() const;
84 
85 protected: //member
86     ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >  m_xNumberFormatsSupplier;
87     AxisProperties                                                                      m_aAxisProperties;
88     AxisLabelProperties                                                                 m_aAxisLabelProperties;
89     ::com::sun::star::uno::Sequence< rtl::OUString >                                    m_aTextLabels;
90     bool                                                                                m_bUseTextLabels;
91 
92     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > m_xGroupShape_Shapes;
93     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > m_xTextTarget;
94 
95     ::std::vector< ::std::vector< TickInfo > >                                          m_aAllTickInfos;
96     bool m_bReCreateAllTickInfos;
97 
98     bool m_bRecordMaximumTextSize;
99     sal_Int32 m_nMaximumTextWidthSoFar;
100     sal_Int32 m_nMaximumTextHeightSoFar;
101 };
102 
103 //.............................................................................
104 } //namespace chart
105 //.............................................................................
106 #endif
107