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> *
9
* Gustavo Gonzalez / xtingray *
20
* Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com *
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. *
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. *
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
***************************************************************************/
36
#ifndef TUPPROJECTRESPONSE_H
37
#define TUPPROJECTRESPONSE_H
39
#include "tupglobal_store.h"
40
#include "tupprojectrequest.h"
42
#include "tuplibraryobject.h"
45
* Response to request (aka TupProjectRequest)
46
* @author David Cuadrado
49
class STORE_EXPORT TupProjectResponse
60
TupProjectResponse(int part, int action);
61
virtual ~TupProjectResponse();
66
int originalAction() const;
68
void setArg(const QString &value);
69
void setData(const QByteArray &data);
70
void setMode(Mode mode);
72
void setExternal(bool e);
73
bool external() const;
77
TupProjectRequestArgument arg() const;
78
QByteArray data() const;
85
class TupSceneResponse : public TupProjectResponse
88
TupSceneResponse(int part, int action);
90
int sceneIndex() const;
91
void setSceneIndex(int index);
93
void setState(const QString &state);
94
QString state() const;
95
void setScenes(Scenes scenes);
103
class TupLayerResponse : public TupSceneResponse
106
TupLayerResponse(int part, int action);
108
int layerIndex() const;
109
void setLayerIndex(int index);
115
class TupFrameResponse : public TupLayerResponse
118
TupFrameResponse(int part, int action);
120
int frameIndex() const;
121
void setFrameIndex(int index);
123
void setFrameState(bool state);
130
class TupItemResponse : public TupFrameResponse
133
TupItemResponse(int part, int action);
135
int itemIndex() const;
136
void setItemIndex(int index);
137
TupLibraryObject::Type itemType() const;
138
void setItemType(TupLibraryObject::Type type);
140
void setPosX(double coord);
141
void setPosY(double coord);
142
TupProject::Mode spaceMode();
143
void setSpaceMode(TupProject::Mode mode);
145
void setFrameState(bool state);
149
TupLibraryObject::Type m_itemType;
152
TupProject::Mode m_mode;
156
class TupLibraryResponse : public TupFrameResponse
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);
168
void setFrameState(bool state);
171
TupLibraryObject::Type m_symbolType;
173
TupProject::Mode m_mode;
177
class TupProjectResponseFactory
180
TupProjectResponseFactory();
183
~TupProjectResponseFactory();
184
static TupProjectResponse *create(int part, int action);