1 //////////////////////////////////////////////////////////////////////////
2 //
3 // pgAdmin III - PostgreSQL Tools
4 //
5 // Copyright (C) 2002 - 2016, The pgAdmin Development Team
6 // This software is released under the PostgreSQL Licence
7 //
8 // hdChangeConnectionHandle.h - Base Handle to allow change connected figures at connection figures
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #ifndef HDCHANGECONNECTIONHANDLE_H
13 #define HDCHANGECONNECTIONHANDLE_H
14 
15 #include "hotdraw/handles/hdIHandle.h"
16 #include "hotdraw/figures/hdLineConnection.h"
17 #include "hotdraw/connectors/hdIConnector.h"
18 #include "hotdraw/main/hdDrawing.h"
19 
20 class hdChangeConnectionHandle : public hdIHandle
21 {
22 public:
23 	hdChangeConnectionHandle(hdLineConnection *owner);
24 	~hdChangeConnectionHandle();
25 
26 	virtual void draw(wxBufferedDC &context, hdDrawingView *view);
27 	virtual wxCursor createCursor();
28 	virtual void invokeStart(hdMouseEvent &event, hdDrawingView *view);
29 	virtual void invokeStep(hdMouseEvent &event, hdDrawingView *view);
30 	virtual void invokeEnd(hdMouseEvent &event, hdDrawingView *view);
31 	virtual hdIConnector *target() = 0;
32 	virtual void disconnect(hdDrawingView *view = NULL) = 0;
33 	virtual void connect(hdIConnector *connector, hdDrawingView *view = NULL) = 0;
34 	virtual void setPoint(int posIdx, hdPoint p) = 0;
35 	virtual bool isConnectionPossible(hdIFigure *figure) = 0;
36 	hdIFigure *findConnectableFigure(int posIdx, int x, int y, hdDrawing *drawing);
37 	hdIConnector *findConnectionTarget(int posIdx, int x, int y, hdDrawing *drawing);
38 protected:
39 	hdLineConnection *connection;
40 	hdIFigure *targetFigure;
41 private:
42 	hdIConnector *originalTarget;
43 };
44 #endif
45