NCL Composer  0.1.5
 All Classes Functions Variables Pages
qnstscene.h
1 #ifndef QNSTSCENE_H
2 #define QNSTSCENE_H
3 
4 #include <QGraphicsSceneContextMenuEvent>
5 
6 #include <QGraphicsScene>
7 
8 #include <QDebug>
9 
10 #include "qnstmenu.h"
11 
12 #include "qnstentity.h"
13 #include "qnstgraphicsbody.h"
14 
15 class QnstScene : public QGraphicsScene
16 {
17  Q_OBJECT
18 
19 public:
20  QnstScene(QObject* parent = 0);
21 
22  ~QnstScene();
23 
24  QVector <QnstGraphicsEntity* > getRoots() const;
25 
26  void addRoot(QnstGraphicsEntity* root);
27 
28  void removeRoot(QnstGraphicsEntity* root);
29 
30 signals:
31  void entityAdded(QnstGraphicsEntity* entity);
32 
33  void entityRemoved(QnstGraphicsEntity* entity);
34 
35  void entityChanged(QnstGraphicsEntity* entity);
36 
37  void entitySelected(QnstGraphicsEntity* entity);
38 
39  void entityAboutToChange(QnstGraphicsEntity* entity,
40  QMap<QString, QString> properties);
41 
42  // void undoRequested();
43 
44  // void redoRequested();
45 
46  void cutRequested();
47 
48  void copyRequested();
49 
50  void pasteRequested();
51 
52  void deleteRequested();
53 
54  void exportRequested();
55 
56  void zoominRequested();
57 
58  void zoomoutRequested();
59 
60  void zoomresetRequested();
61 
62  void fullscreenRequested();
63 
64 protected:
65  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent* event);
66 
67 protected slots:
68  void performBody();
69 
70 private:
71  void createObjects();
72 
73  void createConnections();
74 
75  QnstMenu* menu;
76 
77  QVector <QnstGraphicsEntity*> roots;
78 };
79 
80 #endif // QNSTSCENE_H