- Improved palette document spec
[dashstudio.git] / src / shell / projectmanager.h
blob1e3b8e0071dc832f67d27fe94b196dd6e18d2706
1 /***************************************************************************
2 * Copyright (C) 2007 by David Cuadrado *
3 * krawek@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
22 #ifndef PROJECTMANAGER_H
23 #define PROJECTMANAGER_H
25 #include <QObject>
26 #include <yamf/model/command/observer.h>
28 namespace Dash {
29 class Module;
30 class Project;
33 namespace YAMF {
35 namespace Command {
36 class Base;
42 class ProjectParams
44 public:
45 ProjectParams();
46 ~ProjectParams();
48 QString projectName;
49 QString description;
50 QString author;
52 bool isLocal;
54 QString server;
55 quint16 port;
56 QString login;
57 QString password;
60 /**
61 * @author David Cuadrado <krawek@gmail.com>
63 class ProjectManager : public QObject, public YAMF::Command::Observer
65 Q_OBJECT;
67 public:
68 ProjectManager(QObject *parent = 0);
69 ~ProjectManager();
71 void createProject(const ProjectParams &params);
72 void createScene(const QString &name, int frames);
74 void closeProject();
76 Dash::Project *project() const;
78 void registerModule(Dash::Module *module);
80 virtual bool aboutToRedo(YAMF::Command::Base *command);
81 virtual bool aboutToUndo(YAMF::Command::Base *command);
83 virtual void executed(const YAMF::Command::Base *command);
84 virtual void unexecuted(const YAMF::Command::Base *command);
86 bool isModified() const;
88 void setLocal(bool l);
89 bool isLocal() const;
91 void showChatWindow();
93 public slots:
94 void connectToServer(const QString &host, quint16 port, const QString &login, const QString &password);
95 bool connectToServer();
96 void openCollaborativeProject();
98 public:
99 bool saveProject(const QString &path);
100 bool loadProject(const QString &path);
102 private:
103 struct Private;
104 Private *const d;
107 #endif