/* * Copyright 2008-2009 Ben Boeckel * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef SIGMODRTREE_SIGMODRTREE #define SIGMODRTREE_SIGMODRTREE // Sigmodr tree includes #include "Global.h" // KDE includes #include // Qt includes #include #include #include // Forward declarations class KMenu; namespace Sigmod { class Game; } namespace Sigmodr { namespace Widgets { class ObjectUI; } namespace Tree { class SIGMODRTREE_EXPORT SigmodrTree : public QTreeView { Q_OBJECT public: SigmodrTree(QWidget* parent = 0); QString description(const QModelIndex& index) const; QString typeOf(const QModelIndex& index) const; QStringList dropTypes(const QModelIndex& index) const; Widgets::ObjectUI* editorWidget(const QModelIndex& index); KMenu* contextMenu(const QModelIndex& index); const Sigmod::Game* currentGame() const; QDomDocument copy(const QModelIndex& index); void paste(const QModelIndex& index, const QDomDocument& data); QList openedGames() const; void addGame(Sigmod::Game* game, const KUrl& url = KUrl()); void deleteGame(const Sigmod::Game* game); void deleteAllGames(); bool isOpen(const KUrl& url) const; KUrl url(const Sigmod::Game* game) const; QStringList urls() const; void setUrl(const Sigmod::Game* game, const KUrl& url); bool dirty(const Sigmod::Game* game) const; bool dirty() const; public slots: void setDirty(const Sigmod::Game* game, const bool dirty); private slots: void setDirty(); private: typedef QPair UrlDirty; QMap m_games; }; } } #endif