kivio

addstenciltool.h

00001 /*
00002  * Kivio - Visual Modelling and Flowcharting
00003  * Copyright (C) 2005 Peter Simonsson <psn@linux.se>
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 #ifndef KIVIOADDSTENCILTOOL_H
00020 #define KIVIOADDSTENCILTOOL_H
00021 
00022 #include <KoPoint.h>
00023 #include <KoSize.h>
00024 
00025 #include "kivio_mousetool.h"
00026 
00027 class KivioStencilSpawner;
00028 
00029 namespace Kivio {
00030 
00034 class AddStencilTool : public MouseTool
00035 {
00036   Q_OBJECT
00037   public:
00038     AddStencilTool(KivioView* parent);
00039     ~AddStencilTool();
00040 
00041     virtual bool processEvent(QEvent* e);
00042 
00043   public slots:
00044     void setActivated(bool a);
00045     void activateNewStencil(KivioStencilSpawner* spawner);
00046 
00047   protected:
00048     void createStencil(const QPoint& position);
00049     void endOperation(const QPoint& position);
00050     void resize(const QPoint& position);
00051 
00052   private:
00053     bool m_leftMouseButtonPressed;
00054     KivioStencilSpawner* m_spawner;
00055     KoPoint m_startPoint;
00056     KivioStencil* m_stencil;
00057     KoSize m_originalSize;
00058 };
00059 
00060 }
00061 
00062 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys