unoxml: port testXNamedNodeMap_AttributesMap from java to c++
[libreoffice.git] / chart2 / source / inc / chartview / ExplicitScaleValues.hxx
blob07b8290cb7db87d90e898e068edee10c48745a0f
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 <config_options.h>
22 #include <chartview/chartviewdllapi.hxx>
23 #include <com/sun/star/chart/TimeInterval.hpp>
24 #include <com/sun/star/chart2/AxisOrientation.hpp>
25 #include <com/sun/star/chart2/XScaling.hpp>
26 #include <tools/date.hxx>
27 #include <vector>
29 namespace com::sun::star::chart2
31 class XScaling;
34 namespace chart
36 /** This structure contains the explicit values for a scale like Minimum and Maximum.
37 See also css::chart2::ScaleData.
39 struct UNLESS_MERGELIBS(OOO_DLLPUBLIC_CHARTVIEW) ExplicitScaleData
41 ExplicitScaleData();
43 double Minimum;
44 double Maximum;
45 double Origin;
47 css::chart2::AxisOrientation Orientation;
49 css::uno::Reference<css::chart2::XScaling> Scaling;
51 sal_Int32 AxisType; //see css::chart2::AxisType
52 bool m_bShiftedCategoryPosition;
53 sal_Int32 TimeResolution; //constant of type <type>css::chart::TimeUnit</type>
54 Date NullDate;
57 struct ExplicitSubIncrement
59 ExplicitSubIncrement();
61 /** Numbers of intervals between two superior ticks. For an axis
62 this usually means, that <code>IntervalCount - 1</code>
63 sub-tick-marks are displayed between two superior ticks.
66 sal_Int32 IntervalCount;
68 /** If <TRUE/>, the distance between two sub-tick-marks on the
69 screen is always the same. If <FALSE/>, the distances may
70 differ depending on the <type>XScaling</type>.
72 bool PostEquidistant;
75 /** describes how tickmarks are positioned on the scale of an axis.
77 struct UNLESS_MERGELIBS(OOO_DLLPUBLIC_CHARTVIEW) ExplicitIncrementData
79 ExplicitIncrementData();
81 /** the following two members are only for date-time axis
83 css::chart::TimeInterval MajorTimeInterval;
84 css::chart::TimeInterval MinorTimeInterval;
86 /** the other members are for *not* date-time axis
89 /** <member>Distance</member> describes the distance between two
90 neighboring main tickmarks on a <type>Scale</type> of an axis.
91 All neighboring main tickmarks have the same constant distance.
93 <p>If the Scale has a <type>XScaling</type> the <member>Distance</member>
94 may be measured in two different ways - that is - before or after the
95 scaling is applied.</p>
97 <p>On a logarithmic scale for example the distance between two main
98 tickmarks is typically measured after the scaling is applied:
99 Distance = log(tick2)-log(tick1)
100 ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ).
101 The resulting tickmarks will always look equidistant on the screen.
102 The other possibility is to have a Distance = tick2-tick1 measured constant
103 before a scaling is applied, which may lead to non equidistant tickmarks
104 on the screen.</p>
106 <p><member>PostEquidistant</member> rules whether the <member>Distance</member>
107 is meant to be a value before or after scaling.</p>
109 double Distance;
112 <member>PostEquidistant</member> rules whether the member <member>Distance</member>
113 describes a distance before or after the scaling is applied.
115 <p>If <member>PostEquidistant</member> equals <TRUE/> <member>Distance</member>
116 is given in values after <type>XScaling</type> is applied, thus resulting
117 main tickmarks will always look equidistant on the screen.
118 If <member>PostEquidistant</member> equals <FALSE/> <member>Distance</member>
119 is given in values before <type>XScaling</type> is applied.</p>
121 bool PostEquidistant;
123 /** The <member>BaseValue</member> gives a starting point on the scale
124 to which all further main tickmarks are relatively positioned.
126 <p>The <member>BaseValue</member> is always a value on the scale before
127 a possible scaling is applied. If the given value is not valid in the
128 associated scaling the minimum of the scaling is assumed,
129 if there is no minimum any other obvious value will be assumed.</p>
131 <p>E.g.: assume a scale from 0 to 6 with identical scaling.
132 Further assume this Increment to have Distance==2 and PostEquidistant==false.
133 Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6;
134 Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3;
135 Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3;
136 And setting BaseValue to 2, -2, 4, -4 etc. in this example
137 leads to the same result as BaseValue=0.</p>
139 double BaseValue;
141 /** <member>SubIncrements</member> describes the positioning of further
142 sub tickmarks on the scale of an axis.
144 <p>The first SubIncrement in this sequence determines how the
145 distance between two neighboring main tickmarks is divided for positioning
146 of further sub tickmarks. Every following SubIncrement determines the
147 positions of subsequent tickmarks in relation to their parent tickmarks
148 given by the preceding SubIncrement.</p>
150 std::vector<ExplicitSubIncrement> SubIncrements;
153 } //namespace chart
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */