forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNoteJSWorkspace.h
123 lines (101 loc) · 3.24 KB
/
NoteJSWorkspace.h
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef NOTEJSWORKSPACE_H
#define NOTEJSWORKSPACE_H
#include "IWorkspace.h"
#include <wx/filename.h>
#include "cl_command_event.h"
#include "NodeJSDebugger.h"
#include "TerminalEmulator.h"
class NodeJSWorkspaceView;
class NodeJSWorkspace : public IWorkspace
{
protected:
wxFileName m_filename;
wxArrayString m_folders;
NodeJSWorkspaceView* m_view;
bool m_clangOldFlag;
bool m_dummy;
bool m_showWelcomePage;
NodeJSDebugger::Ptr_t m_debugger;
TerminalEmulator m_terminal;
static NodeJSWorkspace* ms_workspace;
protected:
void DoClear();
bool DoOpen(const wxFileName& filename);
//--------------------------------------------------
// Event handlers
//--------------------------------------------------
/**
* @brief CodeLite requests to close the workspace
*/
void OnCloseWorkspace(clCommandEvent& e);
/**
* @brief create new workspace (originated from the menu bar)
*/
void OnNewWorkspace(clCommandEvent& e);
/**
* @brief open a workspace
*/
void OnOpenWorkspace(clCommandEvent& event);
/**
* @brief all editors have been closed
*/
void OnAllEditorsClosed(wxCommandEvent& event);
/**
* @brief handle save session command from CodeLite
*/
void OnSaveSession(clCommandEvent& event);
/**
* @brief execute the current script
*/
void OnExecute(clExecuteEvent& event);
void OnStopExecute(clExecuteEvent& event);
void OnIsExecuteInProgress(clExecuteEvent& event);
void OnProcessOutput(clCommandEvent& event);
void OnProcessTerminated(clCommandEvent& event);
/**
* @brief restore the workspace session
*/
void RestoreSession();
NodeJSWorkspace(); // default ctor is private
public:
virtual void GetProjectFiles(const wxString& projectName, wxArrayString& files) const;
virtual void GetWorkspaceFiles(wxArrayString& files) const;
virtual wxString GetProjectFromFile(const wxFileName& filename) const;
virtual wxString GetFilesMask() const;
NodeJSWorkspace(bool dummy);
virtual ~NodeJSWorkspace();
static NodeJSWorkspace* Get();
static void Free();
public:
virtual bool IsBuildSupported() const;
virtual bool IsProjectSupported() const;
NodeJSWorkspaceView* GetView() { return m_view; }
NodeJSDebugger::Ptr_t GetDebugger() { return m_debugger; }
/**
* @brief is this workspace opened?
*/
bool IsOpen() const;
/**
* @brief create nodejs at the given path
*/
bool Create(const wxFileName& filename);
/**
* @brief open nodejs workspace and load its view
*/
bool Open(const wxFileName& filename);
/**
* @brief close the current workspace
* this function fires the wxEVT_WORKSPACE_CLOSED event
*/
void Close();
/**
* @brief save the workspace content to the file system
*/
void Save();
void SetFilename(const wxFileName& filename) { this->m_filename = filename; }
const wxFileName& GetFilename() const { return m_filename; }
void SetFolders(const wxArrayString& folders) { this->m_folders = folders; }
const wxArrayString& GetFolders() const { return m_folders; }
wxArrayString& GetFolders() { return m_folders; }
};
#endif // NOTEJSWORKSPACE_H