OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
regionmap.hpp
Go to the documentation of this file.
1 #ifndef CSV_WORLD_REGIONMAP_H
2 #define CSV_WORLD_REGIONMAP_H
3 
4 #include <cstddef>
5 #include <vector>
6 
7 #include <QObject>
8 #include <QTableView>
9 
10 #include "./dragrecordtable.hpp"
11 
12 class QAction;
13 
14 namespace CSMDoc
15 {
16  class Document;
17 }
18 
19 namespace CSMWorld
20 {
21  class UniversalId;
22 }
23 
24 namespace CSVWorld
25 {
26  class RegionMap : public DragRecordTable
27  {
28  Q_OBJECT
29 
38  std::string mRegionId;
39 
40  private:
41 
42  void contextMenuEvent (QContextMenuEvent *event);
43 
44  QModelIndexList getUnselectedCells() const;
46 
47  QModelIndexList getSelectedCells (bool existent = true, bool nonExistent = false) const;
50 
51  QModelIndexList getMissingRegionCells() const;
53 
54  void setRegion (const std::string& regionId);
56 
57  void mouseMoveEvent(QMouseEvent *event);
58 
59  void dropEvent(QDropEvent* event);
60 
61  public:
62 
63  RegionMap (const CSMWorld::UniversalId& universalId, CSMDoc::Document& document,
64  QWidget *parent = 0);
65 
66  virtual std::vector<CSMWorld::UniversalId> getDraggedRecords() const;
67 
68  signals:
69 
70  void editRequest (const CSMWorld::UniversalId& id, const std::string& hint);
71 
72  private slots:
73 
74  void selectAll();
75 
76  void clearSelection();
77 
78  void selectRegions();
79 
80  void createCells();
81 
82  void setRegion();
83 
84  void unsetRegion();
85 
86  void view();
87 
88  void viewInTable();
89  };
90 }
91 
92 #endif
std::string mRegionId
Definition: regionmap.hpp:38
QAction * mSelectRegionsAction
Definition: regionmap.hpp:32
RegionMap(const CSMWorld::UniversalId &universalId, CSMDoc::Document &document, QWidget *parent=0)
Definition: regionmap.cpp:177
QAction * mUnsetRegionAction
Definition: regionmap.hpp:35
static const struct @2 signals[]
void createCells()
Definition: regionmap.cpp:247
void selectAll()
Definition: regionmap.cpp:226
void mouseMoveEvent(QMouseEvent *event)
Definition: regionmap.cpp:337
QModelIndexList getUnselectedCells() const
Definition: regionmap.cpp:70
Definition: dragrecordtable.hpp:24
void selectRegions()
Definition: regionmap.cpp:239
QAction * mCreateCellsAction
Definition: regionmap.hpp:33
void contextMenuEvent(QContextMenuEvent *event)
Definition: regionmap.cpp:22
virtual std::vector< CSMWorld::UniversalId > getDraggedRecords() const
Definition: regionmap.cpp:342
void unsetRegion()
Definition: regionmap.cpp:276
QAction * mSelectAllAction
Definition: regionmap.hpp:30
QModelIndexList getMissingRegionCells() const
Unselected cells within all regions that have at least one selected cell.
Definition: regionmap.cpp:119
void viewInTable()
Definition: regionmap.cpp:310
QModelIndexList getSelectedCells(bool existent=true, bool nonExistent=false) const
Definition: regionmap.cpp:100
void editRequest(const CSMWorld::UniversalId &id, const std::string &hint)
QAction * mSetRegionAction
Definition: regionmap.hpp:34
void clearSelection()
Definition: regionmap.cpp:234
Definition: document.hpp:57
QAction * mViewInTableAction
Definition: regionmap.hpp:37
void setRegion()
Definition: regionmap.cpp:268
Definition: regionmap.hpp:26
void view()
Definition: regionmap.cpp:284
QAction * mViewAction
Definition: regionmap.hpp:36
void dropEvent(QDropEvent *event)
Definition: regionmap.cpp:364
QAction * mClearSelectionAction
Definition: regionmap.hpp:31
Definition: universalid.hpp:12