chalk

kis_command.h
1/*
2 * Copyright (c) 1999 Michael Koch <koch@kde.org>
3 * Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
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 Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef KIS_COMMAND_H_
21#define KIS_COMMAND_H_
22
23#include <tqstring.h>
24#include <kcommand.h>
25
26class KisUndoAdapter;
27
28class KisCommand : public KCommand {
29 typedef KCommand super;
30
31public:
32 KisCommand(KisUndoAdapter *undoAdapter);
33 KisCommand(const TQString& name, KisUndoAdapter *undoAdapter);
34 virtual ~KisCommand();
35
36 virtual void execute() = 0;
37 virtual void unexecute() = 0;
38 virtual TQString name() const;
39
40protected:
41 KisUndoAdapter *adapter() const;
42
43private:
44 KisUndoAdapter *m_undoAdapter;
45 TQString m_name;
46};
47
48inline
49KisUndoAdapter *KisCommand::adapter() const
50{
51 return m_undoAdapter;
52}
53
54#endif // KIS_COMMAND_H_
55