KD Chart 2: KDChartTextAttributes.h Source File

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# 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-2006 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
    00077   void setFont( const QFont& font );
    00078
    00082   QFont font() const;
    00083
    00089   void setFontSize( const Measure & measure );
    00090
    00094   Measure fontSize() const;
    00095
    00101   void setMinimalFontSize( const Measure & measure );
    00102
    00106   Measure minimalFontSize() const;
    00107
    00115   const qreal calculatedFontSize(
    00116         const QObject*                   autoReferenceArea,
    00117         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
    00118
    00126   const QFont calculatedFont(
    00127         const QObject*                   autoReferenceArea,
    00128         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
    00129
    00133   bool hasAbsoluteFontSize() const;
    00134
    00140   void setAutoRotate( bool autoRotate );
    00141
    00146   bool autoRotate() const;
    00147
    00153   void setAutoShrink( bool autoShrink );
    00154
    00159   bool autoShrink() const;
    00160
    00172   void setRotation( int rotation );
    00173
    00177   int rotation() const;
    00178
    00183   void setPen( const QPen& pen );
    00184
    00188   QPen pen() const;
    00189
    00190   // FIXME KDChartEnums::TextLayoutPolicy?
    00191
    00192 private:
    00193   KDCHART_DECLARE_PRIVATE_BASE_VALUE( TextAttributes )
    00194
    00195 }; // End of class TextAttributes
    00196
    00197 }
    00198
    00199 #if !defined(QT_NO_DEBUG_STREAM)
    00200 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::TextAttributes& );
    00201 #endif /* QT_NO_DEBUG_STREAM */
    00202
    00203 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::TextAttributes )
    00204 Q_DECLARE_METATYPE( KDChart::TextAttributes )
    00205 Q_DECLARE_TYPEINFO( KDChart::TextAttributes, Q_MOVABLE_TYPE );
    00206
    00207 #endif // KDCHARTTEXTATTRIBUTES_H