kiviosmlconnector/tool_connector.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
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 SML_TOOL_CONNECTOR_H
20#define SML_TOOL_CONNECTOR_H
21
22#include "kivio_mousetool.h"
23#include <KoPoint.h>
24
25class TQMouseEvent;
26class TQCursor;
27
28class TDEToggleAction;
29
30class KivioView;
31class KivioPage;
32class KivioSMLConnector;
33class KivioCustomDragData;
34
35class SMLConnector : public Kivio::MouseTool
36{ TQ_OBJECT
37
38public:
39 SMLConnector( KivioView* view );
40 ~SMLConnector();
41
42 virtual bool processEvent( TQEvent* );
43
44 void connector(TQRect);
45
46public slots:
47 virtual void setActivated(bool a);
48
49signals:
50 void operationDone();
51
52protected:
53 void mousePress(TQMouseEvent *);
54 void mouseMove(TQMouseEvent *);
55 void mouseRelease(TQMouseEvent *);
56
57 bool startRubberBanding(TQMouseEvent*);
58 void continueRubberBanding(TQMouseEvent *);
59 void endRubberBanding(TQMouseEvent *);
60
61
62
63 TQPoint m_startPoint, m_releasePoint;
64
65 // Connector Tool Mode
66 enum
67 {
68 stmNone,
69 stmDrawRubber
70 };
71
72private:
73 // Flag to indicate that we are drawing a rubber band
74 int m_mode;
75 TQCursor* m_pConnectorCursor1;
76 TQCursor* m_pConnectorCursor2;
77 KivioSMLConnector* m_pStencil;
78 KoPoint startPoint;
79 KivioCustomDragData* m_pDragData;
80
81 TDEToggleAction* m_connectorAction;
82};
83
84#endif
85
86
Baseclass for mouse tools (like eg the select tool)