2012-11-24 12:17:21 +00:00
|
|
|
#ifndef CSV_WORLD_SUBVIEW_H
|
|
|
|
#define CSV_WORLD_SUBVIEW_H
|
|
|
|
|
|
|
|
#include "../../model/world/universalid.hpp"
|
|
|
|
|
|
|
|
#include <QDockWidget>
|
|
|
|
|
2012-11-29 15:05:28 +00:00
|
|
|
class QUndoStack;
|
|
|
|
|
2012-11-26 11:29:22 +00:00
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class Data;
|
|
|
|
}
|
|
|
|
|
2012-11-24 12:17:21 +00:00
|
|
|
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;
|
2012-11-30 12:58:10 +00:00
|
|
|
|
|
|
|
virtual void setEditLock (bool locked) = 0;
|
2012-11-24 12:17:21 +00:00
|
|
|
};
|
2012-11-26 11:29:22 +00:00
|
|
|
|
|
|
|
struct SubViewFactoryBase
|
|
|
|
{
|
2012-11-29 15:05:28 +00:00
|
|
|
virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack)
|
|
|
|
= 0;
|
2012-11-26 11:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
template<class SubViewT>
|
|
|
|
struct SubViewFactory : public SubViewFactoryBase
|
|
|
|
{
|
2012-11-29 15:05:28 +00:00
|
|
|
virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack);
|
2012-11-26 11:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
template<class SubViewT>
|
2012-11-29 15:05:28 +00:00
|
|
|
SubView *SubViewFactory<SubViewT>::makeSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data,
|
|
|
|
QUndoStack& undoStack)
|
2012-11-26 11:29:22 +00:00
|
|
|
{
|
2012-11-29 15:05:28 +00:00
|
|
|
return new SubViewT (id, data, undoStack);
|
2012-11-26 11:29:22 +00:00
|
|
|
}
|
2012-11-24 12:17:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|