Documentation
[yamf.git] / yamf / model / project.h
blob84578389b7f146494ad5d77de76b57b20d6da052
1 /***************************************************************************
2 * Copyright (C) 2005 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 ***************************************************************************/
21 #ifndef YAMFMODELPROJECT_H
22 #define YAMFMODELPROJECT_H
24 #include <yamf/common/abstractserializable.h>
25 #include <yamf/common/inthash.h>
26 #include <yamf/common/yamf_exports.h>
28 #include <QObject>
30 class QGraphicsItem;
34 namespace YAMF {
35 namespace Command { class Manager; }
37 namespace Model {
39 class Scene;
40 class Layer;
41 class Frame;
42 class Library;
44 typedef Common::IntHash<Scene *> Scenes;
47 /**
48 * @ingroup model
49 * Esta clase maneja el proyecto, además contiene las diferentes escenas que componen todo el proyecto.
51 * @brief Project manager
52 * @author David Cuadrado \<krawek@gmail.com\>
55 class YAMF_EXPORT Project : public QObject, public Common::AbstractSerializable
57 Q_OBJECT;
58 public:
59 Project(QObject *parent = 0);
60 ~Project();
63 Command::Manager *commandManager() const;
65 void setProjectName(const QString &name);
66 void setAuthor(const QString &author);
67 void setDescription(const QString& description);
69 QString projectName() const;
70 QString author() const;
71 QString description() const;
73 bool deleteDataDir();
74 QString dataDir() const;
76 Scene *scene(int logicalIndex) const;
78 int visualIndexOf(Scene *scene) const;
79 int logicalIndexOf(Scene *scene) const;
81 Scenes scenes() const;
83 Model::Scene *createScene(int logicalIndex = -1, const QString &name = QString());
85 void insertScene(Scene *scene, int logicalIndex);
86 void addScene(Scene *scene);
87 void removeScene(Scene *scene);
88 bool moveScene(int logicalIndex, int newPosition);
90 void clear();
91 void loadLibrary(const QString &filename);
93 Model::Library *library() const;
95 virtual void fromXml(const QString &xml );
96 virtual QDomElement toXml(QDomDocument &doc) const;
98 void setOpen(bool open);
99 bool isOpen();
101 private:
102 struct Private;
103 Private *const d;
109 #endif