]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/net/msg.h
Applied patch [ 875663 ] Warning free mmedia contrib
[wxWidgets.git] / contrib / include / wx / net / msg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msg.h
3 // Purpose: wxMailMessage
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 2001-08-21
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma interface "msg.h"
14 #endif
15
16 #ifndef _WX_MSG_H_
17 #define _WX_MSG_H_
18
19 #ifdef WXMAKINGDLL_NETUTILS
20 #define WXDLLIMPEXP_NETUTILS WXEXPORT
21 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXEXPORT type
22 #elif defined(WXUSINGDLL)
23 #define WXDLLIMPEXP_NETUTILS WXIMPORT
24 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXIMPORT type
25 #else // not making nor using DLL
26 #define WXDLLIMPEXP_NETUTILS
27 #define WXDLLIMPEXP_DATA_NETUTILS(type) type
28 #endif
29
30
31 /*
32 * wxMailMessage
33 * Encapsulates an email message
34 */
35
36 class WXDLLIMPEXP_NETUTILS wxMailMessage
37 {
38 public:
39
40 // A common usage
41 wxMailMessage(const wxString& subject, const wxString& to,
42 const wxString& body, const wxString& from = wxEmptyString,
43 const wxString& attachment = wxEmptyString,
44 const wxString& attachmentTitle = wxEmptyString)
45 {
46 m_to.Add(to);
47 m_subject = subject;
48 m_body = body;
49 m_from = from;
50 if (!attachment.IsEmpty())
51 {
52 m_attachments.Add(attachment);
53 m_attachmentTitles.Add(attachmentTitle);
54 }
55 }
56
57 wxMailMessage() {};
58
59 //// Accessors
60
61 void AddTo(const wxString& to) { m_to.Add(to); }
62 void AddCc(const wxString& cc) { m_cc.Add(cc); }
63 void AddBcc(const wxString& bcc) { m_bcc.Add(bcc); }
64 void AddAttachment(const wxString& attach, const wxString& title = wxEmptyString)
65 { m_attachments.Add(attach); m_attachmentTitles.Add(title); }
66
67 void SetSubject(const wxString& subject) { m_subject = subject; }
68 void SetBody(const wxString& body) { m_body = body; }
69 void SetFrom(const wxString& from) { m_from = from; }
70
71 public:
72 wxArrayString m_to; //The To: Recipients
73 wxString m_from; //The From: email address (optional)
74 wxArrayString m_cc; //The CC: Recipients
75 wxArrayString m_bcc; //The BCC Recipients
76 wxString m_subject; //The Subject of the message
77 wxString m_body; //The Body of the message
78 wxArrayString m_attachments; //Files to attach to the email
79 wxArrayString m_attachmentTitles; //Titles to use for the email file attachments
80 };
81
82 #endif // _WX_MSG_H_
83