KD Chart 2  [rev.2.5]
KDChartTextAttributes.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Copyright (C) 2001-2012 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.txt 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 QT_BEGIN_NAMESPACE
00032 class QPen;
00033 class QFont;
00034 class QTextDocument;
00035 QT_END_NAMESPACE
00036 
00037 namespace KDChart {
00038 
00046 class KDCHART_EXPORT TextAttributes
00047 {
00048 public:
00049   TextAttributes();
00050   TextAttributes( const TextAttributes& );
00051   TextAttributes &operator= ( const TextAttributes& );
00052   bool operator==( const TextAttributes& ) const;
00053   inline bool operator!=( const TextAttributes& other ) const
00054   { return !operator==(other); }
00055 
00056   ~TextAttributes();
00057 
00062   void setVisible( bool visible );
00063 
00067   bool isVisible() const;
00068 
00079   void setFont( const QFont& font );
00080 
00084   QFont font() const;
00085 
00091   void setFontSize( const Measure & measure );
00092 
00096   Measure fontSize() const;
00097 
00103   void setMinimalFontSize( const Measure & measure );
00104 
00108   Measure minimalFontSize() const;
00109 
00117 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
00118   const qreal calculatedFontSize(
00119 #else
00120   qreal calculatedFontSize(
00121 #endif
00122         const QObject*                   autoReferenceArea,
00123         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
00124 
00132   const QFont calculatedFont(
00133         const QObject*                   autoReferenceArea,
00134         KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
00135 
00139   bool hasAbsoluteFontSize() const;
00140 
00146   void setAutoRotate( bool autoRotate );
00147 
00152   bool autoRotate() const;
00153 
00159   void setAutoShrink( bool autoShrink );
00160 
00165   bool autoShrink() const;
00166 
00178   void setRotation( int rotation );
00179   void resetRotation();
00180   bool hasRotation() const;
00181 
00185   int rotation() const;
00186 
00191   void setPen( const QPen& pen );
00192 
00196   QPen pen() const;
00197 
00202   QTextDocument* textDocument() const;
00203 
00207   void setTextDocument(QTextDocument* layout);
00208 
00209   // FIXME KDChartEnums::TextLayoutPolicy?
00210 
00211 private:
00212   KDCHART_DECLARE_PRIVATE_BASE_VALUE( TextAttributes )
00213 
00214 }; // End of class TextAttributes
00215 
00216 }
00217 
00218 #if !defined(QT_NO_DEBUG_STREAM)
00219 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::TextAttributes& );
00220 #endif /* QT_NO_DEBUG_STREAM */
00221 
00222 KDCHART_DECLARE_SWAP_SPECIALISATION( KDChart::TextAttributes )
00223 
00224 QT_BEGIN_NAMESPACE
00225 Q_DECLARE_TYPEINFO( KDChart::TextAttributes, Q_MOVABLE_TYPE );
00226 QT_END_NAMESPACE
00227 Q_DECLARE_METATYPE( KDChart::TextAttributes )
00228 
00229 #endif // KDCHARTTEXTATTRIBUTES_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/