OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
commanddispatcher.hpp
Go to the documentation of this file.
1 #ifndef CSM_WOLRD_COMMANDDISPATCHER_H
2 #define CSM_WOLRD_COMMANDDISPATCHER_H
3 
4 #include <vector>
5 
6 #include <QObject>
7 
8 #include "universalid.hpp"
9 
10 class QModelIndex;
11 class QAbstractItemModel;
12 
13 namespace CSMDoc
14 {
15  class Document;
16 }
17 
18 namespace CSMWorld
19 {
20  class CommandDispatcher : public QObject
21  {
22  Q_OBJECT
23 
24  bool mLocked;
27  std::vector<std::string> mSelection;
28  std::vector<UniversalId> mExtendedTypes;
29 
30  std::vector<std::string> getDeletableRecords() const;
31 
32  std::vector<std::string> getRevertableRecords() const;
33 
34  public:
35 
37  QObject *parent = 0);
39 
40  void setEditLock (bool locked);
41 
42  void setSelection (const std::vector<std::string>& selection);
43 
44  void setExtendedTypes (const std::vector<UniversalId>& types);
46 
47  bool canDelete() const;
48 
49  bool canRevert() const;
50 
57  std::vector<UniversalId> getExtendedTypes() const;
58 
63  void executeModify (QAbstractItemModel *model, const QModelIndex& index, const QVariant& new_);
64 
65  public slots:
66 
67  void executeDelete();
68 
69  void executeRevert();
70 
71  void executeExtendedDelete();
72 
73  void executeExtendedRevert();
74 
75  };
76 }
77 
78 #endif
UniversalId mId
Definition: commanddispatcher.hpp:26
void setSelection(const std::vector< std::string > &selection)
Definition: commanddispatcher.cpp:94
void setExtendedTypes(const std::vector< UniversalId > &types)
Set record lists selected by the user for extended operations.
Definition: commanddispatcher.cpp:101
std::vector< std::string > getRevertableRecords() const
Definition: commanddispatcher.cpp:53
bool mLocked
Definition: commanddispatcher.hpp:24
void executeDelete()
Definition: commanddispatcher.cpp:183
CSMDoc::Document & mDocument
Definition: commanddispatcher.hpp:25
bool canRevert() const
Definition: commanddispatcher.cpp:114
std::vector< UniversalId > mExtendedTypes
Definition: commanddispatcher.hpp:28
void executeRevert()
Definition: commanddispatcher.cpp:215
void executeModify(QAbstractItemModel *model, const QModelIndex &index, const QVariant &new_)
Definition: commanddispatcher.cpp:136
Definition: commanddispatcher.hpp:20
CommandDispatcher(CSMDoc::Document &document, const CSMWorld::UniversalId &id, QObject *parent=0)
Definition: commanddispatcher.cpp:84
std::vector< std::string > getDeletableRecords() const
Definition: commanddispatcher.cpp:16
bool canDelete() const
Definition: commanddispatcher.cpp:106
Definition: document.hpp:57
void executeExtendedDelete()
Definition: commanddispatcher.cpp:239
void setEditLock(bool locked)
Definition: commanddispatcher.cpp:89
std::vector< std::string > mSelection
Definition: commanddispatcher.hpp:27
std::vector< UniversalId > getExtendedTypes() const
Definition: commanddispatcher.cpp:122
void executeExtendedRevert()
Definition: commanddispatcher.cpp:274
Definition: universalid.hpp:12