kivio

kivio_connector_target.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 KIVIO_CONNECTOR_TARGET_H
00020 #define KIVIO_CONNECTOR_TARGET_H
00021 
00022 #include <qdom.h>
00023 #include <qptrlist.h>
00024 
00025 #include <KoPoint.h>
00026 
00027 class KivioIntraStencilData;
00028 class KivioPainter;
00029 class KivioStencil;
00030 class KivioConnectorPoint;
00031 
00032 class KivioConnectorTarget
00033 {
00034 protected:
00035     KoPoint m_position;
00036     double m_xOffset, m_yOffset;
00037     int m_id;
00038     QPtrList<KivioConnectorPoint> *m_pConnectors;
00039 
00040 public:
00041     KivioConnectorTarget();
00042     KivioConnectorTarget( double, double );
00043     KivioConnectorTarget( double, double, double, double );
00044     virtual ~KivioConnectorTarget();
00045 
00046     bool loadXML( const QDomElement & );
00047     QDomElement saveXML( QDomDocument & );
00048 
00049     KivioConnectorTarget *duplicate();
00050 
00051     inline float x() { return m_position.x(); }
00052     inline float y() { return m_position.y(); }
00053     inline KoPoint position() { return m_position; }
00054 
00055     void setId( int id );
00056     inline int id() { return m_id; }
00057 
00058     void setX( float );
00059     void setY( float );
00060     void setPosition( float, float );
00061 
00062     void addConnectorPointToList( KivioConnectorPoint * );
00063     bool removeConnectorPointFromList( KivioConnectorPoint * );
00064 
00065     void paintOutline( KivioIntraStencilData * );
00066     
00067     void disconnectPoint( KivioConnectorPoint * );
00068     
00069     bool hasConnections();
00070     
00071     void setOffsets(double x, double y);
00072     double xOffset() { return m_xOffset; }
00073     double yOffset() { return m_yOffset; }
00074 };
00075 
00076 #endif
00077 
KDE Home | KDE Accessibility Home | Description of Access Keys