]> git.saurik.com Git - wxWidgets.git/blame - contrib/include/wx/net/msg.h
Adds a title to the chart, patch 1242262 Matthew D.P.
[wxWidgets.git] / contrib / include / wx / net / msg.h
CommitLineData
decb3a6a
JS
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
decb3a6a
JS
12#ifndef _WX_MSG_H_
13#define _WX_MSG_H_
14
15e8daec
VS
15#ifdef WXMAKINGDLL_NETUTILS
16 #define WXDLLIMPEXP_NETUTILS WXEXPORT
17 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXEXPORT type
18#elif defined(WXUSINGDLL)
19 #define WXDLLIMPEXP_NETUTILS WXIMPORT
20 #define WXDLLIMPEXP_DATA_NETUTILS(type) WXIMPORT type
21#else // not making nor using DLL
22 #define WXDLLIMPEXP_NETUTILS
23 #define WXDLLIMPEXP_DATA_NETUTILS(type) type
24#endif
25
26
decb3a6a
JS
27/*
28 * wxMailMessage
29 * Encapsulates an email message
30 */
31
15e8daec 32class WXDLLIMPEXP_NETUTILS wxMailMessage
decb3a6a
JS
33{
34public:
35
36 // A common usage
37 wxMailMessage(const wxString& subject, const wxString& to,
a23c0047
JS
38 const wxString& body, const wxString& from = wxEmptyString,
39 const wxString& attachment = wxEmptyString,
decb3a6a
JS
40 const wxString& attachmentTitle = wxEmptyString)
41 {
42 m_to.Add(to);
43 m_subject = subject;
44 m_body = body;
a23c0047 45 m_from = from;
decb3a6a
JS
46 if (!attachment.IsEmpty())
47 {
48 m_attachments.Add(attachment);
49 m_attachmentTitles.Add(attachmentTitle);
50 }
51 }
52
53 wxMailMessage() {};
54
55//// Accessors
56
57 void AddTo(const wxString& to) { m_to.Add(to); }
58 void AddCc(const wxString& cc) { m_cc.Add(cc); }
59 void AddBcc(const wxString& bcc) { m_bcc.Add(bcc); }
60 void AddAttachment(const wxString& attach, const wxString& title = wxEmptyString)
61 { m_attachments.Add(attach); m_attachmentTitles.Add(title); }
62
63 void SetSubject(const wxString& subject) { m_subject = subject; }
64 void SetBody(const wxString& body) { m_body = body; }
a23c0047 65 void SetFrom(const wxString& from) { m_from = from; }
decb3a6a
JS
66
67public:
68 wxArrayString m_to; //The To: Recipients
a23c0047 69 wxString m_from; //The From: email address (optional)
decb3a6a
JS
70 wxArrayString m_cc; //The CC: Recipients
71 wxArrayString m_bcc; //The BCC Recipients
72 wxString m_subject; //The Subject of the message
73 wxString m_body; //The Body of the message
74 wxArrayString m_attachments; //Files to attach to the email
75 wxArrayString m_attachmentTitles; //Titles to use for the email file attachments
76};
77
78#endif // _WX_MSG_H_
79