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

C:/Users/David/Documents/QtProjects/visualsc/scdatamodel/scxmlreader.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 
00021 #ifndef SCXMLREADER_H
00022 #define SCXMLREADER_H
00023 
00024 #include <QString>
00025 #include <QStringList>
00026 #include <QXmlStreamReader>
00027 #include <QObject>
00028 
00029 #include "stateattributes.h"
00030 #include "transitionattributes.h"
00031 #include "textblock.h"
00032 
00033 class StateData;
00034 
00035 #include "scdatamodel_global.h"
00036 
00037 class  SCDATAMODELSHARED_EXPORT  SCXMLReader : public QObject
00038 {
00039     Q_OBJECT
00040 
00041 public:
00042     SCXMLReader( );
00043     void readFile(QString infile);
00044     virtual void run();
00045 
00046 signals:
00047      void done(bool result, QStringList message);
00048      void makeANewState(StateAttributes*);
00049      void enterStateElement();
00050      void leaveStateElement();
00051 
00052      void enterTransistionElement();
00053      void leaveTransistionElement();
00054      void makeANewTransistion(TransitionAttributes*);
00055 
00056      void enterTransitionPathElement();
00057      void leaveTransitionPathElement();
00058      void makeANewTransistionPath(QString path);
00059      void makeANewIDTextBlockElement( TextBlockAttributes*);
00060 
00061 
00062 
00063 private:
00064 
00065     enum STATE_TYPE{kSTATE_TYPE_Normal=0, kSTATE_TYPE_Initial, kSTATE_TYPE_Final, kSTATE_TYPE_Machine};
00066 
00067     QXmlStreamReader _reader;
00068     QString _file;
00069     QStringList _resultMessages;
00070 
00071     void readIDTextBlockElement();
00072     void readElement();
00073     void readState(STATE_TYPE t= kSTATE_TYPE_Normal);
00074     void readTransistion();
00075     void readTransistionPath();
00076     void readFinal();
00077     void readOnEntry();
00078     void readOnExit();
00079 };
00080 
00081 #endif // SCXMLREADER_H

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