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

« back to all changes in this revision

Viewing changes to src/store/tupprojectresponse.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 TUPPROJECTRESPONSE_H
 
37
#define TUPPROJECTRESPONSE_H
 
38
 
 
39
#include "tupglobal_store.h"
 
40
#include "tupprojectrequest.h"
 
41
#include "tupscene.h"
 
42
#include "tuplibraryobject.h"
 
43
 
 
44
/**
 
45
 * Response to request (aka TupProjectRequest)
 
46
 * @author David Cuadrado
 
47
*/
 
48
 
 
49
class STORE_EXPORT TupProjectResponse
 
50
{
 
51
    public:
 
52
        enum Mode
 
53
             {
 
54
               None = 0x00,
 
55
               Do,
 
56
               Redo,
 
57
               Undo
 
58
             };
 
59
 
 
60
        TupProjectResponse(int part, int action);
 
61
        virtual ~TupProjectResponse();
 
62
 
 
63
        int part() const;
 
64
        int action() const;
 
65
 
 
66
        int originalAction() const;
 
67
 
 
68
        void setArg(const QString &value);
 
69
        void setData(const QByteArray &data);
 
70
        void setMode(Mode mode);
 
71
 
 
72
        void setExternal(bool e);
 
73
        bool external() const;
 
74
 
 
75
        Mode mode() const;
 
76
 
 
77
        TupProjectRequestArgument arg() const;
 
78
        QByteArray data() const;
 
79
 
 
80
    private:
 
81
        class Private;
 
82
        Private *const k;
 
83
};
 
84
 
 
85
class TupSceneResponse : public TupProjectResponse
 
86
{
 
87
    public:
 
88
        TupSceneResponse(int part, int action);
 
89
        ~TupSceneResponse();
 
90
        int sceneIndex() const;
 
91
        void setSceneIndex(int index);
 
92
 
 
93
        void setState(const QString &state);
 
94
        QString state() const;
 
95
        void setScenes(Scenes scenes);
 
96
 
 
97
    private:
 
98
        int m_sceneIndex;
 
99
        QString m_state;
 
100
        Scenes m_scenes;
 
101
};
 
102
 
 
103
class TupLayerResponse : public TupSceneResponse
 
104
{
 
105
    public:
 
106
        TupLayerResponse(int part, int action);
 
107
        ~TupLayerResponse();
 
108
        int layerIndex() const;
 
109
        void setLayerIndex(int index);
 
110
 
 
111
    private:
 
112
        int m_layerIndex;
 
113
};
 
114
 
 
115
class TupFrameResponse : public TupLayerResponse
 
116
{
 
117
    public:
 
118
        TupFrameResponse(int part, int action);
 
119
        ~TupFrameResponse();
 
120
        int frameIndex() const;
 
121
        void setFrameIndex(int index);
 
122
        bool frameIsEmpty();
 
123
        void setFrameState(bool state);
 
124
 
 
125
    private:
 
126
        int m_frameIndex;
 
127
        bool empty;
 
128
};
 
129
 
 
130
class TupItemResponse : public TupFrameResponse
 
131
{
 
132
    public:
 
133
        TupItemResponse(int part, int action);
 
134
        ~TupItemResponse();
 
135
        int itemIndex() const;
 
136
        void setItemIndex(int index);
 
137
        TupLibraryObject::Type itemType() const;
 
138
        void setItemType(TupLibraryObject::Type type);
 
139
        QPointF position();
 
140
        void setPosX(double coord);
 
141
        void setPosY(double coord);
 
142
        TupProject::Mode spaceMode();
 
143
        void setSpaceMode(TupProject::Mode mode);
 
144
        bool frameIsEmpty();
 
145
        void setFrameState(bool state);
 
146
 
 
147
    private:
 
148
        int m_itemIndex;
 
149
        TupLibraryObject::Type m_itemType;
 
150
        double m_x;
 
151
        double m_y;
 
152
        TupProject::Mode m_mode;
 
153
        bool empty;
 
154
};
 
155
 
 
156
class TupLibraryResponse : public TupFrameResponse
 
157
{
 
158
    public:
 
159
        TupLibraryResponse(int part, int action);
 
160
        ~TupLibraryResponse();
 
161
        void setSymbolType(TupLibraryObject::Type symtype);
 
162
        TupLibraryObject::Type symbolType() const;
 
163
        void setParent(const QString top);
 
164
        QString parent() const;
 
165
        TupProject::Mode spaceMode();
 
166
        void setSpaceMode(TupProject::Mode mode);
 
167
        bool frameIsEmpty();
 
168
        void setFrameState(bool state);
 
169
 
 
170
    private:
 
171
        TupLibraryObject::Type m_symbolType;
 
172
        QString parentNode;
 
173
        TupProject::Mode m_mode;
 
174
        bool empty;
 
175
};
 
176
 
 
177
class TupProjectResponseFactory
 
178
{
 
179
    private:
 
180
        TupProjectResponseFactory();
 
181
 
 
182
    public:
 
183
        ~TupProjectResponseFactory();
 
184
        static TupProjectResponse *create(int part, int action);
 
185
};
 
186
 
 
187
#endif