Update ooo320-m1
[ooovba.git] / chart2 / source / view / inc / MinimumAndMaximumSupplier.hxx
blobd1f4169432ef9698c776eb7f38e0cc65a6bd999d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: MinimumAndMaximumSupplier.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CHART2_MINIMUMANDMAXIMUMSUPPLIER_HXX
32 #define _CHART2_MINIMUMANDMAXIMUMSUPPLIER_HXX
34 #include <sal/types.h>
36 #include <set>
38 //.............................................................................
39 namespace chart
41 //.............................................................................
43 //-----------------------------------------------------------------------------
44 /**
47 class MinimumAndMaximumSupplier
49 public:
50 virtual double getMinimumX() = 0;
51 virtual double getMaximumX() = 0;
53 //problem y maybe not is always the second border to ask for
54 virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
55 virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
57 //problem: z maybe not independent in future
58 virtual double getMinimumZ() = 0;
59 virtual double getMaximumZ() = 0;
61 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex ) = 0;
62 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex ) = 0;
63 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ) = 0;
64 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) = 0;
65 virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) = 0;
68 class MergedMinimumAndMaximumSupplier : public MinimumAndMaximumSupplier
70 public:
71 MergedMinimumAndMaximumSupplier();
72 virtual ~MergedMinimumAndMaximumSupplier();
74 void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
75 bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
76 void clearMinimumAndMaximumSupplierList();
78 //--MinimumAndMaximumSupplier
79 virtual double getMinimumX();
80 virtual double getMaximumX();
81 virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex );
82 virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex );
83 virtual double getMinimumZ();
84 virtual double getMaximumZ();
86 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex );
87 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex );
88 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex );
89 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex );
90 virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
92 private:
93 typedef ::std::set< MinimumAndMaximumSupplier* > MinimumAndMaximumSupplierSet;
94 MinimumAndMaximumSupplierSet m_aMinimumAndMaximumSupplierList;
96 inline MinimumAndMaximumSupplierSet::iterator begin() { return m_aMinimumAndMaximumSupplierList.begin(); }
97 inline MinimumAndMaximumSupplierSet::iterator end() { return m_aMinimumAndMaximumSupplierList.end(); }
100 //.............................................................................
101 } //namespace chart
102 //.............................................................................
103 #endif