# KDChartDataValueAttributes.h

Go to the documentation of this file.

    00001
    00002 /****************************************************************************
    00003  ** Copyright (C) 2005-2006 Klarälvdalens Datakonsult AB.  All rights reserved.
    00004  **
    00005  ** This file is part of the KD Chart library.
    00006  **
    00007  ** This file may be distributed and/or modified under the terms of the
    00008  ** GNU General Public License version 2 as published by the Free Software
    00009  ** Foundation and appearing in the file LICENSE.GPL included in the
    00010  ** packaging of this file.
    00011  **
    00012  ** Licensees holding valid commercial KD Chart licenses may use this file in
    00013  ** accordance with the KD Chart Commercial License Agreement provided with
    00014  ** the Software.
    00015  **
    00016  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    00017  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    00018  **
    00019  ** See http://www.kdab.net/kdchart for
    00020  **   information about KD Chart Commercial License Agreements.
    00021  **
    00022  ** Contact info@kdab.net if any conditions of this
    00023  ** licensing are not clear to you.
    00024  **
    00025  **********************************************************************/
    00026
    00027 #ifndef KDCHARTDATAVALUEATTRIBUTES_H
    00028 #define KDCHARTDATAVALUEATTRIBUTES_H
    00029
    00030 #include <Qt>
    00031 #include <QMetaType>
    00032 #include "KDChartGlobal.h"
    00033 #include "KDChartEnums.h"
    00034 #include "KDChartRelativePosition.h"
    00035
    00043 namespace KDChart {
    00044
    00045   class TextAttributes;
    00046   class BackgroundAttributes;
    00047   class FrameAttributes;
    00048   class MarkerAttributes;
    00049
    00059 class KDCHART_EXPORT DataValueAttributes
    00060 {
    00061 public:
    00062   DataValueAttributes();
    00063   DataValueAttributes( const DataValueAttributes& );
    00064   DataValueAttributes &operator= ( const DataValueAttributes& );
    00065   bool operator==( const DataValueAttributes& ) const;
    00066   inline bool operator!=( const DataValueAttributes& other ) const { return !operator==(other); }
    00067
    00068   ~DataValueAttributes();
    00069
    00070   static const DataValueAttributes& defaultAttributes();
    00071   static const QVariant& defaultAttributesAsVariant();
    00072
    00076   void setVisible( bool visible );
    00077
    00081   bool isVisible() const;
    00082
    00088   void setTextAttributes( const TextAttributes &a );
    00089
    00093   TextAttributes textAttributes() const;
    00094
    00100   void setFrameAttributes( const FrameAttributes &a );
    00101
    00107   FrameAttributes frameAttributes() const;
    00108
    00114   void setBackgroundAttributes( const BackgroundAttributes &a );
    00115
    00121   BackgroundAttributes backgroundAttributes() const;
    00122
    00129   void setMarkerAttributes( const MarkerAttributes &a );
    00130
    00136   MarkerAttributes markerAttributes() const;
    00137
    00143   void setDecimalDigits( int digits );
    00144
    00148   int decimalDigits() const;
    00149
    00154   void setPrefix( const QString prefix );
    00155
    00160   QString prefix() const;
    00161
    00166   void setSuffix( const QString suffix );
    00167
    00172   QString suffix() const;
    00173
    00178   void setDataLabel( const QString label );
    00179
    00184   QString dataLabel() const;
    00185
    00191   bool showRepetitiveDataLabels() const;
    00192
    00198   void setShowRepetitiveDataLabels( bool showRepetitiveDataLabels );
    00199
    00206   void setPowerOfTenDivisor( int powerOfTenDivisor );
    00207   int powerOfTenDivisor() const;
    00219   void setShowInfinite( bool infinite );
    00220   bool showInfinite() const;
    00234   void setNegativePosition( const RelativePosition& relPosition );
    00235
    00240   const RelativePosition negativePosition() const;
    00241
    00251   void setPositivePosition( const RelativePosition& relPosition );
    00252
    00257   const RelativePosition positivePosition() const;
    00258
    00259   const RelativePosition position( bool positive ) const
    00260   {
    00261     return positive ? positivePosition() : negativePosition();
    00262   }
    00263
    00264 private:
    00265   KDCHART_DECLARE_PRIVATE_BASE_VALUE( DataValueAttributes )
    00266
    00267 }; // End of class DataValueAttributes
    00268
    00269 }
    00270
    00271 #if !defined(QT_NO_DEBUG_STREAM)
    00272 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::DataValueAttributes& );
    00273 #endif /* QT_NO_DEBUG_STREAM */
    00274
    00275 Q_DECLARE_METATYPE( KDChart::DataValueAttributes )
    00276 Q_DECLARE_TYPEINFO( KDChart::DataValueAttributes, Q_MOVABLE_TYPE );
    00277 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::DataValueAttributes )
    00278
    00279 #endif // KDCHARTDATAVALUEATTRIBUTES_H