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: 6483 $:
22 $Author: irascibl@gmail.com $:
23 $Date: 2012-09-26 15:45:37 +0200 (Mi, 26. Sep 2012) $
24 
25 ********************************************************************/
26 
27 
28 
29 #ifndef METADATAVIEW_H
30 #define METADATAVIEW_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 <QTextEdit>
42 
43 #include "../items/itembase.h"
44 #include "../items/wire.h"
45 #include "../connectors/connectoritem.h"
46 #include "../referencemodel/referencemodel.h"
47 
48 
49 class PEMetadataView : public QScrollArea
50 {
51 Q_OBJECT
52 public:
53 	PEMetadataView(QWidget * parent = 0);
54 	~PEMetadataView();
55 
56     void initMetadata(const QDomDocument &);
57 	void resetProperty(const QString & name, const QString & value);
58 	QString family();
59 	QString variant();
60 	const QHash<QString, QString> & properties();
61 
62 signals:
63     void metadataChanged(const QString & name, const QString & value);
64     void propertiesChanged(const QHash<QString, QString> &);
65     void tagsChanged(const QStringList &);
66 
67 protected slots:
68     void titleEntry();
69     void authorEntry();
70     void descriptionEntry();
71     void labelEntry();
72     void familyEntry();
73     void variantEntry();
74     void dateEntry();
75 	void urlEntry();
76     void propertiesEntry();
77     void tagsEntry();
78 
79 protected:
80     QPointer<QLineEdit> m_titleEdit;
81     QPointer<QLineEdit> m_dateEdit;
82     QPointer<QLineEdit> m_authorEdit;
83     QPointer<QLineEdit> m_familyEdit;
84     QPointer<QLineEdit> m_variantEdit;
85     QPointer<QLineEdit> m_labelEdit;
86     QPointer<QLineEdit> m_urlEdit;
87     QPointer<QTextEdit> m_descriptionEdit;
88     QPointer<class HashPopulateWidget> m_propertiesEdit;
89     QPointer<class HashPopulateWidget> m_tagsEdit;
90     QPointer<QFrame> m_mainFrame;
91 };
92 
93 
94 class FocusOutTextEdit :public QTextEdit
95 {
96     Q_OBJECT
97 public:
98     FocusOutTextEdit(QWidget * parent = 0);
99     ~FocusOutTextEdit();
100 
101 signals:
102     void focusOut();
103 
104 protected:
105 	void focusOutEvent(QFocusEvent *);
106 };
107 
108 
109 #endif
110