| 1 |
#ifndef __CodeDesigner__ |
| 2 |
#define __CodeDesigner__ |
| 3 |
|
| 4 |
#include "plugin.h" |
| 5 |
#include "codedesigneritemdlg.h" |
| 6 |
#include <wx/ipc.h> |
| 7 |
#include <wx/list.h> |
| 8 |
|
| 9 |
class CDServer; |
| 10 |
class CDConnection; |
| 11 |
|
| 12 |
class CodeDesigner : public IPlugin |
| 13 |
{ |
| 14 |
public: |
| 15 |
CodeDesigner(IManager *manager); |
| 16 |
~CodeDesigner(); |
| 17 |
|
| 18 |
IManager* GetManager() { return m_mgr; } |
| 19 |
|
| 20 |
void RetagWorkspace(); |
| 21 |
bool AddFilesToWorkspace(wxArrayString& paths, CDConnection *connectio ); |
| 22 |
|
| 23 |
//-------------------------------------------- |
| 24 |
//Abstract methods |
| 25 |
//-------------------------------------------- |
| 26 |
virtual clToolBar *CreateToolBar(wxWindow *parent); |
| 27 |
virtual void CreatePluginMenu(wxMenu *pluginsMenu); |
| 28 |
virtual void HookPopupMenu(wxMenu *menu, MenuType type); |
| 29 |
virtual void UnHookPopupMenu(wxMenu *menu, MenuType type); |
| 30 |
virtual void UnPlug(); |
| 31 |
|
| 32 |
protected: |
| 33 |
bool m_addFileMenu; |
| 34 |
wxMenuItem* m_separatorItem; |
| 35 |
CDServer *m_Server; |
| 36 |
|
| 37 |
wxMenu *CreatePopupMenu(); |
| 38 |
void DoLaunchCD(const wxString &file); |
| 39 |
void DoCreateCDProject(CDItemInfo &info); |
| 40 |
wxString GetCDPath(); |
| 41 |
void StartServer(); |
| 42 |
|
| 43 |
void OnSettings(wxCommandEvent &e); |
| 44 |
void OnOpenFile(wxCommandEvent &e); |
| 45 |
void OnOpenWithCD(wxCommandEvent &e); |
| 46 |
void OnUpdateOpenWithCD(wxUpdateUIEvent &e); |
| 47 |
void OnCDTerminated(wxCommandEvent &e); |
| 48 |
void OnNewSCH(wxCommandEvent &e); |
| 49 |
void OnNewHSCH(wxCommandEvent &e); |
| 50 |
void OnNewCD(wxCommandEvent &e); |
| 51 |
void OnPokeData(wxCommandEvent &e); |
| 52 |
}; |
| 53 |
|
| 54 |
class CDServer; |
| 55 |
|
| 56 |
class CDConnection : public wxConnection |
| 57 |
{ |
| 58 |
public: |
| 59 |
CDConnection(CDServer *server); |
| 60 |
virtual ~CDConnection(); |
| 61 |
|
| 62 |
virtual bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format); |
| 63 |
virtual bool OnDisconnect(); |
| 64 |
|
| 65 |
void SetTreeFolder(const wxString& TreeFolder) {this->m_TreeFolder = TreeFolder;} |
| 66 |
const wxString& GetTreeFolder() const {return m_TreeFolder;} |
| 67 |
|
| 68 |
protected: |
| 69 |
CDServer *m_Server; |
| 70 |
wxString m_TreeFolder; |
| 71 |
}; |
| 72 |
|
| 73 |
WX_DECLARE_LIST(CDConnection, ConnectionList); |
| 74 |
|
| 75 |
class CDServer : public wxServer |
| 76 |
{ |
| 77 |
public: |
| 78 |
CDServer(); |
| 79 |
virtual ~CDServer(); |
| 80 |
|
| 81 |
void Disconnect(CDConnection *connection); |
| 82 |
|
| 83 |
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic); |
| 84 |
|
| 85 |
protected: |
| 86 |
ConnectionList m_Connections; |
| 87 |
}; |
| 88 |
|
| 89 |
#endif //CodeDesigner |