OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
table.hpp
Go to the documentation of this file.
1 #ifndef CSV_WORLD_TABLE_H
2 #define CSV_WORLD_TABLE_H
3 
4 #include <vector>
5 #include <string>
6 
7 #include <QEvent>
8 
9 #include "../../model/filter/node.hpp"
10 #include "../../model/world/columnbase.hpp"
11 #include "../../model/world/universalid.hpp"
12 #include "dragrecordtable.hpp"
13 
14 class QAction;
15 
16 namespace CSMDoc
17 {
18  class Document;
19 }
20 
21 namespace CSMWorld
22 {
23  class IdTableProxyModel;
24  class IdTableBase;
25  class CommandDispatcher;
26 }
27 
28 namespace CSMPrefs
29 {
30  class Setting;
31 }
32 
33 namespace CSVWorld
34 {
35  class CommandDelegate;
36  class TableEditIdAction;
37 
39  class Table : public DragRecordTable
40  {
41  Q_OBJECT
42 
44  {
53  };
54 
55  std::vector<CommandDelegate *> mDelegates;
72  std::map<Qt::KeyboardModifiers, DoubleClickAction> mDoubleClickActions;
75 
76  private:
77 
78  void contextMenuEvent (QContextMenuEvent *event);
79 
80  void mouseMoveEvent(QMouseEvent *event);
81 
82  protected:
83 
84  virtual void mouseDoubleClickEvent (QMouseEvent *event);
85 
86  public:
87 
88  Table (const CSMWorld::UniversalId& id, bool createAndDelete,
89  bool sorting, CSMDoc::Document& document);
92 
93  virtual void setEditLock (bool locked);
94 
95  CSMWorld::UniversalId getUniversalId (int row) const;
96 
97  std::vector<std::string> getColumnsWithDisplay(CSMWorld::ColumnBase::Display display) const;
98 
99  std::vector<std::string> getSelectedIds() const;
100 
101  virtual std::vector<CSMWorld::UniversalId> getDraggedRecords() const;
102 
103  signals:
104 
105  void editRequest (const CSMWorld::UniversalId& id, const std::string& hint);
106 
107  void selectionSizeChanged (int size);
108 
109  void tableSizeChanged (int size, int deleted, int modified);
113 
114  void createRequest();
115 
116  void cloneRequest(const CSMWorld::UniversalId&);
117 
118  void closeRequest();
119 
120  void extendedDeleteConfigRequest(const std::vector<std::string> &selectedIds);
121 
122  void extendedRevertConfigRequest(const std::vector<std::string> &selectedIds);
123 
124  private slots:
125 
126  void editCell();
127 
128  void editRecord();
129 
130  void cloneRecord();
131 
132  void moveUpRecord();
133 
134  void moveDownRecord();
135 
136  void viewRecord();
137 
138  void previewRecord();
139 
140  void executeExtendedDelete();
141 
142  void executeExtendedRevert();
143 
144  public slots:
145 
146  void settingChanged (const CSMPrefs::Setting *setting);
147 
148  void tableSizeUpdate();
149 
150  void selectionSizeUpdate();
151 
152  void requestFocus (const std::string& id);
153 
154  void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
155 
156  void rowAdded(const std::string &id);
157  };
158 }
159 
160 #endif
void contextMenuEvent(QContextMenuEvent *event)
Definition: table.cpp:29
virtual void setEditLock(bool locked)
Definition: table.cpp:384
void moveDownRecord()
Definition: table.cpp:478
CSMWorld::IdTableBase * mModel
Definition: table.hpp:69
static const struct @2 signals[]
std::map< Qt::KeyboardModifiers, DoubleClickAction > mDoubleClickActions
Definition: table.hpp:72
void editRecord()
Definition: table.cpp:421
QAction * mPreviewAction
Definition: table.hpp:64
void viewRecord()
Definition: table.cpp:516
QAction * mCloneAction
Definition: table.hpp:58
Display
Definition: columnbase.hpp:39
bool mUnselectAfterJump
Definition: table.hpp:74
CSMWorld::CommandDispatcher * mDispatcher
Definition: table.hpp:71
void createRequest()
QAction * mExtendedDeleteAction
Definition: table.hpp:65
void editCell()
Definition: table.cpp:511
Definition: dragrecordtable.hpp:24
QAction * mDeleteAction
Definition: table.hpp:60
std::vector< std::string > getSelectedIds() const
Definition: table.cpp:405
QAction * mCreateAction
Definition: table.hpp:57
void rowAdded(const std::string &id)
Definition: table.cpp:741
DoubleClickAction
Definition: table.hpp:43
Definition: tableeditidaction.hpp:13
void recordFilterChanged(boost::shared_ptr< CSMFilter::Node > filter)
Definition: table.cpp:695
Definition: table.hpp:48
virtual std::vector< CSMWorld::UniversalId > getDraggedRecords() const
Definition: table.cpp:728
void moveUpRecord()
Definition: table.cpp:445
CSMWorld::IdTableProxyModel * mProxyModel
Definition: table.hpp:68
QAction * mRevertAction
Definition: table.hpp:59
QAction * mEditAction
Definition: table.hpp:56
void selectionSizeUpdate()
Definition: table.cpp:682
Definition: table.hpp:47
Definition: table.hpp:52
void cloneRecord()
Definition: table.cpp:432
void cloneRequest(const CSMWorld::UniversalId &)
Definition: commanddispatcher.hpp:20
virtual void mouseDoubleClickEvent(QMouseEvent *event)
Definition: table.cpp:154
CSMWorld::UniversalId getUniversalId(int row) const
Definition: table.cpp:393
std::vector< CommandDelegate * > mDelegates
Definition: table.hpp:55
QAction * mMoveDownAction
Definition: table.hpp:62
Definition: setting.hpp:22
void executeExtendedDelete()
Definition: table.cpp:553
void requestFocus(const std::string &id)
Definition: table.cpp:687
TableEditIdAction * mEditIdAction
Definition: table.hpp:67
Definition: idtableproxymodel.hpp:18
Definition: document.hpp:57
Definition: table.hpp:49
QAction * mExtendedRevertAction
Definition: table.hpp:66
void executeExtendedRevert()
Definition: table.cpp:565
Definition: table.hpp:50
Table widget.
Definition: table.hpp:39
QAction * mMoveUpAction
Definition: table.hpp:61
void previewRecord()
Definition: table.cpp:536
Definition: table.hpp:46
void mouseMoveEvent(QMouseEvent *event)
Definition: table.cpp:702
void extendedRevertConfigRequest(const std::vector< std::string > &selectedIds)
void selectionSizeChanged(int size)
void settingChanged(const CSMPrefs::Setting *setting)
Definition: table.cpp:577
bool mJumpToAddedRecord
Definition: table.hpp:73
Definition: idtablebase.hpp:12
std::vector< std::string > getColumnsWithDisplay(CSMWorld::ColumnBase::Display display) const
Definition: table.cpp:710
void extendedDeleteConfigRequest(const std::vector< std::string > &selectedIds)
void tableSizeUpdate()
Definition: table.cpp:646
QAction * mViewAction
Definition: table.hpp:63
Definition: table.hpp:45
void tableSizeChanged(int size, int deleted, int modified)
void editRequest(const CSMWorld::UniversalId &id, const std::string &hint)
Table(const CSMWorld::UniversalId &id, bool createAndDelete, bool sorting, CSMDoc::Document &document)
Definition: table.cpp:227
int mRecordStatusDisplay
Definition: table.hpp:70
Definition: universalid.hpp:12