fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / view / inc / MinimumAndMaximumSupplier.hxx
blob22d37281d5b753a3aaafe853fa935dc6300aa859
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 .
20 #ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_MINIMUMANDMAXIMUMSUPPLIER_HXX
21 #define INCLUDED_CHART2_SOURCE_VIEW_INC_MINIMUMANDMAXIMUMSUPPLIER_HXX
23 #include <sal/types.h>
24 #include <tools/date.hxx>
25 #include <set>
27 namespace chart
30 /**
33 class MinimumAndMaximumSupplier
35 public:
36 virtual double getMinimumX() = 0;
37 virtual double getMaximumX() = 0;
39 //problem y maybe not is always the second border to ask for
40 virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
41 virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
43 //problem: z maybe not independent in future
44 virtual double getMinimumZ() = 0;
45 virtual double getMaximumZ() = 0;
47 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex ) = 0;
48 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex ) = 0;
49 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ) = 0;
50 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) = 0;
51 virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) = 0;
53 //return a constant out of ::com::sun::star::chart::TimeUnit that allows to display the smallest distance between occurring dates
54 virtual long calculateTimeResolutionOnXAxis() = 0;
55 virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) = 0;
57 protected:
58 ~MinimumAndMaximumSupplier() {}
61 class MergedMinimumAndMaximumSupplier : public MinimumAndMaximumSupplier
63 public:
64 MergedMinimumAndMaximumSupplier();
65 virtual ~MergedMinimumAndMaximumSupplier();
67 void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
68 bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
69 void clearMinimumAndMaximumSupplierList();
71 //--MinimumAndMaximumSupplier
72 virtual double getMinimumX() SAL_OVERRIDE;
73 virtual double getMaximumX() SAL_OVERRIDE;
74 virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) SAL_OVERRIDE;
75 virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) SAL_OVERRIDE;
76 virtual double getMinimumZ() SAL_OVERRIDE;
77 virtual double getMaximumZ() SAL_OVERRIDE;
79 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex ) SAL_OVERRIDE;
80 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex ) SAL_OVERRIDE;
81 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ) SAL_OVERRIDE;
82 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) SAL_OVERRIDE;
83 virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) SAL_OVERRIDE;
85 virtual long calculateTimeResolutionOnXAxis() SAL_OVERRIDE;
86 virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) SAL_OVERRIDE;
88 private:
89 typedef ::std::set< MinimumAndMaximumSupplier* > MinimumAndMaximumSupplierSet;
90 MinimumAndMaximumSupplierSet m_aMinimumAndMaximumSupplierList;
92 inline MinimumAndMaximumSupplierSet::iterator begin() { return m_aMinimumAndMaximumSupplierList.begin(); }
93 inline MinimumAndMaximumSupplierSet::iterator end() { return m_aMinimumAndMaximumSupplierList.end(); }
96 } //namespace chart
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */