51 lines
4.6 KiB
C++
51 lines
4.6 KiB
C++
/*
|
|
* Purpose: base class for all command line oriented internet protocols
|
|
* Author: Frank Buß
|
|
* Created: 2002
|
|
*/
|
|
|
|
#ifndef CMDPROT_H
|
|
#define CMDPROT_H
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include "dllimpexp.h"
|
|
#include "email.h"
|
|
|
|
|
|
class WXDLLIMPEXP_SMTP wxCmdlineProtocolSocketEventHandler;
|
|
|
|
class WXDLLIMPEXP_SMTP wxCmdlineProtocol : public wxSocketClient
|
|
{
|
|
public:
|
|
wxCmdlineProtocol();
|
|
|
|
~wxCmdlineProtocol();
|
|
|
|
void SetHost(const wxString& host, int service = 25, const wxString& user = wxT(""), const wxString& password = wxT(""));
|
|
|
|
void Connect();
|
|
|
|
// handling for wxSOCKET_INPUT
|
|
|
|
virtual void EvaluateLine(const wxString& line) = 0;
|
|
|
|
virtual void OnConnect(wxSocketEvent& event) = 0;
|
|
|
|
void OnInput(wxSocketEvent& event);
|
|
|
|
void OnSocketEvent(wxSocketEvent& event);
|
|
|
|
void Write(const wxString& msg);
|
|
|
|
private:
|
|
wxCmdlineProtocolSocketEventHandler* m_pCmdlineProtocolSocketEventHandler;
|
|
bool m_bConnected;
|
|
wxString m_inputLine;
|
|
wxString m_host;
|
|
int m_service;
|
|
wxString m_user;
|
|
wxString m_password;
|
|
};
|
|
|
|
#endif |