1 #ifndef _fb654ad0_db5f_4387_ba52_53c0a5f3b023_ 2 #define _fb654ad0_db5f_4387_ba52_53c0a5f3b023_ 3 4 #include "SettingsWindow.h" 5 #include "OpenSaveFileDialog.h" 6 #include "CodeGenerator.h" 7 #include "StateController.h" 8 #include "MainPaneControl.h" 9 #include "sigslot.h" 10 11 namespace tools 12 { 13 14 class EditorState : 15 public StateController, 16 public sigslot::has_slots<> 17 { 18 public: 19 EditorState(); 20 21 virtual void initState(); 22 virtual void cleanupState(); 23 24 virtual void pauseState(); 25 virtual void resumeState(); 26 27 private: 28 void notifyMessageBoxResultLoad(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result); 29 void notifyMessageBoxResultClear(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result); 30 void notifyMessageBoxResultQuit(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result); 31 void notifyMessageBoxResultLoadDropFile(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result); 32 33 void clear(); 34 bool save(); 35 void load(); 36 void loadDropFile(); 37 38 void command_Load(const MyGUI::UString& _commandName, bool& _result); 39 void command_Save(const MyGUI::UString& _commandName, bool& _result); 40 void command_SaveAs(const MyGUI::UString& _commandName, bool& _result); 41 void command_Clear(const MyGUI::UString& _commandName, bool& _result); 42 void command_Quit(const MyGUI::UString& _commandName, bool& _result); 43 void command_Settings(const MyGUI::UString& _commandName, bool& _result); 44 void command_CodeGenerator(const MyGUI::UString& _commandName, bool& _result); 45 void command_OpenRecentFile(const MyGUI::UString& _commandName, bool& _result); 46 void command_FileDrop(const MyGUI::UString& _commandName, bool& _result); 47 void command_SaveItemAs(const MyGUI::UString& _commandName, bool& _result); 48 void command_UpdateItemName(const MyGUI::UString& _commandName, bool& _result); 49 void command_UpdateResources(const MyGUI::UString& _commandName, bool& _result); 50 51 void updateCaption(); 52 bool checkCommand(); 53 54 void notifySettingsWindowEndDialog(Dialog* _dialog, bool _result); 55 void notifyEndDialogCodeGenerator(Dialog* _dialog, bool _result); 56 void notifyEndDialogOpenSaveFile(Dialog* _sender, bool _result); 57 void notifyChanges(bool _changes); 58 void notifySettingsChanged(const MyGUI::UString& _sectorName, const MyGUI::UString& _propertyName); 59 60 void showLoadWindow(); 61 void showSaveAsWindow(); 62 63 void setFileName(const MyGUI::UString& _fileName); 64 MyGUI::UString convertProjectName(const MyGUI::UString& _fileName); 65 66 bool isProjectFile(const MyGUI::UString& _fileName); 67 68 private: 69 SettingsWindow* mSettingsWindow; 70 CodeGenerator* mCodeGenerator; 71 OpenSaveFileDialog* mOpenSaveFileDialog; 72 73 MainPaneControl* mMainPaneControl; 74 75 MyGUI::UString mFileName; 76 MyGUI::UString mDefaultFileName; 77 MyGUI::UString mDropFileName; 78 }; 79 80 } 81 82 #endif 83