nss: upgrade to release 3.73
[LibreOffice.git] / chart2 / source / view / axes / VAxisBase.hxx
blobc8a8667770e1a133c8d25be215122640dd372fdc
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 "VAxisOrGridBase.hxx"
22 #include "VAxisProperties.hxx"
23 #include "Tickmarks.hxx"
25 namespace com::sun::star::util { class XNumberFormatsSupplier; }
27 namespace chart
30 class VAxisBase : public VAxisOrGridBase
32 public:
33 VAxisBase( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
34 , const AxisProperties& rAxisProperties
35 , const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
36 virtual ~VAxisBase() override;
38 /**
39 * Return the number of dimensions the diagram has. 2 for x and y, and 3
40 * for x, y, and z.
42 sal_Int32 getDimensionCount() const;
44 virtual void createMaximumLabels()=0;
45 virtual void createLabels()=0;
46 virtual void updatePositions()=0;
48 virtual bool isAnythingToDraw();
49 virtual void initAxisLabelProperties(
50 const css::awt::Size& rFontReferenceSize
51 , const css::awt::Rectangle& rMaximumSpaceForLabels );
53 virtual void setExplicitScaleAndIncrement(
54 const ExplicitScaleData& rScale
55 , const ExplicitIncrementData& rIncrement ) override;
57 virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
58 virtual void createAllTickInfos( TickInfoArraysType& rAllTickInfos );
60 void setExtraLinePositionAtOtherAxis( double fCrossingAt );
62 protected: //methods
63 static size_t getIndexOfLongestLabel( const css::uno::Sequence<OUString>& rLabels );
64 void removeTextShapesFromTicks();
65 void updateUnscaledValuesAtTicks( TickIter& rIter );
67 virtual bool prepareShapeCreation();
68 void recordMaximumTextSize( const css::uno::Reference< css::drawing::XShape >& xShape
69 , double fRotationAngleDegree );
71 bool isDateAxis() const;
72 bool isComplexCategoryAxis() const;
74 protected: //member
75 css::uno::Reference< css::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier;
76 AxisProperties m_aAxisProperties;
77 AxisLabelProperties m_aAxisLabelProperties;
78 css::uno::Sequence< OUString > m_aTextLabels;
79 bool m_bUseTextLabels;
81 css::uno::Reference< css::drawing::XShapes > m_xGroupShape_Shapes;
82 css::uno::Reference< css::drawing::XShapes > m_xTextTarget;
84 /**
85 * This typically consists of 2 TickInfo vectors (i.e. the outer vector
86 * has 2 child vector elements) for normal axis. The first vector
87 * corresponds with the major ticks while the second corresponds with the
88 * minor ticks.
90 * It may have more than 2 TickInfo vectors for complex category axis
91 * which has multi-level axis labels.
93 TickInfoArraysType m_aAllTickInfos;
94 bool m_bReCreateAllTickInfos;
96 bool m_bRecordMaximumTextSize;
97 sal_Int32 m_nMaximumTextWidthSoFar;
98 sal_Int32 m_nMaximumTextHeightSoFar;
101 } //namespace chart
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */