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 "facade/itemproperties.h"
00031 #include "facade/itemfactory.h"
00032 #include "slate/slatewindow.h"
00033 #include "slate/informer.h"
00034
00035 #ifndef DOXYGEN_IGNORE_THIS
00036
00037 class QVPropertyContainer;
00038 class QVPropertyContainerChange;
00039
00040
00041 class QVDesignerGUI: QObject, QVGUI
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 QVDesignerGUI();
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 QString getCppText() const;
00072
00073 QString getXMLText() const;
00074
00075
00077
00078
00079 bool addItem(const QString type, const QString name);
00080
00081
00082 bool addLink(const QString fromName, const QString fromProp, const QString toName, const QString toProp, const bool synchronous);
00083
00084
00085 bool delItem(const QString name);
00086
00087
00088 bool delLink(const QString fromName, const QString fromProp, const QString toName, const QString toProp);
00089
00090
00091 template <class Type> bool setProperty(const QString fromName, const QString fromProp, const Type &value);
00092
00093 void showProperties(const QString itemName);
00094
00096
00097
00098 void run();
00099
00100
00101 void stop();
00102
00103 public slots:
00104 void quit();
00105 void processChange(QVPropertyContainerChange change);
00106 void dialogChange(QVPropertyContainerChange change);
00107
00108 private:
00109 bool createDialog(const QString itemName);
00110 void deleteDialog(const QString itemName);
00111 QString getLinkName(QVPropertyContainerChange change);
00112 QString getLinkName(QString fromName, QString fromProp, QString toName, QString toProp);
00113 QString getAbsPropName(QString fromName, QString fromProp);
00114
00115 ItemFactory factory;
00116 SlateWindow slate;
00117 Informer informer;
00118
00119 QMap<QString, QVPropertyContainer *> containers;
00120 QMap<QString, QVPropertyContainer *> initialContainers;
00121 QMap<QString, QDialog *> dialogs;
00122
00123 class CreatedLink
00124 {
00125 public:
00126 CreatedLink(const QString _fromName, const QString _fromProp, const QString _toName, const QString _toProp, const bool _synchronous):
00127 fromName(_fromName), fromProp(_fromProp), toName(_toName), toProp(_toProp), synchronous(_synchronous) { }
00128
00129 QString fromName, fromProp, toName, toProp;
00130 bool synchronous;
00131 };
00132
00133 class CreatedItem
00134 {
00135 public:
00136 CreatedItem(const QString _type, const QString _name): type(_type), name(_name) { }
00137
00138 QString type, name;
00139 };
00140
00141 class PropertyChange
00142 {
00143 public:
00144 PropertyChange(const QString cont, const QString prop, const QVariant val): contName(cont), propName(prop), value(val) { }
00145
00146 QString contName, propName;
00147 QVariant value;
00148 };
00149
00150 QMap<QString, CreatedLink> createdLinks;
00151 QMap<QString, CreatedItem> createdItems;
00152 QMap<QString, PropertyChange> propertyChanges;
00153 };
00154
00155 #endif
00156
00157 #endif
00158