kivio

tool_text.h

00001 /*
00002  * Kivio - Visual Modelling and Flowcharting
00003  * Copyright (C) 2000-2003 theKompany.com & Dave Marotti,
00004  *                         Peter Simonsson
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 #ifndef TOOL_TEXT_H
00021 #define TOOL_TEXT_H
00022 
00023 #include "kivio_mousetool.h"
00024 #include <koffice_export.h>
00025 class QMouseEvent;
00026 class QCursor;
00027 
00028 namespace Kivio {
00029   class MouseToolAction;
00030 }
00031 
00032 class KivioView;
00033 class KivioPage;
00034 class KoPoint;
00035 
00036 class KIVIO_EXPORT TextTool : public Kivio::MouseTool
00037 {
00038   Q_OBJECT
00039   public:
00040     TextTool( KivioView* parent );
00041     ~TextTool();
00042   
00043     virtual bool processEvent(QEvent* e);
00044   
00045     void text(QRect);
00046   
00047   public slots:
00048     virtual void setActivated(bool a);
00049     virtual void applyToolAction(QPtrList<KivioStencil>* stencils);
00050     virtual void applyToolAction(KivioStencil* stencil, const KoPoint& pos);
00051   
00052   protected slots:
00053     void makePermanent();
00054   
00055   signals:
00056     void operationDone();
00057   
00058   protected:
00059     void mousePress(QMouseEvent *);
00060     void mouseMove(QMouseEvent *);
00061     void mouseRelease(QMouseEvent *);
00062   
00063     bool startRubberBanding(QMouseEvent*);
00064     void continueRubberBanding(QMouseEvent *);
00065     void endRubberBanding(QMouseEvent *);
00066   
00067   
00068   
00069     QPoint m_startPoint, m_releasePoint;
00070   
00071     // Text Tool Mode
00072     enum
00073     {
00074       stmNone,
00075       stmDrawRubber
00076     };
00077   
00078   private:
00079     // Flag to indicate that we are drawing a rubber band
00080     int m_mode;
00081     QCursor* m_pTextCursor;
00082     Kivio::MouseToolAction* m_textAction;
00083     bool m_permanent;
00084 };
00085 
00086 #endif
00087 
00088 
KDE Home | KDE Accessibility Home | Description of Access Keys