~ubuntu-branches/ubuntu/wily/tupi/wily-proposed

« back to all changes in this revision

Viewing changes to src/store/ktframe.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-05-13 09:53:35 UTC
  • mfrom: (8.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130513095335-3iqdvt9ne07ia25v
Tags: 0.2+git01-1
* Upload to unstable.
* Removed unnecessary versioned Build-Depends.
* Removed obsolete "DM-Upload-Allowed".
* Added Vcs links to collab-maint.
* Standards updated to version 3.9.4.
* Corrected "libavutil51"-->"libavutil-dev" in Build-Depends.
* Updated debian/watch (corrected URL, removed comments).
* Updated get-orig-source (can work from any directory).
* Updated my email address; bumped copyright years.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Project TUPI: Magia 2D                                                *
3
 
 *   Project Contact: info@maefloresta.com                                 *
4
 
 *   Project Website: http://www.maefloresta.com                           *
5
 
 *   Project Leader: Gustav Gonzalez <info@maefloresta.com>                *
6
 
 *                                                                         *
7
 
 *   Developers:                                                           *
8
 
 *   2010:                                                                 *
9
 
 *    Gustavo Gonzalez / xtingray                                          *
10
 
 *                                                                         *
11
 
 *   KTooN's versions:                                                     * 
12
 
 *                                                                         *
13
 
 *   2006:                                                                 *
14
 
 *    David Cuadrado                                                       *
15
 
 *    Jorge Cuadrado                                                       *
16
 
 *   2003:                                                                 *
17
 
 *    Fernado Roldan                                                       *
18
 
 *    Simena Dinas                                                         *
19
 
 *                                                                         *
20
 
 *   Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com       *
21
 
 *   License:                                                              *
22
 
 *   This program is free software; you can redistribute it and/or modify  *
23
 
 *   it under the terms of the GNU General Public License as published by  *
24
 
 *   the Free Software Foundation; either version 3 of the License, or     *
25
 
 *   (at your option) any later version.                                   *
26
 
 *                                                                         *
27
 
 *   This program is distributed in the hope that it will be useful,       *
28
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
29
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
30
 
 *   GNU General Public License for more details.                          *
31
 
 *                                                                         *
32
 
 *   You should have received a copy of the GNU General Public License     *
33
 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
34
 
 ***************************************************************************/
35
 
 
36
 
#ifndef KTFRAME_H
37
 
#define KTFRAME_H
38
 
 
39
 
#include "ktabstractserializable.h"
40
 
#include "ktinthash.h"
41
 
#include "ktsvgitem.h"
42
 
#include "ktbackground.h"
43
 
#include "ktglobal_store.h"
44
 
 
45
 
#include <QGraphicsScene>
46
 
#include <QDomDocument>
47
 
#include <QDomElement>
48
 
 
49
 
class KTFrame;
50
 
class KTLayer;
51
 
class KTBackground;
52
 
class KTGraphicObject;
53
 
class KTSvgItem;
54
 
class KTProject;
55
 
class KTScene;
56
 
 
57
 
typedef KTIntHash<KTGraphicObject *> GraphicObjects;
58
 
typedef KTIntHash<KTSvgItem *> SvgObjects;
59
 
 
60
 
/**
61
 
 * @brief Esta clase representa un marco o frame de la animacion
62
 
 * @author David Cuadrado
63
 
*/
64
 
 
65
 
class STORE_EXPORT KTFrame : public QObject, public KTAbstractSerializable
66
 
{
67
 
    public:
68
 
       /**
69
 
        * Constructor por defecto
70
 
        */
71
 
       KTFrame(KTLayer *parent);
72
 
       KTFrame(KTBackground *bg);
73
 
       
74
 
       /**
75
 
        * Destructor
76
 
        */
77
 
       ~KTFrame();
78
 
       
79
 
       /**
80
 
        * Pone el nombre del frame
81
 
        */
82
 
       void setFrameName(const QString &name);
83
 
       
84
 
       /**
85
 
        * Bloquea el frame
86
 
        */
87
 
       void setLocked(bool isLocked);
88
 
       
89
 
       /**
90
 
        * Retorna el nombre del frame
91
 
        */
92
 
       QString frameName() const;
93
 
       
94
 
       /**
95
 
        * Returna verdadero cuando el frame esta bloqueado
96
 
        */
97
 
       bool isLocked() const;
98
 
       
99
 
       void setVisible(bool isVisible);
100
 
       bool isVisible() const;
101
 
       
102
 
       void addItem(QGraphicsItem *item);
103
 
       void addItem(const QString &key, QGraphicsItem *item);
104
 
       void removeItemFromFrame(const QString &key);
105
 
       void updateIdFromFrame(const QString &oldId, const QString &newId);
106
 
 
107
 
       void addSvgItem(const QString &key, KTSvgItem *item);
108
 
       void removeSvgItemFromFrame(const QString &key);
109
 
       void updateSvgIdFromFrame(const QString &oldId, const QString &newId);
110
 
 
111
 
       void insertItem(int position, QGraphicsItem *item);
112
 
       void insertSvgItem(int position, KTSvgItem *item);
113
 
       
114
 
       void replaceItem(int position, QGraphicsItem *item);
115
 
       bool moveItem(int currentPosition, int newPosition);
116
 
       
117
 
       bool removeGraphicAt(int position);
118
 
       bool removeSvgAt(int position);
119
 
 
120
 
       QGraphicsItem *createItem(int position, QPointF coords, const QString &xml, bool loaded = false);
121
 
       KTSvgItem *createSvgItem(int position, QPointF coords, const QString &xml, bool loaded = false);
122
 
 
123
 
       void setGraphics(GraphicObjects objects);       
124
 
       void setSvgObjects(SvgObjects objects);
125
 
       GraphicObjects graphics() const;
126
 
       SvgObjects svgItems() const; 
127
 
       
128
 
       KTGraphicObject *graphic(int position) const;
129
 
       KTSvgItem *svg(int position) const; 
130
 
       QGraphicsItem *item(int position) const;
131
 
       
132
 
       QGraphicsItemGroup *createItemGroupAt(int position, QList<qreal> group);
133
 
       QList<QGraphicsItem *> destroyItemGroup(int position);
134
 
             
135
 
       KTLayer *layer() const;
136
 
       KTScene *scene() const;
137
 
       KTProject *project() const;
138
 
       
139
 
       int indexOf(KTGraphicObject *object) const;
140
 
       int indexOf(QGraphicsItem *item) const;
141
 
       int indexOf(KTSvgItem *item) const;
142
 
       
143
 
       int index() const;
144
 
       
145
 
       void setRepeat(int repeat);
146
 
       int repeat() const;
147
 
       
148
 
       void clean();
149
 
       int graphicItemsCount();
150
 
       int svgItemsCount();
151
 
 
152
 
       int getTopZLevel();
153
 
       QList<int> itemIndexes();
154
 
       QList<int> svgIndexes();
155
 
 
156
 
       bool isEmpty();
157
 
       
158
 
    public:
159
 
       virtual void fromXml(const QString &xml);
160
 
       virtual QDomElement toXml(QDomDocument &doc) const;
161
 
       
162
 
    private:
163
 
       struct Private;
164
 
       Private *const k;
165
 
};
166
 
 
167
 
#endif