00001 /* 00002 * Purpose: private wxWindows helper classes for SMTP 00003 * Author: Frank Buß 00004 * Created: 2002 00005 */ 00006 00007 #ifndef STATES_H 00008 #define STATES_H 00009 00010 #include <wx/wx.h> 00011 #include <wx/socket.h> 00012 00013 #include "smtp.h" 00014 00020 class MailState 00021 { 00022 public: 00023 virtual void onConnect(wxSMTP& context, wxSocketEvent& event) const {} 00024 virtual void onResponse(wxSMTP& context, int smtpCode) const {} 00025 }; 00026 00030 class InitialState : public MailState 00031 { 00032 public: 00037 void onConnect(wxSMTP& context, wxSocketEvent& event) const ; 00038 }; 00039 00040 00044 class ConnectedState : public MailState 00045 { 00046 public: 00051 void onResponse(wxSMTP& context, int smtpCode) const ; 00052 }; 00053 00054 00058 class HeloState : public MailState 00059 { 00060 public: 00065 void onResponse(wxSMTP& context, int smtpCode) const ; 00066 }; 00067 00068 00072 class SendMailFromState : public MailState 00073 { 00074 public: 00079 void onResponse(wxSMTP& context, int smtpCode) const ; 00080 }; 00081 00082 00087 class RcptListState : public MailState 00088 { 00089 public: 00094 void onResponse(wxSMTP& context, int smtpCode) const ; 00095 }; 00096 00097 00101 class StartDataState : public MailState 00102 { 00103 public: 00108 void onResponse(wxSMTP& context, int smtpCode) const ; 00109 }; 00110 00111 00115 class DataState : public MailState 00116 { 00117 public: 00122 void onResponse(wxSMTP& context, int smtpCode) const ; 00123 }; 00124 00125 extern const InitialState g_initialState; 00126 extern const ConnectedState g_connectedState; 00127 extern const HeloState g_heloState; 00128 extern const SendMailFromState g_sendMailFromState; 00129 extern const RcptListState g_rcptListState; 00130 extern const StartDataState g_startDataState; 00131 extern const DataState g_dataState; 00132 00133 #endif