1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef _EDITOR_H_
29 #define _EDITOR_H_
30 
31 #include <wx/string.h>
32 
33 #include "OgreString.h"
34 
35 #include "EventArgs.h"
36 #include "EventContainer.h"
37 
38 class wxControl;
39 
40 class EditorContributor;
41 class EditorInput;
42 
43 using Ogre::String;
44 
45 class Editor : public EventContainer
46 {
47 public:
48 	enum EditorEvent
49 	{
50 		NameChanged,
51 		DirtyStateChanged
52 	};
53 
54 	Editor();
55 	Editor(EditorInput* input);
56 	virtual ~Editor();
57 
58 	wxControl* getControl() const;
59 	void setControl(wxControl* control);
60 
61 	EditorInput* getEditorInput() const;
62 	void setEditorInput(EditorInput* input);
63 
64 	EditorContributor* getEditorContributor() const;
65 
66 	const wxString& getName() const;
67 	void setName(const wxString& name);
68 
69 	virtual void activate();
70 	virtual void deactivate();
71 
72 	virtual bool isDirty();
73 	virtual void save();
74 	virtual void saveAs();
75 	virtual bool isSaveAsAllowed();
76 
77 	virtual bool isRedoable();
78 	virtual void redo();
79 	virtual bool isUndoable();
80 	virtual void undo();
81 
82 	virtual bool isCuttable();
83 	virtual void cut();
84 	virtual bool isCopyable();
85 	virtual void copy();
86 	virtual bool isPastable();
87 	virtual void paste();
88 
89 private:
90 	void registerEvents();
91 
92 	EditorInput* mEditorInput;
93 	wxControl* mControl;
94 	wxString mName;
95 };
96 
97 #endif // _EDITOR_H_
98