kivio
tool_connector.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef TOOL_CONNECTOR_H
00021 #define TOOL_CONNECTOR_H
00022
00023 #include "kivio_mousetool.h"
00024 #include <KoPoint.h>
00025
00026 class QMouseEvent;
00027 class QCursor;
00028
00029 namespace Kivio {
00030 class MouseToolAction;
00031 }
00032
00033 class KivioView;
00034 class KivioPage;
00035 class Kivio1DStencil;
00036 class KivioCustomDragData;
00037
00038 class ConnectorTool : public Kivio::MouseTool
00039 {
00040 Q_OBJECT
00041 public:
00042 ConnectorTool( KivioView* parent );
00043 ~ConnectorTool();
00044
00045 virtual bool processEvent(QEvent* e);
00046
00047 void connector(QRect);
00048
00049 public slots:
00050 void setActivated(bool a);
00051
00052 protected slots:
00053 void activateStraight();
00054 void activatePolyline();
00055
00056 void makePermanent();
00057
00058 signals:
00059 void operationDone();
00060
00061 protected:
00062 void mousePress(QMouseEvent *);
00063 void mouseMove(QMouseEvent *);
00064 void mouseRelease(QMouseEvent *);
00065
00066 bool startRubberBanding(QMouseEvent*);
00067 void continueRubberBanding(QMouseEvent *);
00068 void endRubberBanding(QMouseEvent *);
00069
00070 QPoint m_startPoint, m_releasePoint;
00071
00072
00073 enum
00074 {
00075 stmNone,
00076 stmDrawRubber
00077 };
00078
00079 enum {
00080 StraightConnector,
00081 PolyLineConnector
00082 };
00083
00084 private:
00085 int m_mode;
00086 int m_type;
00087 QCursor* m_pConnectorCursor1;
00088 QCursor* m_pConnectorCursor2;
00089 Kivio1DStencil* m_pStencil;
00090 KoPoint startPoint;
00091 KivioCustomDragData* m_pDragData;
00092
00093 Kivio::MouseToolAction* m_connectorAction;
00094 Kivio::MouseToolAction* m_polyLineAction;
00095
00096 bool m_permanent;
00097 };
00098
00099 #endif
00100
00101
|