summaryrefslogtreecommitdiffstats
path: root/kimagemapeditor/kimecommands.h
blob: cc341bb4f6b283ef59902866fca9e9f25194a4b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/***************************************************************************
                          kimecommands.h  -  description
                             -------------------
    begin                : Fri May 25 2001
    copyright            : (C) 2001 by Jan Schäfer
    email                : janschaefer@users.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KIMECOMMANDS_H
#define KIMECOMMANDS_H


#include <kcommand.h>

#include <tdeversion.h>

class KImageMapEditor;
class AreaSelection;



class CutCommand : public

#if TDE_VERSION < 300
KCommand
#else
KNamedCommand
#endif

{
	public:
  	CutCommand (KImageMapEditor * document, const AreaSelection & selection);
  	virtual ~CutCommand();

  	virtual void execute();
  	virtual void unexecute();

  protected:
  	AreaSelection *_cutAreaSelection;
		KImageMapEditor* _document;
		bool _cutted;
};

/**
 * Does the same like the cut command
 * only have a different name in the Undo-History
 **/
class DeleteCommand : public CutCommand
{
 public :
 	 DeleteCommand (KImageMapEditor * document, const AreaSelection & selection);
};

class PasteCommand : public
#if TDE_VERSION < 300
KCommand
#else
KNamedCommand
#endif
{
	public:
  	PasteCommand (KImageMapEditor * document, const AreaSelection & selection);
  	~PasteCommand ();

  	virtual void execute();
  	virtual void unexecute();

  protected:
  	AreaSelection *_pasteAreaSelection;
		KImageMapEditor* _document;
		bool _pasted;
		bool _wasUndoed;

};

class MoveCommand : public
#if TDE_VERSION < 300
KCommand
#else
KNamedCommand
#endif
{
	public:
  	MoveCommand (KImageMapEditor *document, AreaSelection *a,const TQPoint & oldPoint);
  	~MoveCommand ();

  	virtual void execute();
  	virtual void unexecute();

  protected:
		TQPoint _newPoint;
		TQPoint _oldPoint;
		
		KImageMapEditor* _document;
  	AreaSelection *_areaSelection;
//-		Area *_oldArea;
};

class ResizeCommand : public
#if TDE_VERSION < 300
KCommand
#else
KNamedCommand
#endif
{
	public:
  	ResizeCommand (KImageMapEditor *document, AreaSelection *a, Area *oldArea);
  	~ResizeCommand ();

  	virtual void execute();
  	virtual void unexecute();

  protected:
		
		KImageMapEditor* _document;
  	AreaSelection *_areaSelection;
		Area *_oldArea;
		Area *_newArea;
};

class AddPointCommand : public
#if TDE_VERSION < 300
KCommand
#else
KNamedCommand
#endif
{
	public:
  	AddPointCommand (KImageMapEditor *document, AreaSelection *a, const TQPoint & p);
  	~AddPointCommand ();

  	virtual void execute();
  	virtual void unexecute();

  protected:
		
		KImageMapEditor* _document;
  	AreaSelection *_areaSelection;
    TQPoint _point;
    int _coordpos;
};

class RemovePointCommand : public
#if TDE_VERSION < 300
KCommand
#else
KNamedCommand
#endif
{
	public:
  	RemovePointCommand (KImageMapEditor *document, AreaSelection *a, Area *oldArea);
  	~RemovePointCommand ();

  	virtual void execute();
  	virtual void unexecute();

  protected:
		
		KImageMapEditor* _document;
  	AreaSelection *_areaSelection;
		Area *_oldArea;
		Area *_newArea;
};


class CreateCommand : public
#if TDE_VERSION < 300
KCommand
#else
KNamedCommand
#endif
{
	public:
  	CreateCommand (KImageMapEditor *document, Area *area);
  	~CreateCommand ();

  	virtual void execute();
  	virtual void unexecute();

  protected:
			
		KImageMapEditor* _document;
		Area *_area;
		bool _created;
		bool _wasUndoed;
};


#endif