Go to the documentation of this file.00001 #ifndef _STATEMANAGER_H_4684351181311_
00002 #define _STATEMANAGER_H_4684351181311_
00003
00004 class State;
00005 class StateDialog;
00006 class Editor;
00007
00008 class QPoint;
00009 #include <QList>
00010 #include <QMap>
00011
00012
00013
00014
00015
00016 class StateManager
00017 {
00018 private:
00019 static bool instantiated;
00020 static StateManager *manager;
00021 StateManager();
00022
00023 public:
00024 ~StateManager()
00025 {
00026 instantiated = false;
00027 }
00028
00029
00030 const QList<QString> &getTypeNameList() const;
00031
00032
00033 int getTypeNameId(const QString &typeName) const;
00034
00035 static StateManager* getInstance();
00036
00037 State* createState(Editor *editor, const QPoint& pos, const StateDialog& sd);
00038
00039 State* createState(const QString& typeName, Editor *editor, const QPoint& pos,
00040 const QString& label, const QString& name, bool dimmed);
00041
00042 protected:
00043
00044 State* createStateNormal(Editor *editor, const QPoint& pos, const QString& label,
00045 const QString& name, bool dimmed);
00046 State* createStateNormalFinal(Editor *editor, const QPoint& pos, const QString& label,
00047 const QString& name, bool dimmed);
00048 State* createStateVar(Editor *editor, const QPoint& pos, const QString& label,
00049 const QString& name, bool dimmed);
00050 State* createStateVarFinal(Editor *editor, const QPoint& pos, const QString& label,
00051 const QString& name, bool dimmed);
00052
00053 QList<QString> stateTypeList;
00054
00055 typedef State* (StateManager::*StateConstructor)
00056 (Editor *editor, const QPoint& pos, const QString&, const QString&, bool);
00057 typedef QMap<QString, StateConstructor> TypeNameToInstanceMap;
00058 TypeNameToInstanceMap typeNameToInstanceMap;
00059 };
00060
00061 #endif //_STATEMANAGER_H_4684351181311_