KD Chart 2
[rev.2.5]
|
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 KDCHARTABSTRACTAREABASE_H 00024 #define KDCHARTABSTRACTAREABASE_H 00025 00026 #include <QPointF> 00027 #include <QSizeF> 00028 #include <QRectF> 00029 00030 #include "KDChartGlobal.h" 00031 #include "KDChartLayoutItems.h" 00032 #include "KDChartRelativePosition.h" 00033 #include "KDChartAbstractAreaBase.h" 00034 00035 00036 QT_BEGIN_NAMESPACE 00037 class QPainter; 00038 class QString; 00039 QT_END_NAMESPACE 00040 00041 namespace KDChart { 00042 class TextAttributes; 00043 class BackgroundAttributes; 00044 class FrameAttributes; 00045 class PaintContext; 00046 00047 00065 class KDCHART_EXPORT AbstractAreaBase 00066 { 00067 Q_DISABLE_COPY( AbstractAreaBase ) 00068 KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC( AbstractAreaBase ) 00069 00070 protected: 00071 AbstractAreaBase(); 00072 virtual ~AbstractAreaBase() ; 00073 00074 public: 00075 // virtual AbstractAreaBase * clone() const = 0; 00076 00080 bool compare( const AbstractAreaBase* other ) const; 00081 00082 void alignToReferencePoint( const RelativePosition& position ); 00083 00084 void setFrameAttributes( const FrameAttributes &a ); 00085 FrameAttributes frameAttributes() const; 00086 00087 void setBackgroundAttributes( const BackgroundAttributes &a ); 00088 BackgroundAttributes backgroundAttributes() const; 00089 00090 virtual void paintBackground( QPainter& painter, const QRect& rectangle ); 00091 virtual void paintFrame( QPainter& painter, const QRect& rectangle ); 00092 00093 static void paintBackgroundAttributes( QPainter& painter, const QRect& rectangle, 00094 const KDChart::BackgroundAttributes& attributes ); 00095 static void paintFrameAttributes( QPainter& painter, const QRect& rectangle, 00096 const KDChart::FrameAttributes& attributes ); 00097 00103 void getFrameLeadings(int& left, int& top, int& right, int& bottom ) const; 00104 00105 00106 protected: 00112 QRect innerRect() const; 00113 00119 virtual QRect areaGeometry() const = 0; 00120 00127 virtual void positionHasChanged(); 00128 00129 }; // End of class AbstractAreaBase 00130 00131 } 00132 #endif // KDCHARTABSTRACTAREABASE_H