mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:23:53 +00:00
rewrote subview factory system
This commit is contained in:
parent
0ed378dfb2
commit
2db930a5cf
13 changed files with 239 additions and 111 deletions
|
@ -10,9 +10,10 @@ set (OPENCS_SRC
|
||||||
model/tools/tools.cpp model/tools/operation.cpp model/tools/stage.cpp model/tools/verifier.cpp
|
model/tools/tools.cpp model/tools/operation.cpp model/tools/stage.cpp model/tools/verifier.cpp
|
||||||
model/tools/mandatoryid.cpp
|
model/tools/mandatoryid.cpp
|
||||||
|
|
||||||
view/doc/viewmanager.cpp view/doc/view.cpp view/doc/operations.cpp view/doc/operation.cpp
|
view/doc/viewmanager.cpp view/doc/view.cpp view/doc/operations.cpp view/doc/operation.cpp view/doc/subviewfactory.cpp
|
||||||
|
view/doc/subview.cpp
|
||||||
|
|
||||||
view/world/subview.cpp view/world/table.cpp view/world/tablesubview.cpp
|
view/world/table.cpp view/world/tablesubview.cpp view/world/subviews.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set (OPENCS_HDR
|
set (OPENCS_HDR
|
||||||
|
@ -27,9 +28,10 @@ set (OPENCS_HDR
|
||||||
model/tools/tools.hpp model/tools/operation.hpp model/tools/stage.hpp model/tools/verifier.hpp
|
model/tools/tools.hpp model/tools/operation.hpp model/tools/stage.hpp model/tools/verifier.hpp
|
||||||
model/tools/mandatoryid.hpp
|
model/tools/mandatoryid.hpp
|
||||||
|
|
||||||
view/doc/viewmanager.hpp view/doc/view.hpp view/doc/operations.hpp view/doc/operation.hpp
|
view/doc/viewmanager.hpp view/doc/view.hpp view/doc/operations.hpp view/doc/operation.hpp view/doc/subviewfactory.hpp
|
||||||
|
view/doc/subview.hpp view/doc/subviewfactoryimp.hpp
|
||||||
|
|
||||||
view/world/subview.hpp view/world/table.hpp view/world/tablesubview.hpp
|
view/world/table.hpp view/world/tablesubview.hpp view/world/subviews.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set (OPENCS_US
|
set (OPENCS_US
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
#include "subview.hpp"
|
#include "subview.hpp"
|
||||||
|
|
||||||
CSVWorld::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id)
|
CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id)
|
||||||
{
|
{
|
||||||
/// \todo add a button to the title bar that clones this sub view
|
/// \todo add a button to the title bar that clones this sub view
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ CSVWorld::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id)
|
||||||
setMinimumHeight (60);
|
setMinimumHeight (60);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSMWorld::UniversalId CSVWorld::SubView::getUniversalId() const
|
CSMWorld::UniversalId CSVDoc::SubView::getUniversalId() const
|
||||||
{
|
{
|
||||||
return mUniversalId;
|
return mUniversalId;
|
||||||
}
|
}
|
41
apps/opencs/view/doc/subview.hpp
Normal file
41
apps/opencs/view/doc/subview.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#ifndef CSV_DOC_SUBVIEW_H
|
||||||
|
#define CSV_DOC_SUBVIEW_H
|
||||||
|
|
||||||
|
#include "../../model/doc/document.hpp"
|
||||||
|
|
||||||
|
#include "../../model/world/universalid.hpp"
|
||||||
|
|
||||||
|
#include "subviewfactory.hpp"
|
||||||
|
|
||||||
|
#include <QDockWidget>
|
||||||
|
|
||||||
|
class QUndoStack;
|
||||||
|
|
||||||
|
namespace CSMWorld
|
||||||
|
{
|
||||||
|
class Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CSVDoc
|
||||||
|
{
|
||||||
|
class SubView : public QDockWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
CSMWorld::UniversalId mUniversalId;
|
||||||
|
|
||||||
|
// not implemented
|
||||||
|
SubView (const SubView&);
|
||||||
|
SubView& operator= (SubView&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
SubView (const CSMWorld::UniversalId& id);
|
||||||
|
|
||||||
|
CSMWorld::UniversalId getUniversalId() const;
|
||||||
|
|
||||||
|
virtual void setEditLock (bool locked) = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
38
apps/opencs/view/doc/subviewfactory.cpp
Normal file
38
apps/opencs/view/doc/subviewfactory.cpp
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
#include "subviewfactory.hpp"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
CSVDoc::SubViewFactoryBase::SubViewFactoryBase() {}
|
||||||
|
|
||||||
|
CSVDoc::SubViewFactoryBase::~SubViewFactoryBase() {}
|
||||||
|
|
||||||
|
|
||||||
|
CSVDoc::SubViewFactoryManager::SubViewFactoryManager() {}
|
||||||
|
|
||||||
|
CSVDoc::SubViewFactoryManager::~SubViewFactoryManager()
|
||||||
|
{
|
||||||
|
for (std::map<CSMWorld::UniversalId::Type, SubViewFactoryBase *>::iterator iter (mSubViewFactories.begin());
|
||||||
|
iter!=mSubViewFactories.end(); ++iter)
|
||||||
|
delete iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVDoc::SubViewFactoryManager::add (const CSMWorld::UniversalId::Type& id, SubViewFactoryBase *factory)
|
||||||
|
{
|
||||||
|
assert (mSubViewFactories.find (id)==mSubViewFactories.end());
|
||||||
|
|
||||||
|
mSubViewFactories.insert (std::make_pair (id, factory));
|
||||||
|
}
|
||||||
|
|
||||||
|
CSVDoc::SubView *CSVDoc::SubViewFactoryManager::makeSubView (const CSMWorld::UniversalId& id,
|
||||||
|
CSMDoc::Document& document)
|
||||||
|
{
|
||||||
|
std::map<CSMWorld::UniversalId::Type, SubViewFactoryBase *>::iterator iter = mSubViewFactories.find (id.getType());
|
||||||
|
|
||||||
|
if (iter==mSubViewFactories.end())
|
||||||
|
throw std::runtime_error ("Failed to create a sub view for: " + id.toString());
|
||||||
|
|
||||||
|
return iter->second->makeSubView (id, document);
|
||||||
|
}
|
55
apps/opencs/view/doc/subviewfactory.hpp
Normal file
55
apps/opencs/view/doc/subviewfactory.hpp
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
#ifndef CSV_DOC_SUBVIEWFACTORY_H
|
||||||
|
#define CSV_DOC_SUBVIEWFACTORY_H
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
#include "../../model/world/universalid.hpp"
|
||||||
|
|
||||||
|
namespace CSMDoc
|
||||||
|
{
|
||||||
|
class Document;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CSVDoc
|
||||||
|
{
|
||||||
|
class SubView;
|
||||||
|
|
||||||
|
class SubViewFactoryBase
|
||||||
|
{
|
||||||
|
// not implemented
|
||||||
|
SubViewFactoryBase (const SubViewFactoryBase&);
|
||||||
|
SubViewFactoryBase& operator= (const SubViewFactoryBase&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
SubViewFactoryBase();
|
||||||
|
|
||||||
|
virtual ~SubViewFactoryBase();
|
||||||
|
|
||||||
|
virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) = 0;
|
||||||
|
///< The ownership of the returned sub view is not transferred.
|
||||||
|
};
|
||||||
|
|
||||||
|
class SubViewFactoryManager
|
||||||
|
{
|
||||||
|
std::map<CSMWorld::UniversalId::Type, SubViewFactoryBase *> mSubViewFactories;
|
||||||
|
|
||||||
|
// not implemented
|
||||||
|
SubViewFactoryManager (const SubViewFactoryManager&);
|
||||||
|
SubViewFactoryManager& operator= (const SubViewFactoryManager&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
SubViewFactoryManager();
|
||||||
|
|
||||||
|
~SubViewFactoryManager();
|
||||||
|
|
||||||
|
void add (const CSMWorld::UniversalId::Type& id, SubViewFactoryBase *factory);
|
||||||
|
///< The ownership of \a factory is transferred to this.
|
||||||
|
|
||||||
|
SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
||||||
|
///< The ownership of the returned sub view is not transferred.
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
50
apps/opencs/view/doc/subviewfactoryimp.hpp
Normal file
50
apps/opencs/view/doc/subviewfactoryimp.hpp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
#ifndef CSV_DOC_SUBVIEWFACTORYIMP_H
|
||||||
|
#define CSV_DOC_SUBVIEWFACTORYIMP_H
|
||||||
|
|
||||||
|
#include "../../model/doc/document.hpp"
|
||||||
|
|
||||||
|
#include "subviewfactory.hpp"
|
||||||
|
|
||||||
|
namespace CSVDoc
|
||||||
|
{
|
||||||
|
template<class SubViewT>
|
||||||
|
class SubViewFactory : public SubViewFactoryBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class SubViewT>
|
||||||
|
CSVDoc::SubView *SubViewFactory<SubViewT>::makeSubView (const CSMWorld::UniversalId& id,
|
||||||
|
CSMDoc::Document& document)
|
||||||
|
{
|
||||||
|
return new SubViewT (id, document);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class SubViewT>
|
||||||
|
class SubViewFactoryWithCreateFlag : public SubViewFactoryBase
|
||||||
|
{
|
||||||
|
bool mCreateAndDelete;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
SubViewFactoryWithCreateFlag (bool createAndDelete);
|
||||||
|
|
||||||
|
virtual CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class SubViewT>
|
||||||
|
SubViewFactoryWithCreateFlag<SubViewT>::SubViewFactoryWithCreateFlag (bool createAndDelete)
|
||||||
|
: mCreateAndDelete (createAndDelete)
|
||||||
|
{}
|
||||||
|
|
||||||
|
template<class SubViewT>
|
||||||
|
CSVDoc::SubView *SubViewFactoryWithCreateFlag<SubViewT>::makeSubView (const CSMWorld::UniversalId& id,
|
||||||
|
CSMDoc::Document& document)
|
||||||
|
{
|
||||||
|
return new SubViewT (id, document, mCreateAndDelete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -10,10 +10,11 @@
|
||||||
|
|
||||||
#include "../../model/doc/document.hpp"
|
#include "../../model/doc/document.hpp"
|
||||||
|
|
||||||
#include "../world/tablesubview.hpp"
|
#include "../world/subviews.hpp"
|
||||||
|
|
||||||
#include "viewmanager.hpp"
|
#include "viewmanager.hpp"
|
||||||
#include "operations.hpp"
|
#include "operations.hpp"
|
||||||
|
#include "subview.hpp"
|
||||||
|
|
||||||
void CSVDoc::View::closeEvent (QCloseEvent *event)
|
void CSVDoc::View::closeEvent (QCloseEvent *event)
|
||||||
{
|
{
|
||||||
|
@ -120,15 +121,11 @@ CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int to
|
||||||
|
|
||||||
setupUi();
|
setupUi();
|
||||||
|
|
||||||
mSubViewFactories.insert (std::make_pair (CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Globals),
|
CSVWorld::addSubViewFactories (mSubViewFactory);
|
||||||
new CSVWorld::SubViewFactoryWithCreateFlag<CSVWorld::TableSubView> (true)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CSVDoc::View::~View()
|
CSVDoc::View::~View()
|
||||||
{
|
{
|
||||||
for (std::map<CSMWorld::UniversalId, CSVWorld::SubViewFactoryBase *>::iterator iter (mSubViewFactories.begin());
|
|
||||||
iter!=mSubViewFactories.end(); ++iter)
|
|
||||||
delete iter->second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const CSMDoc::Document *CSVDoc::View::getDocument() const
|
const CSMDoc::Document *CSVDoc::View::getDocument() const
|
||||||
|
@ -165,9 +162,9 @@ void CSVDoc::View::updateDocumentState()
|
||||||
if (!(state & operations[i]))
|
if (!(state & operations[i]))
|
||||||
mOperations->quitOperation (operations[i]);
|
mOperations->quitOperation (operations[i]);
|
||||||
|
|
||||||
QList<CSVWorld::SubView *> subViews = findChildren<CSVWorld::SubView *>();
|
QList<CSVDoc::SubView *> subViews = findChildren<CSVDoc::SubView *>();
|
||||||
|
|
||||||
for (QList<CSVWorld::SubView *>::iterator iter (subViews.begin()); iter!=subViews.end(); ++iter)
|
for (QList<CSVDoc::SubView *>::iterator iter (subViews.begin()); iter!=subViews.end(); ++iter)
|
||||||
(*iter)->setEditLock (state & CSMDoc::State_Locked);
|
(*iter)->setEditLock (state & CSMDoc::State_Locked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,12 +183,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id)
|
||||||
|
|
||||||
/// \todo add an user setting to reuse sub views (on a per document basis or on a per top level view basis)
|
/// \todo add an user setting to reuse sub views (on a per document basis or on a per top level view basis)
|
||||||
|
|
||||||
std::map<CSMWorld::UniversalId, CSVWorld::SubViewFactoryBase *>::iterator iter = mSubViewFactories.find (id);
|
SubView *view = mSubViewFactory.makeSubView (id, *mDocument);
|
||||||
|
|
||||||
if (iter==mSubViewFactories.end())
|
|
||||||
throw std::logic_error ("can't create subview for " + id.toString());
|
|
||||||
|
|
||||||
CSVWorld::SubView *view = iter->second->makeSubView (id, *mDocument);
|
|
||||||
addDockWidget (Qt::TopDockWidgetArea, view);
|
addDockWidget (Qt::TopDockWidgetArea, view);
|
||||||
view->show();
|
view->show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
#include "subviewfactory.hpp"
|
||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
|
|
||||||
namespace CSMDoc
|
namespace CSMDoc
|
||||||
|
@ -18,11 +20,6 @@ namespace CSMWorld
|
||||||
class UniversalId;
|
class UniversalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CSVWorld
|
|
||||||
{
|
|
||||||
struct SubViewFactoryBase;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace CSVDoc
|
namespace CSVDoc
|
||||||
{
|
{
|
||||||
class ViewManager;
|
class ViewManager;
|
||||||
|
@ -42,7 +39,7 @@ namespace CSVDoc
|
||||||
QAction *mVerify;
|
QAction *mVerify;
|
||||||
std::vector<QAction *> mEditingActions;
|
std::vector<QAction *> mEditingActions;
|
||||||
Operations *mOperations;
|
Operations *mOperations;
|
||||||
std::map<CSMWorld::UniversalId, CSVWorld::SubViewFactoryBase *> mSubViewFactories;
|
SubViewFactoryManager mSubViewFactory;
|
||||||
|
|
||||||
// not implemented
|
// not implemented
|
||||||
View (const View&);
|
View (const View&);
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
#ifndef CSV_WORLD_SUBVIEW_H
|
|
||||||
#define CSV_WORLD_SUBVIEW_H
|
|
||||||
|
|
||||||
#include "../../model/doc/document.hpp"
|
|
||||||
|
|
||||||
#include "../../model/world/universalid.hpp"
|
|
||||||
|
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
class QUndoStack;
|
|
||||||
|
|
||||||
namespace CSMWorld
|
|
||||||
{
|
|
||||||
class Data;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace CSVWorld
|
|
||||||
{
|
|
||||||
class SubView : public QDockWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
CSMWorld::UniversalId mUniversalId;
|
|
||||||
|
|
||||||
// not implemented
|
|
||||||
SubView (const SubView&);
|
|
||||||
SubView& operator= (SubView&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
SubView (const CSMWorld::UniversalId& id);
|
|
||||||
|
|
||||||
CSMWorld::UniversalId getUniversalId() const;
|
|
||||||
|
|
||||||
virtual void setEditLock (bool locked) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SubViewFactoryBase
|
|
||||||
{
|
|
||||||
virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
|
||||||
= 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class SubViewT>
|
|
||||||
struct SubViewFactory : public SubViewFactoryBase
|
|
||||||
{
|
|
||||||
virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class SubViewT>
|
|
||||||
SubView *SubViewFactory<SubViewT>::makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
|
||||||
{
|
|
||||||
return new SubViewT (id, document.getData(), document.getUndoStack());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class SubViewT>
|
|
||||||
struct SubViewFactoryWithCreateFlag : public SubViewFactoryBase
|
|
||||||
{
|
|
||||||
bool mCreateAndDelete;
|
|
||||||
|
|
||||||
SubViewFactoryWithCreateFlag (bool createAndDelete);
|
|
||||||
|
|
||||||
virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class SubViewT>
|
|
||||||
SubViewFactoryWithCreateFlag<SubViewT>::SubViewFactoryWithCreateFlag (bool createAndDelete)
|
|
||||||
: mCreateAndDelete (createAndDelete)
|
|
||||||
{}
|
|
||||||
|
|
||||||
template<class SubViewT>
|
|
||||||
SubView *SubViewFactoryWithCreateFlag<SubViewT>::makeSubView (const CSMWorld::UniversalId& id,
|
|
||||||
CSMDoc::Document& document)
|
|
||||||
{
|
|
||||||
return new SubViewT (id, document.getData(), document.getUndoStack(), mCreateAndDelete);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
12
apps/opencs/view/world/subviews.cpp
Normal file
12
apps/opencs/view/world/subviews.cpp
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
#include "subviews.hpp"
|
||||||
|
|
||||||
|
#include "../doc/subviewfactoryimp.hpp"
|
||||||
|
|
||||||
|
#include "tablesubview.hpp"
|
||||||
|
|
||||||
|
void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager)
|
||||||
|
{
|
||||||
|
manager.add (CSMWorld::UniversalId::Type_Globals,
|
||||||
|
new CSVDoc::SubViewFactoryWithCreateFlag<TableSubView> (true));
|
||||||
|
}
|
14
apps/opencs/view/world/subviews.hpp
Normal file
14
apps/opencs/view/world/subviews.hpp
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef CSV_WORLD_SUBVIEWS_H
|
||||||
|
#define CSV_WORLD_SUBVIEWS_H
|
||||||
|
|
||||||
|
namespace CSVDoc
|
||||||
|
{
|
||||||
|
class SubViewFactoryManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CSVWorld
|
||||||
|
{
|
||||||
|
void addSubViewFactories (CSVDoc::SubViewFactoryManager& manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,13 +1,15 @@
|
||||||
|
|
||||||
#include "tablesubview.hpp"
|
#include "tablesubview.hpp"
|
||||||
|
|
||||||
|
#include "../../model/doc/document.hpp"
|
||||||
|
|
||||||
#include "table.hpp"
|
#include "table.hpp"
|
||||||
|
|
||||||
CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack,
|
CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document,
|
||||||
bool createAndDelete)
|
bool createAndDelete)
|
||||||
: SubView (id)
|
: SubView (id)
|
||||||
{
|
{
|
||||||
setWidget (mTable = new Table (id, data, undoStack, createAndDelete));
|
setWidget (mTable = new Table (id, document.getData(), document.getUndoStack(), createAndDelete));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::TableSubView::setEditLock (bool locked)
|
void CSVWorld::TableSubView::setEditLock (bool locked)
|
||||||
|
|
|
@ -1,22 +1,26 @@
|
||||||
#ifndef CSV_WORLD_TABLESUBVIEW_H
|
#ifndef CSV_WORLD_TABLESUBVIEW_H
|
||||||
#define CSV_WORLD_TABLESUBVIEW_H
|
#define CSV_WORLD_TABLESUBVIEW_H
|
||||||
|
|
||||||
#include "subview.hpp"
|
#include "../doc/subview.hpp"
|
||||||
|
|
||||||
class QUndoStack;
|
class QUndoStack;
|
||||||
|
|
||||||
|
namespace CSMDoc
|
||||||
|
{
|
||||||
|
class Document;
|
||||||
|
}
|
||||||
|
|
||||||
namespace CSVWorld
|
namespace CSVWorld
|
||||||
{
|
{
|
||||||
class Table;
|
class Table;
|
||||||
|
|
||||||
class TableSubView : public SubView
|
class TableSubView : public CSVDoc::SubView
|
||||||
{
|
{
|
||||||
Table *mTable;
|
Table *mTable;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TableSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack,
|
TableSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document, bool createAndDelete);
|
||||||
bool createAndDelete);
|
|
||||||
|
|
||||||
virtual void setEditLock (bool locked);
|
virtual void setEditLock (bool locked);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue