00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GLUON_CREATOR_PROJECTMODEL_H
00021 #define GLUON_CREATOR_PROJECTMODEL_H
00022
00023 #include <QtCore/QAbstractItemModel>
00024 #include "gluoncreator_macros.h"
00025
00026 namespace GluonEngine
00027 {
00028 class GameProject;
00029 class GameObject;
00030 }
00031
00032 namespace GluonCreator
00033 {
00034
00035 class GLUONCREATOR_EXPORT ProjectModel : public QAbstractItemModel
00036 {
00037 Q_OBJECT
00038 public:
00039 ProjectModel( QObject* parent = 0 );
00040 ~ProjectModel();
00041
00042 GluonEngine::GameProject* project();
00043
00044 virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
00045 virtual int columnCount( const QModelIndex& parent = QModelIndex() ) const;
00046 virtual int rowCount( const QModelIndex& parent = QModelIndex() ) const;
00047 virtual QModelIndex parent( const QModelIndex& child ) const;
00048 virtual QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const;
00049 virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
00050
00051 virtual Qt::DropActions supportedDropActions() const;
00052 virtual Qt::ItemFlags flags( const QModelIndex& index ) const;
00053 virtual QStringList mimeTypes() const;
00054 virtual bool dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent );
00055 virtual bool setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole );
00056 virtual bool removeRows( int row, int count, const QModelIndex& parent );
00057
00058 void addChild( QObject* newChild, QModelIndex& parent );
00059
00060 public Q_SLOTS:
00061 void setProject( GluonEngine::GameProject* project );
00062
00063 private:
00064 class ProjectModelPrivate;
00065 ProjectModelPrivate* const d;
00066
00067 };
00068
00069 }
00070
00071 #endif // GLUON_CREATOR_PROJECTMODEL_H