1 /****************************************************************************
2 **
3 ** Copyright (C) 2006 Trolltech ASA. All rights reserved.
4 **
5 ** This file is part of the documentation of Qt. It was originally
6 ** published as part of Qt Quarterly.
7 **
8 ** This file may be used under the terms of the GNU General Public License
9 ** version 2.0 as published by the Free Software Foundation or under the
10 ** terms of the Qt Commercial License Agreement. The respective license
11 ** texts for these are provided with the open source and commercial
12 ** editions of Qt.
13 **
14 ** If you are unsure which license is appropriate for your use, please
15 ** review the following information:
16 ** http://www.trolltech.com/products/qt/licensing.html or contact the
17 ** sales department at sales@trolltech.com.
18 **
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 **
22 ****************************************************************************/
23 
24 #ifndef FILEEDITFACTORY_H
25 #define FILEEDITFACTORY_H
26 
27 #include "qtpropertybrowser.h"
28 #include "filepathmanager.h"
29 
30 class FileEdit;
31 
32 class FileEditFactory : public QtAbstractEditorFactory<FilePathManager>
33 {
34     Q_OBJECT
35 public:
36     FileEditFactory(QObject *parent = 0)
37         : QtAbstractEditorFactory<FilePathManager>(parent)
38             { }
39     virtual ~FileEditFactory();
40 protected:
41     virtual void connectPropertyManager(FilePathManager *manager);
42     virtual QWidget *createEditor(FilePathManager *manager, QtProperty *property,
43                 QWidget *parent);
44     virtual void disconnectPropertyManager(FilePathManager *manager);
45 private slots:
46     void slotPropertyChanged(QtProperty *property, const QString &value);
47     void slotFilterChanged(QtProperty *property, const QString &filter);
48     void slotSetValue(const QString &value);
49     void slotEditorDestroyed(QObject *object);
50 private:
51     QMap<QtProperty *, QList<FileEdit *> > theCreatedEditors;
52     QMap<FileEdit *, QtProperty *> theEditorToProperty;
53 };
54 
55 #endif
56