Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Undo.h

00001 /*
00002 Copyright (C) 2000,2001 Stefan Duffner 
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifndef UNDO_H
00020 #define UNDO_H
00021 
00022 #include <qlist.h>
00023 #include <qstringlist.h>
00024 #include "GTransition.h"
00025 #include "GState.h"
00026 #include "GITransition.h"
00027 
00028 class Project;
00029 
00034 enum UndoAction {AddState, AddTransition, ChangeState, ChangeTransition,
00035                  ChangeTransitions, MoveMultiple, 
00036                  DeleteSelection, DeleteState, DeleteTransition,
00037                  ChangeInitialTransition, SetInitialState, SetEndStates,
00038                  ChangeMachine, Paste};
00039 
00044 struct dtlist {
00046   dtlist() {tlist.setAutoDelete(FALSE); rlist.setAutoDelete(FALSE); };
00048   QList<GTransition> tlist;
00050   QList<GTransition> rlist;
00051 };
00052 
00053 
00058 class Undo
00059 {
00060   public:
00061     Undo(Project*);
00062     ~Undo();
00063 
00065     void setAction(int a) { action=a; };
00067     int getAction() { return action; };
00069     void setModified(bool m) { modified=m; };
00071     bool getModified() { return modified; };
00073     void setState(GState* s) { state=s; };
00075     GState* getState() { return state; };
00077     void setState2(GState* s) { state2=s; };
00079     GState* getState2() { return state2; };
00081     void setInitialState(GState* s) { istate=s; };
00083     GState* getInitialState() { return istate; };
00085     void setTransition(GTransition* t) { transition = t; };
00087     GTransition* getTransition() { return transition; };
00089     void setTransition2(GTransition* t) { transition2 = t; };
00091     GTransition* getTransition2() { return transition2; };
00093     void setInitialTransition(GITransition* t) { itrans= t; };
00095     GITransition* getInitialTransition() { return itrans; };
00097     void setInitialTransition2(GITransition* t) { itrans2 = t; };
00099     GITransition* getInitialTransition2() { return itrans2; };
00101     void getMovedBy(double& x, double& y) { x=movedbyx; y=movedbyy; };
00103     void setMovedBy(double x, double y) { movedbyx=x; movedbyy=y; };
00104     void getMachineInfo(Machine*& m, QString& n, int& t, int& nb, QStringList& olistm, 
00105         int& ni, QStringList& ilist, int& no, QStringList& olist, QFont& sf, QFont& tf, 
00106         int& at);
00107     void setMachineInfo(Machine* m, QString n, int t, int nb, QStringList olistm, int ni, 
00108       QStringList ilist, int no, QStringList olist, QFont sf, QFont tf, int at);
00110     void setNumBits(int nb) { numbits=nb; };
00112     int getNumBits() { return numbits; };
00114     void setNumInputs(int ni) {numin = ni; };
00116     int getNumInputs() { return numin; };
00118     void setNumOutputs(int no) {numout = no; };
00120     int getNumOutputs() { return numout; };
00121     
00122 
00124     Project* getProject() { return project; };
00126     QList<GTransition>* getCopyList() { return &copylist; };
00128     QList<GState>* getSList() { return &slist; };
00130     QList<GState>* getSList2() { return &slist2; };
00132     QList<GTransition>* getTList() { return &tlist; };
00134     QList<GTransition>* getTList2() { return &tlist2; };
00135 
00136   public:
00138     QList<dtlist>* getDoubleTList() { return &doubletlist; };
00139 
00140   private:
00142     int action;
00144     Project* project;
00146     bool modified;              
00148     GState* state;
00150     GState* state2;
00152     GState* istate;
00154     GTransition* transition;
00156     GTransition* transition2;
00158     GITransition *itrans;
00160     GITransition *itrans2;
00162     QList<GTransition> copylist;
00164     QList<GState> slist;        
00166     QList<GState> slist2;
00168     QList<GTransition> tlist;
00170     QList<GTransition> tlist2;
00172     QList<dtlist> doubletlist;
00174     double movedbyx;
00176     double movedbyy;
00177 
00179     Machine* machine;
00181     QString mname;
00183     int type;
00185     int numin;
00187     int numout;
00189     int numbits;
00191     QFont sfont;
00193     QFont tfont;
00195     int arrowtype;
00197     QStringList strlist1;
00199     QStringList strlist2;
00201     QStringList strlist3;
00202 };
00203 
00204 #endif

Generated at Fri Apr 11 22:37:14 2003 for Qfsm by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001