2014-06-06 10:43:21 +00:00
|
|
|
#ifndef CSM_WOLRD_COMMANDDISPATCHER_H
|
|
|
|
#define CSM_WOLRD_COMMANDDISPATCHER_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include "universalid.hpp"
|
|
|
|
|
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class CommandDispatcher : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
bool mLocked;
|
|
|
|
CSMDoc::Document& mDocument;
|
|
|
|
UniversalId mId;
|
2014-06-07 11:02:45 +00:00
|
|
|
std::vector<std::string> mSelection;
|
2014-06-06 10:43:21 +00:00
|
|
|
|
2014-06-07 11:02:45 +00:00
|
|
|
std::vector<std::string> getDeletableRecords() const;
|
2014-06-06 10:43:21 +00:00
|
|
|
|
2014-06-07 11:02:45 +00:00
|
|
|
std::vector<std::string> getRevertableRecords() const;
|
2014-06-06 10:43:21 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
CommandDispatcher (CSMDoc::Document& document, const CSMWorld::UniversalId& id,
|
|
|
|
QObject *parent = 0);
|
|
|
|
///< \param id ID of the table the commands should operate on primarily.
|
|
|
|
|
|
|
|
void setEditLock (bool locked);
|
|
|
|
|
2014-06-07 11:02:45 +00:00
|
|
|
void setSelection (const std::vector<std::string>& selection);
|
2014-06-06 10:43:21 +00:00
|
|
|
|
|
|
|
bool canDelete() const;
|
|
|
|
|
|
|
|
bool canRevert() const;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
void executeDelete();
|
|
|
|
|
|
|
|
void executeRevert();
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|