00001
00002
00003
00004
00005
00006
00007 #ifndef EMAIL_H
00008 #define EMAIL_H
00009
00010 #include <wx/wx.h>
00011 #include <wx/filename.h>
00012 #include <wx/wfstream.h>
00013
00014 #include "mime.h"
00015
00016
00017 class wxRecipientsIterator;
00018
00022 class wxEmailMessage
00023 {
00024 public:
00031 wxEmailMessage(const wxString& subject, const wxString& text, const wxString& from);
00032
00037 const wxString& GetFrom();
00038
00046 void AddRecipient(const wxString& address);
00047
00052 void AddTo(const wxString& address);
00053
00058 void AddCc(const wxString& address);
00059
00064 void AddBcc(const wxString& address);
00065
00066
00067
00075 void AddFile(const wxFileName& fileName, const wxString mimeMainType = "", const wxString mimeSubType = "");
00076
00082 wxRecipientsIterator GetRecipientsIterator();
00083
00088
00089 void Encode(wxOutputStream& out);
00090
00091 private:
00092 wxString m_subject;
00093 wxString m_text;
00094 wxString m_from;
00095 wxArrayString m_rcptArray;
00096 wxArrayString m_toArray;
00097 wxArrayString m_ccArray;
00098 wxArrayString m_bccArray;
00099 wxArrayMimePart m_mimeParts;
00100
00101 friend class wxRecipientsIterator;
00102 };
00103
00104
00108 class wxRecipientsIterator
00109 {
00110 public:
00116 wxRecipientsIterator(const wxEmailMessage& emailMessage);
00117
00123 bool HasNext();
00124
00129 wxString GetNext();
00130
00131 private:
00132 const wxEmailMessage& m_emailMessage;
00133 size_t m_rcptCount;
00134 size_t m_toCount;
00135 size_t m_ccCount;
00136 size_t m_bccCount;
00137
00138 };
00139
00140
00141 #endif