1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #ifndef _CHART2_MINIMUMANDMAXIMUMSUPPLIER_HXX
21 #define _CHART2_MINIMUMANDMAXIMUMSUPPLIER_HXX
23 #include <sal/types.h>
24 #include <tools/date.hxx>
27 //.............................................................................
30 //.............................................................................
32 //-----------------------------------------------------------------------------
36 class MinimumAndMaximumSupplier
39 virtual double getMinimumX() = 0;
40 virtual double getMaximumX() = 0;
42 //problem y maybe not is always the second border to ask for
43 virtual double getMinimumYInRange( double fMinimumX
, double fMaximumX
, sal_Int32 nAxisIndex
) = 0;
44 virtual double getMaximumYInRange( double fMinimumX
, double fMaximumX
, sal_Int32 nAxisIndex
) = 0;
46 //problem: z maybe not independent in future
47 virtual double getMinimumZ() = 0;
48 virtual double getMaximumZ() = 0;
50 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex
) = 0;
51 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex
) = 0;
52 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex
) = 0;
53 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex
) = 0;
54 virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex
) = 0;
56 //return a constant out of ::com::sun::star::chart::TimeUnit that allows to display the smallest distance between occuring dates
57 virtual long calculateTimeResolutionOnXAxis() = 0;
58 virtual void setTimeResolutionOnXAxis( long nTimeResolution
, const Date
& rNullDate
) = 0;
61 ~MinimumAndMaximumSupplier() {}
64 class MergedMinimumAndMaximumSupplier
: public MinimumAndMaximumSupplier
67 MergedMinimumAndMaximumSupplier();
68 virtual ~MergedMinimumAndMaximumSupplier();
70 void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier
* pMinimumAndMaximumSupplier
);
71 bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier
* pMinimumAndMaximumSupplier
);
72 void clearMinimumAndMaximumSupplierList();
74 //--MinimumAndMaximumSupplier
75 virtual double getMinimumX();
76 virtual double getMaximumX();
77 virtual double getMinimumYInRange( double fMinimumX
, double fMaximumX
, sal_Int32 nAxisIndex
);
78 virtual double getMaximumYInRange( double fMinimumX
, double fMaximumX
, sal_Int32 nAxisIndex
);
79 virtual double getMinimumZ();
80 virtual double getMaximumZ();
82 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex
);
83 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex
);
84 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex
);
85 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex
);
86 virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex
);
88 virtual long calculateTimeResolutionOnXAxis();
89 virtual void setTimeResolutionOnXAxis( long nTimeResolution
, const Date
& rNullDate
);
92 typedef ::std::set
< MinimumAndMaximumSupplier
* > MinimumAndMaximumSupplierSet
;
93 MinimumAndMaximumSupplierSet m_aMinimumAndMaximumSupplierList
;
95 inline MinimumAndMaximumSupplierSet::iterator
begin() { return m_aMinimumAndMaximumSupplierList
.begin(); }
96 inline MinimumAndMaximumSupplierSet::iterator
end() { return m_aMinimumAndMaximumSupplierList
.end(); }
99 //.............................................................................
101 //.............................................................................
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */