File indexing completed on 2024-12-15 04:02:32
0001 /* 0002 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 0003 * 0004 * This file is part of the KD Chart library. 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KCHARTLEVEYJENNINGSGRIDATTRIBUTES_H 0010 #define KCHARTLEVEYJENNINGSGRIDATTRIBUTES_H 0011 0012 #include <QMetaType> 0013 #include "KChartGlobal.h" 0014 #include "KChartEnums.h" 0015 0016 QT_BEGIN_NAMESPACE 0017 class QPen; 0018 QT_END_NAMESPACE 0019 0020 namespace KChart { 0021 0022 /** 0023 * @brief A set of attributes controlling the appearance of grids 0024 */ 0025 class KCHART_EXPORT LeveyJenningsGridAttributes 0026 { 0027 public: 0028 LeveyJenningsGridAttributes(); 0029 LeveyJenningsGridAttributes( const LeveyJenningsGridAttributes& ); 0030 LeveyJenningsGridAttributes &operator= ( const LeveyJenningsGridAttributes& ); 0031 0032 ~LeveyJenningsGridAttributes(); 0033 0034 enum GridType 0035 { 0036 Expected, 0037 Calculated 0038 }; 0039 0040 enum Range 0041 { 0042 NormalRange, 0043 CriticalRange, 0044 OutOfRange 0045 }; 0046 0047 void setGridVisible( GridType type, bool visible ); 0048 bool isGridVisible( GridType type ) const; 0049 0050 void setGridPen( GridType type, const QPen& pen ); 0051 QPen gridPen( GridType type ) const; 0052 0053 void setRangeBrush( Range range, const QBrush& brush ); 0054 QBrush rangeBrush( Range range ) const; 0055 0056 bool operator==( const LeveyJenningsGridAttributes& ) const; 0057 inline bool operator!=( const LeveyJenningsGridAttributes& other ) const { return !operator==(other); } 0058 0059 private: 0060 KCHART_DECLARE_PRIVATE_BASE_VALUE( LeveyJenningsGridAttributes ) 0061 }; // End of class GridAttributes 0062 0063 } 0064 0065 KCHART_DECLARE_SWAP_SPECIALISATION( KChart::LeveyJenningsGridAttributes ) 0066 0067 QT_BEGIN_NAMESPACE 0068 Q_DECLARE_TYPEINFO( KChart::LeveyJenningsGridAttributes, Q_MOVABLE_TYPE ); 0069 QT_END_NAMESPACE 0070 0071 Q_DECLARE_METATYPE( KChart::LeveyJenningsGridAttributes ) 0072 0073 #endif // KCHARTLEVEYJENNINGSGRIDATTRIBUTES_H