kdgantt
kdganttabstractgrid.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KDGANTTABSTRACTGRID_H
00024 #define KDGANTTABSTRACTGRID_H
00025
00026 #include "kdganttglobal.h"
00027 #include "kdganttconstraint.h"
00028
00029 class QPainter;
00030 class QRectF;
00031 class QAbstractItemModel;
00032 class QModelIndex;
00033
00034 namespace KDGantt {
00035 class AbstractRowController;
00036 class Span;
00037
00038 class KDGANTT_EXPORT AbstractGrid : public QObject {
00039 Q_OBJECT
00040 KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( AbstractGrid )
00041 friend class GraphicsScene;
00042 public:
00043 AbstractGrid(QObject* parent = 0);
00044 virtual ~AbstractGrid();
00045
00046 QAbstractItemModel* model() const;
00047 QModelIndex rootIndex() const;
00048
00049 virtual Span mapToChart( const QModelIndex& idx ) const = 0;
00050 virtual bool mapFromChart( const Span& span, const QModelIndex& idx,
00051 const QList<Constraint>& constraints=QList<Constraint>() ) const = 0;
00052 bool isSatisfiedConstraint( const Constraint& c ) const;
00053
00054 virtual void paintGrid( QPainter* painter, const QRectF& sceneRect, const QRectF& exposedRect,
00055 AbstractRowController* rowController = 0, QWidget* widget=0 ) = 0;
00056 virtual void paintHeader( QPainter* painter, const QRectF& headerRect, const QRectF& exposedRect,
00057 qreal offset, QWidget* widget=0 ) = 0;
00058
00059 virtual void render( QPainter* , const QRectF & , const QRectF& , const QRectF& , QWidget* , Qt::AspectRatioMode = Qt::KeepAspectRatio ) {}
00060
00061 public Q_SLOTS:
00062 virtual void setModel( QAbstractItemModel* model );
00063 virtual void setRootIndex( const QModelIndex& idx );
00064 Q_SIGNALS:
00065 void gridChanged();
00066 };
00067 }
00068
00069 #endif
00070