addstenciltool.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2005 Peter Simonsson <psn@linux.se>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (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#ifndef KIVIOADDSTENCILTOOL_H
20#define KIVIOADDSTENCILTOOL_H
21
22#include <KoPoint.h>
23#include <KoSize.h>
24
25#include "kivio_mousetool.h"
26
27class KivioStencilSpawner;
28
29namespace Kivio {
30
35{
36 TQ_OBJECT
37
38 public:
39 AddStencilTool(KivioView* parent);
41
42 virtual bool processEvent(TQEvent* e);
43
44 public slots:
45 void setActivated(bool a);
46 void activateNewStencil(KivioStencilSpawner* spawner);
47
48 protected:
49 void createStencil(const TQPoint& position);
50 void endOperation(const TQPoint& position);
51 void resize(const TQPoint& position);
52
53 private:
54 bool m_leftMouseButtonPressed;
55 KivioStencilSpawner* m_spawner;
56 KoPoint m_startPoint;
57 KivioStencil* m_stencil;
58 KoSize m_originalSize;
59};
60
61}
62
63#endif
Tool used to add new stencils to the canvas.
Baseclass for mouse tools (like eg the select tool)