kivio
tool_connector.h
00001 /* 00002 * Kivio - Visual Modelling and Flowcharting 00003 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti 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 SML_TOOL_CONNECTOR_H 00020 #define SML_TOOL_CONNECTOR_H 00021 00022 #include "kivio_mousetool.h" 00023 #include <KoPoint.h> 00024 00025 class QMouseEvent; 00026 class QCursor; 00027 00028 class KToggleAction; 00029 00030 class KivioView; 00031 class KivioPage; 00032 class KivioSMLConnector; 00033 class KivioCustomDragData; 00034 00035 class SMLConnector : public Kivio::MouseTool 00036 { Q_OBJECT 00037 public: 00038 SMLConnector( KivioView* view ); 00039 ~SMLConnector(); 00040 00041 virtual bool processEvent( QEvent* ); 00042 00043 void connector(QRect); 00044 00045 public slots: 00046 virtual void setActivated(bool a); 00047 00048 signals: 00049 void operationDone(); 00050 00051 protected: 00052 void mousePress(QMouseEvent *); 00053 void mouseMove(QMouseEvent *); 00054 void mouseRelease(QMouseEvent *); 00055 00056 bool startRubberBanding(QMouseEvent*); 00057 void continueRubberBanding(QMouseEvent *); 00058 void endRubberBanding(QMouseEvent *); 00059 00060 00061 00062 QPoint m_startPoint, m_releasePoint; 00063 00064 // Connector Tool Mode 00065 enum 00066 { 00067 stmNone, 00068 stmDrawRubber 00069 }; 00070 00071 private: 00072 // Flag to indicate that we are drawing a rubber band 00073 int m_mode; 00074 QCursor* m_pConnectorCursor1; 00075 QCursor* m_pConnectorCursor2; 00076 KivioSMLConnector* m_pStencil; 00077 KoPoint startPoint; 00078 KivioCustomDragData* m_pDragData; 00079 00080 KToggleAction* m_connectorAction; 00081 }; 00082 00083 #endif 00084 00085

