1 /******************************************************************* 2 3 Part of the Fritzing project - http://fritzing.org 4 Copyright (c) 2007-2014 Fachhochschule Potsdam - http://fh-potsdam.de 5 6 Fritzing is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 Fritzing is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with Fritzing. If not, see <http://www.gnu.org/licenses/>. 18 19 ******************************************************************** 20 21 $Revision: 6912 $: 22 $Author: irascibl@gmail.com $: 23 $Date: 2013-03-09 08:18:59 +0100 (Sa, 09. Mrz 2013) $ 24 25 ********************************************************************/ 26 27 #ifndef VIRTUALWIRE_H 28 #define VIRTUALWIRE_H 29 30 #include "clipablewire.h" 31 32 class VirtualWire : public ClipableWire 33 { 34 Q_OBJECT 35 36 public: 37 VirtualWire( ModelPart * modelPart, ViewLayer::ViewID, const ViewGeometry & , long id, QMenu* itemMenu ); 38 ~VirtualWire(); 39 40 void setHidden(bool hidden); 41 void setInactive(bool inactivate); 42 void tempRemoveAllConnections(); 43 void setColorWasNamed(bool); 44 bool colorWasNamed(); 45 QPainterPath shape() const; 46 47 protected: 48 void paint (QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ); 49 void mousePressEvent(QGraphicsSceneMouseEvent *event); 50 void connectionChange(ConnectorItem * onMe, ConnectorItem * onIt, bool connect); 51 class FSvgRenderer * setUpConnectors(class ModelPart *, ViewLayer::ViewID); 52 void hideConnectors(); 53 void inactivateConnectors(); 54 55 public: 56 static const double ShapeWidthExtra; 57 58 protected: 59 bool m_colorWasNamed; 60 61 }; 62 63 #endif 64