• Main Page
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

C:/Users/David/Documents/QtProjects/visualsc/scdatamodel/scstate.h

Go to the documentation of this file.
00001 /*
00002     visualsc - Visual State Chart Editing for SCXML State Engines
00003     Copyright (C) 2011  David W. Drell (david@davidwdrell.net) and
00004     Contributing Authors:
00005 
00006 
00007     This program is free software: you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation, either version 3 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
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(); // reimplemented from SCItem base
00061 
00062     void setStateName(QString n);
00063     void addTransistion(SCTransition*);
00064     void addState(SCState *);
00065    // void makeTargetConnections(QList<SCTransition*> & transitionList);
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     //private data
00147 
00148     TextBlock * _IdTextBlock;
00149 
00150 };
00151 
00152 Q_DECLARE_METATYPE (SCState*)
00153 
00154 
00155 #endif // SCSTATE_H

Generated on Mon Sep 26 2011 06:59:25 for visualsc by  doxygen 1.7.1