KDChartRulerAttributes.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Copyright (C) 2001-2010 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 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 KDCHARTRULERATTRIBUTES_H
00024 #define KDCHARTRULERATTRIBUTES_H
00025 
00026 #include <QMetaType>
00027 #include "KDChartGlobal.h"
00028 #include "KDChartEnums.h"
00029 
00030 class QPen;
00031 
00032 namespace KDChart {
00033 
00037 class KDCHART_EXPORT RulerAttributes
00038 {
00039 public:
00040         RulerAttributes();
00041         RulerAttributes( const RulerAttributes& );
00042         RulerAttributes &operator= ( const RulerAttributes& );
00043 
00044     ~RulerAttributes();
00045     
00049     void setTickMarkPen( const QPen& pen );
00050     QPen tickMarkPen() const;
00051 
00055     void setMajorTickMarkPen( const QPen& pen );
00056     bool majorTickMarkPenIsSet() const;
00057     QPen majorTickMarkPen() const;
00058 
00062     void setMinorTickMarkPen( const QPen& pen );
00063     bool minorTickMarkPenIsSet() const;
00064     QPen minorTickMarkPen() const;
00065 
00072     void setTickMarkPen( qreal value, const QPen& pen );
00073     QPen tickMarkPen( qreal value ) const;
00074     typedef QMap<qreal, QPen> TickMarkerPensMap;
00075     TickMarkerPensMap tickMarkPens() const;
00076     
00077     bool hasTickMarkPenAt( qreal value) const;
00078 
00082     void setTickMarkColor( const QColor& color );
00083     QColor tickMarkColor() const;
00084 
00088     void setShowMinorTickMarks( bool show );
00089     bool showMinorTickMarks() const;
00090 
00094     void setShowMajorTickMarks( bool show );
00095     bool showMajorTickMarks() const;
00096     
00102     void setLabelMargin(int margin);
00103     int labelMargin() const;
00104 
00105     bool operator==( const RulerAttributes& ) const;
00106     inline bool operator!=( const RulerAttributes& other ) const { return !operator==(other); }
00107 
00108 private:
00109     KDCHART_DECLARE_PRIVATE_BASE_VALUE( RulerAttributes )
00110 }; // End of class RulerAttributes
00111 
00112 }
00113 
00114 #if !defined(QT_NO_DEBUG_STREAM)
00115 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::RulerAttributes& );
00116 #endif /* QT_NO_DEBUG_STREAM */
00117 
00118 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::RulerAttributes )
00119 Q_DECLARE_METATYPE( KDChart::RulerAttributes )
00120 Q_DECLARE_TYPEINFO( KDChart::RulerAttributes, Q_MOVABLE_TYPE );
00121 
00122 
00123 #endif // KDCHARTRULERATTRIBUTES_H