KDChartTextAttributes.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002    KDChart - a multi-platform charting engine
00003    */
00004 
00005 /****************************************************************************
00006  ** Copyright (C) 2005-2007 Klarävdalens Datakonsult AB.  All rights reserved.
00007  **
00008  ** This file is part of the KD Chart library.
00009  **
00010  ** This file may be distributed and/or modified under the terms of the
00011  ** GNU General Public License version 2 as published by the Free Software
00012  ** Foundation and appearing in the file LICENSE.GPL included in the
00013  ** packaging of this file.
00014  **
00015  ** Licensees holding valid commercial KD Chart licenses may use this file in
00016  ** accordance with the KD Chart Commercial License Agreement provided with
00017  ** the Software.
00018  **
00019  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021  **
00022  ** See http://www.kdab.net/kdchart for
00023  **   information about KD Chart Commercial License Agreements.
00024  **
00025  ** Contact info@kdab.net if any conditions of this
00026  ** licensing are not clear to you.
00027  **
00028  **********************************************************************/
00029 
00030 #ifndef KDCHARTTEXTATTRIBUTES_H
00031 #define KDCHARTTEXTATTRIBUTES_H
00032 
00033 #include <QDebug>
00034 #include <QMetaType>
00035 #include "KDChartGlobal.h"
00036 #include "KDChartMeasure.h"
00037 
00038 class QPen;
00039 class QFont;
00040 
00041 namespace KDChart {
00042 
00050 class KDCHART_EXPORT TextAttributes
00051 {
00052 public:
00053   TextAttributes();
00054   TextAttributes( const TextAttributes& );
00055   TextAttributes &operator= ( const TextAttributes& );
00056   bool operator==( const TextAttributes& ) const;
00057   inline bool operator!=( const TextAttributes& other ) const
00058   { return !operator==(other); }
00059 
00060   ~TextAttributes();
00061 
00066   void setVisible( bool visible );
00067 
00071   bool isVisible() const;
00072 
00083   void setFont( const QFont& font );
00084 
00088   QFont font() const;
00089 
00095   void setFontSize( const Measure & measure );
00096 
00100   Measure fontSize() const;
00101 
00107   void setMinimalFontSize( const Measure & measure );
00108 
00112   Measure minimalFontSize() const;
00113 
00121 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
00122   const qreal calculatedFontSize(
00123 #else
00124   qreal calculatedFontSize(
00125 #endif
00126         const QObject*                   autoReferenceArea,
00127         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
00128 
00136   const QFont calculatedFont(
00137         const QObject*                   autoReferenceArea,
00138         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
00139 
00143   bool hasAbsoluteFontSize() const;
00144 
00150   void setAutoRotate( bool autoRotate );
00151 
00156   bool autoRotate() const;
00157 
00163   void setAutoShrink( bool autoShrink );
00164 
00169   bool autoShrink() const;
00170 
00182   void setRotation( int rotation );
00183 
00187   int rotation() const;
00188 
00193   void setPen( const QPen& pen );
00194 
00198   QPen pen() const;
00199 
00200   // FIXME KDChartEnums::TextLayoutPolicy?
00201 
00202 private:
00203   KDCHART_DECLARE_PRIVATE_BASE_VALUE( TextAttributes )
00204 
00205 }; // End of class TextAttributes
00206 
00207 }
00208 
00209 #if !defined(QT_NO_DEBUG_STREAM)
00210 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::TextAttributes& );
00211 #endif /* QT_NO_DEBUG_STREAM */
00212 
00213 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::TextAttributes )
00214 Q_DECLARE_METATYPE( KDChart::TextAttributes )
00215 Q_DECLARE_TYPEINFO( KDChart::TextAttributes, Q_MOVABLE_TYPE );
00216 
00217 #endif // KDCHARTTEXTATTRIBUTES_H

Generated on Thu Mar 4 23:19:12 2010 for KD Chart 2 by  doxygen 1.5.4