AnimationModel.qt.H
00001 #ifndef ANIMATIONMODEL_QT_H
00002 #define ANIMATIONMODEL_QT_H
00003
00004 #include <QtGui/QtGui>
00005 #include "Media/FrameRange.H"
00006
00007 class AnnotationObject;
00008 class AnnotationObjectVertex;
00009
00010 class AnimationModel : public QAbstractTableModel
00011 {
00012 Q_OBJECT
00013
00014 public:
00015 AnimationModel(AnnotationObject *parent);
00016
00017
00018 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00019
00020
00021 int rowCount(const QModelIndex &parent = QModelIndex()) const;
00022
00023
00024 int columnCount(const QModelIndex &parent = QModelIndex()) const;
00025
00026
00027 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
00028
00029
00030 bool setData(const QModelIndex &index, const QVariant &value, int role);
00031
00032
00033 Qt::ItemFlags flags(const QModelIndex &index) const;
00034
00035
00036 Qt::DropActions supportedDropActions() const;
00037
00038
00039 void setPosition(int frameNum, QPointF pos);
00040
00041
00042 bool dropMimeData(const QMimeData * data,
00043 Qt::DropAction action,
00044 int row, int col,
00045 const QModelIndex & parent);
00046
00047
00048 void beginInsertRow(int row);
00049
00050
00051 void endInsertRow();
00052
00053
00054 void beginRemoveRow(int row);
00055
00056
00057 void endRemoveRow();
00058
00059
00060 void beginRemoveRowsPub(const QModelIndex & i, int first, int last);
00061
00062 void setLastClick(const QModelIndex & index) { itsLastClick = index; }
00063
00064 public slots:
00065
00066
00067
00068 void animationChanged();
00069
00070 private:
00071 AnnotationObject * itsParent;
00072
00073 QList<AnnotationObjectVertex*> *itsVertices;
00074
00075 QPoint itsLastMousePress;
00076
00077 QModelIndex itsLastClick;
00078
00079 };
00080
00081 #endif //ANIMATIONMODEL_QT_H
00082