karbon

vimagetool.h
1/* This file is part of the KDE project
2 Copyright (C) 2002, The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18
19*/
20
21#ifndef __VIMAGETOOL_H__
22#define __VIMAGETOOL_H__
23
24#include <tqstring.h>
25
26#include "vtool.h"
27#include <commands/vcommand.h>
28
29class KarbonView;
30class VImage;
31class TQCursor;
32
33class VImageTool : public VTool
34{
35public:
36 VImageTool( KarbonView *view );
37 ~VImageTool();
38
39 virtual void activate();
40 virtual void deactivate();
41
42 virtual void setup( TDEActionCollection *collection );
43 virtual TQString uiname() { return i18n( "Image Tool" ); }
44 virtual TQString contextHelp();
45 virtual TQString statusText();
46
47protected:
48 class VInsertImageCmd : public VCommand
49 {
50 public:
51 VInsertImageCmd( VDocument* doc, const TQString& name, VImage *image, KoPoint pos );
52 virtual ~VInsertImageCmd() {}
53
54 virtual void execute();
55 virtual void unexecute();
56 virtual bool changesSelection() const { return true; }
57
58 protected:
59 VImage *m_image;
60 KoPoint m_pos;
61 };
62
63 virtual void mouseButtonRelease();
64
65private:
66 TQCursor* m_cursor;
67};
68
69#endif
70
virtual void unexecute()
Unexecutes the command.
Definition vcommand.h:75
TQString name() const
Returns the name of the command.
Definition vcommand.h:91
virtual bool changesSelection() const
Returns if the command changes the actual document selection.
Definition vcommand.h:84
virtual void execute()=0
Executes the command.
The base class for all karbon tools.
Definition vtool.h:52
virtual void mouseButtonRelease()
Left mouse button release.
Definition vtool.h:195
virtual TQString uiname()
The name of the tool.
Definition vtool.h:93
virtual TQString statusText()
The tool status text.
Definition vtool.h:108
virtual void deactivate()
Deactivates the tool.
Definition vtool.h:83
virtual void activate()
Called during the tool activation.
Definition vtool.cpp:252
virtual TQString contextHelp()
The context help of the tool.
Definition vtool.h:98
KarbonView * view() const
Returns the connected karbon part.
Definition vtool.cpp:66