NCL Composer  0.1.5
 All Classes Functions Variables Pages
ProjectControl.h
1 /* Copyright (c) 2011 Telemidia/PUC-Rio.
2  * All rights reserved. This program and the accompanying materials
3  * are made available under the terms of the Eclipse Public License v1.0
4  * which accompanies this distribution, and is available at
5  * http://www.eclipse.org/legal/epl-v10.html
6  *
7  * Contributors:
8  * Telemidia/PUC-Rio - initial API and implementation
9  */
10 #ifndef DOCUMENTCONTROL_H
11 #define DOCUMENTCONTROL_H
12 
13 #include <QObject>
14 #include <QProcess>
15 #include <QFile>
16 #include <QTextStream>
17 
18 #include <iostream>
19 
20 #include "../util/ComposerCoreControl_global.h"
21 
22 #include "PluginControl.h"
23 #include "LanguageControl.h"
24 using namespace composer::core;
25 
26 #include "../model/Project.h"
27 using namespace composer::core::model;
28 
29 #include "../util/Singleton.h"
30 #include "../util/Utilities.h"
31 using namespace composer::core::util;
32 
33 namespace composer {
34  namespace core {
35 
36 
40 class COMPOSERCORESHARED_EXPORT ProjectControl : public QObject
41 {
42  Q_OBJECT
43  SINGLETON(ProjectControl)
44 
45 private:
53  ~ProjectControl();
54 
55  QMap<QString, Project*> openProjects;
58 public:
64  Project *getOpenProject(QString location);
65 
66  public slots:
72  bool closeProject(QString location);
78  void saveProject(QString location);
84  void moveProject(QString location, QString dest, bool saveDesc = false);
90  void saveTemporaryProject(QString location);
96  bool launchProject(QString location);
97 
104  void importFromDocument(QString docLocation, QString projLocation);
105 
106 private slots:
107  void projectIsDirty(bool isDirty);
108 
109 signals:
115  void startOpenProject(QString document);
121  void endOpenProject(QString document);
127  void projectAlreadyOpen(QString);
133  void notifyError(QString);
134 
139  void dirtyProject(QString, bool);
140 };
141 
142 } } //end namespace
143 
144 
145 #endif // DOCUMENTCONTROL_H