KDChartTextAttributes.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 KDCHARTTEXTATTRIBUTES_H
00024 #define KDCHARTTEXTATTRIBUTES_H
00025 
00026 #include <QDebug>
00027 #include <QMetaType>
00028 #include "KDChartGlobal.h"
00029 #include "KDChartMeasure.h"
00030 
00031 class QPen;
00032 class QFont;
00033 
00034 namespace KDChart {
00035 
00043 class KDCHART_EXPORT TextAttributes
00044 {
00045 public:
00046   TextAttributes();
00047   TextAttributes( const TextAttributes& );
00048   TextAttributes &operator= ( const TextAttributes& );
00049   bool operator==( const TextAttributes& ) const;
00050   inline bool operator!=( const TextAttributes& other ) const
00051   { return !operator==(other); }
00052 
00053   ~TextAttributes();
00054 
00059   void setVisible( bool visible );
00060 
00064   bool isVisible() const;
00065 
00076   void setFont( const QFont& font );
00077 
00081   QFont font() const;
00082 
00088   void setFontSize( const Measure & measure );
00089 
00093   Measure fontSize() const;
00094 
00100   void setMinimalFontSize( const Measure & measure );
00101 
00105   Measure minimalFontSize() const;
00106 
00114 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
00115   const qreal calculatedFontSize(
00116 #else
00117   qreal calculatedFontSize(
00118 #endif
00119         const QObject*                   autoReferenceArea,
00120         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
00121 
00129   const QFont calculatedFont(
00130         const QObject*                   autoReferenceArea,
00131         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
00132 
00136   bool hasAbsoluteFontSize() const;
00137 
00143   void setAutoRotate( bool autoRotate );
00144 
00149   bool autoRotate() const;
00150 
00156   void setAutoShrink( bool autoShrink );
00157 
00162   bool autoShrink() const;
00163 
00175   void setRotation( int rotation );
00176 
00180   int rotation() const;
00181 
00186   void setPen( const QPen& pen );
00187 
00191   QPen pen() const;
00192 
00193   // FIXME KDChartEnums::TextLayoutPolicy?
00194 
00195 private:
00196   KDCHART_DECLARE_PRIVATE_BASE_VALUE( TextAttributes )
00197 
00198 }; // End of class TextAttributes
00199 
00200 }
00201 
00202 #if !defined(QT_NO_DEBUG_STREAM)
00203 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::TextAttributes& );
00204 #endif /* QT_NO_DEBUG_STREAM */
00205 
00206 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::TextAttributes )
00207 Q_DECLARE_METATYPE( KDChart::TextAttributes )
00208 Q_DECLARE_TYPEINFO( KDChart::TextAttributes, Q_MOVABLE_TYPE );
00209 
00210 #endif // KDCHARTTEXTATTRIBUTES_H