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: 6499 $:
22 $Author: irascibl@gmail.com $:
23 $Date: 2012-10-02 07:21:40 +0200 (Di, 02. Okt 2012) $
24 
25 ********************************************************************/
26 
27 
28 
29 #ifndef CONNECTORSVIEW_H
30 #define CONNECTORSVIEW_H
31 
32 #include <QFrame>
33 #include <QTimer>
34 #include <QLabel>
35 #include <QScrollArea>
36 #include <QGridLayout>
37 #include <QFormLayout>
38 #include <QVBoxLayout>
39 #include <QComboBox>
40 #include <QCheckBox>
41 #include <QRadioButton>
42 #include <QMutex>
43 
44 #include "../items/itembase.h"
45 #include "../items/wire.h"
46 #include "../connectors/connectoritem.h"
47 #include "../connectors/connector.h"
48 #include "../referencemodel/referencemodel.h"
49 
50 class PEConnectorsView : public QFrame
51 {
52 Q_OBJECT
53 public:
54 	PEConnectorsView(QWidget * parent = 0);
55 	~PEConnectorsView();
56 
57     void initConnectors(QList<QDomElement> * connectorList);
58 	bool anyModified();
59 	void setSMD(bool);
60 
61 signals:
62     void connectorMetadataChanged(struct ConnectorMetadata *);
63     void removedConnectors(QList<struct ConnectorMetadata *> &);
64     void connectorCountChanged(int);
65     void connectorsTypeChanged(Connector::ConnectorType);
66 	void smdChanged(const QString &);
67 
68 protected slots:
69     void nameEntry();
70     void descriptionEntry();
71     void typeEntry();
72     void connectorCountEntry();
73     void removeConnector();
74 	void allTypeEntry();
75 	void smdEntry();
76 	void uncheckRadios();
77 
78 protected:
79     void changeConnector();
80 
81 protected:
82     QFrame * m_scrollFrame;
83 	QScrollArea * m_scrollArea;
84 	QLineEdit * m_numberEdit;
85     int m_connectorCount;
86     QMutex m_mutex;
87 	QList<QRadioButton *> m_radios;
88 	QRadioButton * m_smd;
89 	QRadioButton * m_tht;
90 };
91 
92 #endif
93