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