| 1 |
////////////////////////////////////////////////////////////////////////////// |
| 2 |
////////////////////////////////////////////////////////////////////////////// |
| 3 |
// |
| 4 |
// Copyright : (C) 2015 Eran Ifrah |
| 5 |
// File name : clSFTPEvent.h |
| 6 |
// |
| 7 |
// ------------------------------------------------------------------------- |
| 8 |
// A |
| 9 |
// _____ _ _ _ _ |
| 10 |
// / __ \ | | | | (_) | |
| 11 |
// | / \/ ___ __| | ___| | _| |_ ___ |
| 12 |
// | | / _ \ / _ |/ _ \ | | | __/ _ ) |
| 13 |
// | \__/\ (_) | (_| | __/ |___| | || __/ |
| 14 |
// \____/\___/ \__,_|\___\_____/_|\__\___| |
| 15 |
// |
| 16 |
// F i l e |
| 17 |
// |
| 18 |
// This program is free software; you can redistribute it and/or modify |
| 19 |
// it under the terms of the GNU General Public License as published by |
| 20 |
// the Free Software Foundation; either version 2 of the License, or |
| 21 |
// (at your option) any later version. |
| 22 |
// |
| 23 |
////////////////////////////////////////////////////////////////////////////// |
| 24 |
////////////////////////////////////////////////////////////////////////////// |
| 25 |
|
| 26 |
#ifndef CLSFTPEVENT_H |
| 27 |
#define CLSFTPEVENT_H |
| 28 |
|
| 29 |
#include "cl_command_event.h" // Base class: clCommandEvent |
| 30 |
|
| 31 |
class WXDLLIMPEXP_CL clSFTPEvent : public clCommandEvent |
| 32 |
{ |
| 33 |
protected: |
| 34 |
wxString m_account; |
| 35 |
wxString m_localFile; |
| 36 |
wxString m_remoteFile; |
| 37 |
wxString m_newRemoteFile; |
| 38 |
int m_selectionStart = wxNOT_FOUND; |
| 39 |
int m_selectionEnd = wxNOT_FOUND; |
| 40 |
wxString m_content; |
| 41 |
|
| 42 |
public: |
| 43 |
clSFTPEvent(wxEventType commandType = wxEVT_NULL, int winid = 0); |
| 44 |
clSFTPEvent(const clSFTPEvent& event); |
| 45 |
clSFTPEvent& operator=(const clSFTPEvent& src); |
| 46 |
|
| 47 |
virtual ~clSFTPEvent(); |
| 48 |
virtual wxEvent* Clone() const { return new clSFTPEvent(*this); } |
| 49 |
|
| 50 |
void SetAccount(const wxString& account) { this->m_account = account; } |
| 51 |
void SetLocalFile(const wxString& localFile) { this->m_localFile = localFile; } |
| 52 |
void SetRemoteFile(const wxString& remoteFile) { this->m_remoteFile = remoteFile; } |
| 53 |
const wxString& GetAccount() const { return m_account; } |
| 54 |
const wxString& GetLocalFile() const { return m_localFile; } |
| 55 |
const wxString& GetRemoteFile() const { return m_remoteFile; } |
| 56 |
void SetNewRemoteFile(const wxString& newRemoteFile) { this->m_newRemoteFile = newRemoteFile; } |
| 57 |
const wxString& GetNewRemoteFile() const { return m_newRemoteFile; } |
| 58 |
void SetSelectionEnd(int selectionEnd) { this->m_selectionEnd = selectionEnd; } |
| 59 |
void SetSelectionStart(int selectionStart) { this->m_selectionStart = selectionStart; } |
| 60 |
int GetSelectionEnd() const { return m_selectionEnd; } |
| 61 |
int GetSelectionStart() const { return m_selectionStart; } |
| 62 |
void SetContent(const wxString& content) { this->m_content = content; } |
| 63 |
const wxString& GetContent() const { return m_content; } |
| 64 |
}; |
| 65 |
|
| 66 |
typedef void (wxEvtHandler::*clSFTPEventFunction)(clSFTPEvent&); |
| 67 |
#define clSFTPEventHandler(func) wxEVENT_HANDLER_CAST(clSFTPEventFunction, func) |
| 68 |
|
| 69 |
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_SFTP_SAVE_FILE, clSFTPEvent); |
| 70 |
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_SFTP_RENAME_FILE, clSFTPEvent); |
| 71 |
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_SFTP_DELETE_FILE, clSFTPEvent); |
| 72 |
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_SFTP_OPEN_FILE, clSFTPEvent); |
| 73 |
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_SFTP_SESSION_OPENED, clSFTPEvent); |
| 74 |
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_SFTP_SESSION_CLOSED, clSFTPEvent); |
| 75 |
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_SFTP_FILE_READ, clSFTPEvent); |
| 76 |
#endif // CLSFTPEVENT_H |