New class Dash::Project
[dashstudio.git] / src / dashserver / project / project.h
blob9870ff1073b71e9f75cc6321a68c4ae897c38ad3
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 DASHSERVER_PROJECTPROJECT_H
23 #define DASHSERVER_PROJECTPROJECT_H
25 #include <dash/project.h>
26 #include <dashserver/xdbms/object.h>
27 #include <dashserver/exports.h>
29 namespace DashServer {
30 class Connection;
32 namespace Project {
34 /**
35 @author David Cuadrado <krawek@gmail.com>
37 class DASHSERVER_EXPORT Project : public Dash::Project, public XDBMS::Object
39 public:
40 Project(QObject *parent = 0);
41 ~Project();
43 void execute(const QString &xml, DashServer::Connection *source);
44 void addClient(DashServer::Connection *cnx);
45 void removeClient(DashServer::Connection *client);
47 void sendToClient(DashServer::Connection *client);
48 void sendToAll();
50 QSet<DashServer::Connection *> members() const;
52 int clientCount() const;
54 void keep();
55 void sync();
57 bool save();
58 bool load();
60 QString fileName() const;
62 QSet<QString> designers() const;
63 void addDesigner(const QString &name);
65 QSet<QString> owners() const;
66 void addOwner(const QString &name);
68 private:
69 struct Private;
70 Private *const d;
76 #endif