NCL Composer  0.1.5
 All Classes Functions Variables Pages
OutlineViewPlugin.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 OUTLINEVIEWPLUGIN_H
19 #define OUTLINEVIEWPLUGIN_H
20 
21 #include <QObject>
22 
23 #include "NCLTreeWidget.h"
24 #include <core/extensions/IPlugin.h>
25 using namespace composer::extension;
26 
31 class OutlineViewPlugin : public IPlugin
32 {
33  Q_OBJECT
34 
35 private:
36  NCLTreeWidget *window, *windowBuffering;
37  QString *selectedId;
38  QMap <QString, QTreeWidgetItem*> idToItem;
39  bool isSyncFromTextual;
40 
41 public:
45  explicit OutlineViewPlugin();
55  void init();
65  QWidget* getWidget();
73  bool saveSubsession();
74 
75 public slots:
84  void onEntityAdded(QString pluginID, Entity *);
93  void onEntityChanged(QString ID, Entity *);
102  void onEntityRemoved(QString ID, QString entityID);
103 
108  void updateFromModel();
109 
117  void errorMessage(QString error);
118 
119  /* Comunication from Debug to me */
125  void debugHasSendClearAll(QString pluginIDm, void *obj);
126 
132  void changeSelectedEntity(QString pluginId, void* param);
133 
134 
138  void textualStartSync(QString, void*);
139 
143  void textualFinishSync(QString, void*);
144 
145 // COMUNICATION WITH VALIDATION PLUGIN //
150  void clearValidationMessages(QString, void *param);
154  void validationError(QString pluginID, void *param);
155 // END COMMUNICATION WITH VALIDATION PLUGIN
156 
160  void clearErrorMessages();
161 
162 private slots:
169  void elementRemovedByUser(QString id);
175  void elementAddedByUser( QString type,
176  QString parentId,
177  QMap <QString, QString> & atts,
178  bool force);
182  void itemSelectionChanged();
183 };
184 
185 #endif // OUTLINEVIEWPLUGIN_H