KD Chart 2 [rev.2.4]
|
00001 /**************************************************************************** 00002 ** Copyright (C) 2001-2012 Klaralvdalens Datakonsult AB. All rights reserved. 00003 ** 00004 ** This file is part of the KD Chart library. 00005 ** 00006 ** Licensees holding valid commercial KD Chart licenses may use this file in 00007 ** accordance with the KD Chart Commercial License Agreement provided with 00008 ** the Software. 00009 ** 00010 ** 00011 ** This file may be distributed and/or modified under the terms of the 00012 ** GNU General Public License version 2 and version 3 as published by the 00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included. 00014 ** 00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 ** 00018 ** Contact info@kdab.com if any conditions of this licensing are not 00019 ** clear to you. 00020 ** 00021 **********************************************************************/ 00022 00023 #ifndef KDCHARTDATAVALUEATTRIBUTES_H 00024 #define KDCHARTDATAVALUEATTRIBUTES_H 00025 00026 #include <Qt> 00027 #include <QMetaType> 00028 #include "KDChartGlobal.h" 00029 #include "KDChartEnums.h" 00030 #include "KDChartRelativePosition.h" 00031 00039 namespace KDChart { 00040 00041 class TextAttributes; 00042 class BackgroundAttributes; 00043 class FrameAttributes; 00044 class MarkerAttributes; 00045 00055 class KDCHART_EXPORT DataValueAttributes 00056 { 00057 public: 00058 DataValueAttributes(); 00059 DataValueAttributes( const DataValueAttributes& ); 00060 DataValueAttributes &operator= ( const DataValueAttributes& ); 00061 bool operator==( const DataValueAttributes& ) const; 00062 inline bool operator!=( const DataValueAttributes& other ) const { return !operator==(other); } 00063 00064 ~DataValueAttributes(); 00065 00066 static const DataValueAttributes& defaultAttributes(); 00067 static const QVariant& defaultAttributesAsVariant(); 00068 00072 void setVisible( bool visible ); 00073 00077 bool isVisible() const; 00078 00084 void setTextAttributes( const TextAttributes &a ); 00085 00089 TextAttributes textAttributes() const; 00090 00096 void setFrameAttributes( const FrameAttributes &a ); 00097 00103 FrameAttributes frameAttributes() const; 00104 00110 void setBackgroundAttributes( const BackgroundAttributes &a ); 00111 00117 BackgroundAttributes backgroundAttributes() const; 00118 00125 void setMarkerAttributes( const MarkerAttributes &a ); 00126 00132 MarkerAttributes markerAttributes() const; 00133 00143 void setUsePercentage( bool enable ); 00144 00149 bool usePercentage() const; 00150 00156 void setDecimalDigits( int digits ); 00157 00161 int decimalDigits() const; 00162 00167 void setPrefix( const QString prefix ); 00168 00173 QString prefix() const; 00174 00179 void setSuffix( const QString suffix ); 00180 00185 QString suffix() const; 00186 00192 void setDataLabel( const QString label ); 00193 00198 QString dataLabel() const; 00199 00203 bool showRepetitiveDataLabels() const; 00204 00210 void setShowRepetitiveDataLabels( bool showRepetitiveDataLabels ); 00211 00215 bool showOverlappingDataLabels() const; 00216 00222 void setShowOverlappingDataLabels( bool showOverlappingDataLabels ); 00223 00231 void setPowerOfTenDivisor( int powerOfTenDivisor ); 00232 int powerOfTenDivisor() const; 00244 void setShowInfinite( bool infinite ); 00245 bool showInfinite() const; 00259 void setNegativePosition( const RelativePosition& relPosition ); 00260 00265 const RelativePosition negativePosition() const; 00266 00276 void setPositivePosition( const RelativePosition& relPosition ); 00277 00282 const RelativePosition positivePosition() const; 00283 00284 const RelativePosition position( bool positive ) const 00285 { 00286 return positive ? positivePosition() : negativePosition(); 00287 } 00288 00289 private: 00290 KDCHART_DECLARE_PRIVATE_BASE_VALUE( DataValueAttributes ) 00291 00292 }; // End of class DataValueAttributes 00293 00294 } 00295 00296 #if !defined(QT_NO_DEBUG_STREAM) 00297 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::DataValueAttributes& ); 00298 #endif /* QT_NO_DEBUG_STREAM */ 00299 00300 Q_DECLARE_METATYPE( KDChart::DataValueAttributes ) 00301 Q_DECLARE_TYPEINFO( KDChart::DataValueAttributes, Q_MOVABLE_TYPE ); 00302 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::DataValueAttributes ) 00303 00304 #endif // KDCHARTDATAVALUEATTRIBUTES_H