tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / view / inc / MinimumAndMaximumSupplier.hxx
blobcbb5e55ba74a6d7663f5fd82a354e15357875820
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 #pragma once
22 #include <sal/types.h>
23 #include <tools/date.hxx>
24 #include <tools/long.hxx>
25 #include <set>
27 namespace chart
30 class MinimumAndMaximumSupplier
32 public:
33 virtual double getMinimumX() = 0;
34 virtual double getMaximumX() = 0;
36 //problem y maybe not is always the second border to ask for
37 virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
38 virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) = 0;
40 //problem: z maybe not independent in future
41 virtual double getMinimumZ() = 0;
42 virtual double getMaximumZ() = 0;
44 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex ) = 0;
45 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex ) = 0;
46 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ) = 0;
47 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) = 0;
48 virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) = 0;
50 //return a constant out of css::chart::TimeUnit that allows to display the smallest distance between occurring dates
51 virtual tools::Long calculateTimeResolutionOnXAxis() = 0;
52 virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) = 0;
54 protected:
55 ~MinimumAndMaximumSupplier() {}
58 class MergedMinimumAndMaximumSupplier final : public MinimumAndMaximumSupplier
60 public:
61 MergedMinimumAndMaximumSupplier();
62 virtual ~MergedMinimumAndMaximumSupplier();
64 void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
65 bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
66 void clearMinimumAndMaximumSupplierList();
68 //--MinimumAndMaximumSupplier
69 virtual double getMinimumX() override;
70 virtual double getMaximumX() override;
71 virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
72 virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) override;
73 virtual double getMinimumZ() override;
74 virtual double getMaximumZ() override;
76 virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex ) override;
77 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex ) override;
78 virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ) override;
79 virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) override;
80 virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) override;
82 virtual tools::Long calculateTimeResolutionOnXAxis() override;
83 virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) override;
85 private:
86 typedef std::set< MinimumAndMaximumSupplier* > MinimumAndMaximumSupplierSet;
87 MinimumAndMaximumSupplierSet m_aMinimumAndMaximumSupplierList;
90 } //namespace chart
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */