Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SCSTATE_H
00021 #define SCSTATE_H
00022 #include <QMetaType>
00023 #include <QObject>
00024 #include <QList>
00025 #include "stateattributes.h"
00026 #include "sctransition.h"
00027 class QString;
00028 class QXmlStreamWriter;
00029 class QPoint;
00030 #include "textblock.h"
00031 #include "scdatamodel_global.h"
00032 #include "scitem.h"
00033
00051 class SCDATAMODELSHARED_EXPORT SCState : public SCItem
00052 {
00053 Q_OBJECT
00054 public:
00055 SCState(QObject *parent = 0);
00056 SCState(const SCState& st);
00057 SCState( bool topState=false);
00058 ~SCState();
00059
00060 virtual IAttributeContainer * getAttributes();
00061
00062 void setStateName(QString n);
00063 void addTransistion(SCTransition*);
00064 void addState(SCState *);
00065
00066
00067 void setAttributeValue(QString key, QString value);
00068 QString getAttributeValue(QString key);
00069
00070 int getStateCount();
00071
00072 void setSize (QPointF& size);
00073 void setSize (QPoint& size);
00074 void setPosition (QPointF& size);
00075
00081 void getAllTransitions( QList<SCTransition*> & list);
00082
00089 void getTransitions(QList<SCTransition*> & transitionList);
00090
00096 void getStates(QList<SCState *> & stateList);
00097
00103 void getAllStates(QList<SCState *> & stateList);
00104
00105
00106
00113 void writeSCVXML(QXmlStreamWriter & xmlWriter);
00114
00122 TextBlock* getIDTextBlock();
00123
00124 StateAttributes attributes;
00125
00126 signals:
00127
00128 void changed();
00129
00130
00131
00132 public slots:
00133
00134
00135 private slots:
00136
00137 void handleNameChanged(IAttribute* name);
00138 void handleTextBlockChanged();
00139
00140
00141 private:
00142
00143
00144 void initCommon();
00145
00146
00147
00148 TextBlock * _IdTextBlock;
00149
00150 };
00151
00152 Q_DECLARE_METATYPE (SCState*)
00153
00154
00155 #endif // SCSTATE_H