NCL Composer  0.1.5
 All Classes Functions Variables Pages
extra/qnlycomposerplugin.h
1 /*
2  * Copyright 2011 TeleMidia/PUC-Rio.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see
16  * <http://www.gnu.org/licenses/>.
17  */
18 #ifndef QNLYCOMPOSERPLUGIN_H
19 #define QNLYCOMPOSERPLUGIN_H
20 
21 #include <QMap>
22 #include <QStack>
23 #include <QString>
24 
25 #include <core/extensions/IPlugin.h>
26 using namespace composer::extension;
27 
28 #include "ui/view/qnlyview.h"
29 
30 namespace composer {
31 namespace plugin {
32 namespace layout {
33 
35 {
36  Q_OBJECT
37 
38 public:
39  QnlyComposerPlugin(QObject* parent = 0);
40 
42 
43  void init();
44 
45  virtual QWidget* getWidget();
46 
47  virtual bool saveSubsession();
48 
49 public slots:
50  virtual void onEntityAdded(QString pluginID, Entity *entity);
51 
52  virtual void errorMessage(QString error);
53 
54  virtual void onEntityChanged(QString pluginID, Entity *entity);
55 
56  virtual void onEntityRemoved(QString pluginID, QString entityID);
57 
58  virtual void changeSelectedEntity (void*);
59 
60 protected slots:
61 
62  virtual void addRegion(Entity* entity);
63 
64  virtual void removeRegion(Entity* entity);
65 
66  virtual void selectRegion(Entity* entity);
67 
68  virtual void changeRegion(Entity* entity);
69 
70  virtual void addRegionBase(Entity* entity);
71 
72  virtual void removeRegionBase(Entity* entity);
73 
74  virtual void selectRegionBase(Entity* entity);
75 
76  virtual void changeRegionBase(Entity* entity);
77 
78 
79  virtual void addRegion(const QString regionUID, const QString parentUID, const QString regionbaseUID, const QMap<QString, QString> &attributes);
80 
81  virtual void removeRegion(const QString regionUID, const QString regionbaseUID);
82 
83  virtual void selectRegion(const QString regionUID, const QString regionbaseUID);
84 
85  virtual void changeRegion(const QString regionUID, const QString regionbaseUID, const QMap<QString, QString> &attributes);
86 
87  virtual void addRegionBase(const QString regionbaseUID, const QMap<QString, QString> &attributes);
88 
89  virtual void removeRegionBase(const QString regionbaseUID);
90 
91  virtual void selectRegionBase(const QString regionbaseUID);
92 
93  virtual void changeRegionBase(const QString regionbaseUID, const QMap<QString, QString> &attributes);
94 
95 private:
96  void createView();
97 
98  void createDocument();
99 
100  void createConnections();
101 
102  QMap<QString, QString> entities;
103 
104  QMap<QString, Entity*> regions;
105 
106  QMap<QString, Entity*> regionbases;
107 
108  QMap<QString, QString> relations;
109 
110  QnlyView* view;
111 };
112 
113 }
114 }
115 }
116 
117 #endif // QNLYCOMPOSERPLUGIN_H