00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef DESIGNERGUI_H
00023 #define DESIGNERGUI_H
00024
00025 #include <QObject>
00026 #include <QList>
00027 #include <QString>
00028 #include <QMap>
00029 #include "qvgui/qvgui.h"
00030 #include "itemproperties.h"
00031 #include "itemfactory.h"
00032 #include "slate/slatewindow.h"
00033
00034 #ifndef DOXYGEN_IGNORE_THIS
00035
00036 class QVPropertyContainer;
00037 class QVPropertyContainerChange;
00038
00039
00040
00041 class DesignerGUI: QObject, QVGUI
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 DesignerGUI();
00047
00049
00051 virtual void init();
00052
00054 void show();
00055
00056
00058
00059
00060 QList<QString> getItemTypes() const;
00061
00062
00063 QList<QString> getInputItemTypes() const;
00064
00065
00066 QList<QString> getMiddleItemTypes() const;
00067
00068
00069 QList<QString> getOutputItemTypes() const;
00070
00071
00073
00074
00075 bool addItem(const QString type, const QString name);
00076
00077
00078 bool addLink(const QString fromName, const QString fromProp, const QString toName, const QString toProp, const bool synchronous);
00079
00080
00081 bool delItem(const QString name);
00082
00083
00084 bool delLink(const QString fromName, const QString fromProp, const QString toName, const QString toProp);
00085
00086
00087 template <class Type> bool setProperty(const QString fromName, const QString fromProp, const Type &value);
00088
00089 void showProperties(const QString itemName);
00090
00092
00093
00094 void run();
00095
00096
00097 void stop();
00098
00099 public slots:
00100 void quit();
00101 void processChange(QVPropertyContainerChange change);
00102
00103 private:
00104 bool createDialog(const QString itemName);
00105
00106 ItemFactory factory;
00107 SlateWindow slate;
00108
00109 QMap<QString, QVPropertyContainer *> containers;
00110 QMap<QString, QDialog *> dialogs;
00111
00112 class CreatedLink
00113 {
00114 public:
00115 CreatedLink(const QString _fromName, const QString _fromProp, const QString _toName, const QString _toProp, const bool _synchronous):
00116 fromName(_fromName), fromProp(_fromProp), toName(_toName), toProp(_toProp), synchronous(_synchronous) { }
00117
00118 QString fromName, fromProp, toName, toProp;
00119 bool synchronous;
00120 };
00121
00122 class CreatedItem
00123 {
00124 public:
00125 CreatedItem(const QString _type, const QString _name): type(_type), name(_name) { }
00126
00127 QString type, name;
00128 };
00129
00130 QMap<QString, CreatedLink> createdLinks;
00131 QMap<QString, CreatedItem> createdItems;
00132 };
00133
00134 #endif
00135
00136 #endif
00137