File: EditorState.h

package info (click to toggle)
mygui 3.2.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,224 kB
  • sloc: cpp: 118,031; ansic: 30,202; xml: 15,544; cs: 12,602; tcl: 776; python: 417; makefile: 34
file content (83 lines) | stat: -rw-r--r-- 2,809 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef _fb654ad0_db5f_4387_ba52_53c0a5f3b023_
#define _fb654ad0_db5f_4387_ba52_53c0a5f3b023_

#include "SettingsWindow.h"
#include "OpenSaveFileDialog.h"
#include "CodeGenerator.h"
#include "StateController.h"
#include "MainPaneControl.h"
#include "sigslot.h"

namespace tools
{

	class EditorState :
		public StateController,
		public sigslot::has_slots<>
	{
	public:
		EditorState();
		virtual ~EditorState();

		virtual void initState();
		virtual void cleanupState();

		virtual void pauseState();
		virtual void resumeState();

	private:
		void notifyMessageBoxResultLoad(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result);
		void notifyMessageBoxResultClear(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result);
		void notifyMessageBoxResultQuit(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result);
		void notifyMessageBoxResultLoadDropFile(MyGUI::Message* _sender, MyGUI::MessageBoxStyle _result);

		void clear();
		bool save();
		void load();
		void loadDropFile();

		void command_Load(const MyGUI::UString& _commandName, bool& _result);
		void command_Save(const MyGUI::UString& _commandName, bool& _result);
		void command_SaveAs(const MyGUI::UString& _commandName, bool& _result);
		void command_Clear(const MyGUI::UString& _commandName, bool& _result);
		void command_Quit(const MyGUI::UString& _commandName, bool& _result);
		void command_Settings(const MyGUI::UString& _commandName, bool& _result);
		void command_CodeGenerator(const MyGUI::UString& _commandName, bool& _result);
		void command_OpenRecentFile(const MyGUI::UString& _commandName, bool& _result);
		void command_FileDrop(const MyGUI::UString& _commandName, bool& _result);
		void command_SaveItemAs(const MyGUI::UString& _commandName, bool& _result);
		void command_UpdateItemName(const MyGUI::UString& _commandName, bool& _result);
		void command_UpdateResources(const MyGUI::UString& _commandName, bool& _result);

		void updateCaption();
		bool checkCommand();

		void notifySettingsWindowEndDialog(Dialog* _dialog, bool _result);
		void notifyEndDialogCodeGenerator(Dialog* _dialog, bool _result);
		void notifyEndDialogOpenSaveFile(Dialog* _sender, bool _result);
		void notifyChanges(bool _changes);
		void notifySettingsChanged(const MyGUI::UString& _sectorName, const MyGUI::UString& _propertyName);

		void showLoadWindow();
		void showSaveAsWindow();

		void setFileName(const MyGUI::UString& _fileName);
		MyGUI::UString convertProjectName(const MyGUI::UString& _fileName);

		bool isProjectFile(const MyGUI::UString& _fileName);

	private:
		SettingsWindow* mSettingsWindow;
		CodeGenerator* mCodeGenerator;
		OpenSaveFileDialog* mOpenSaveFileDialog;

		MainPaneControl* mMainPaneControl;

		MyGUI::UString mFileName;
		MyGUI::UString mDefaultFileName;
		MyGUI::UString mDropFileName;
	};

}

#endif