]> git.saurik.com Git - wxWidgets.git/blame - contrib/include/wx/net/msg.h
Misc warning fixes by ABX
[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
ab7ce33c 12#if defined(__GNUG__) && !defined(__APPLE__)
decb3a6a
JS
13#pragma interface "msg.h"
14#endif
15
16#ifndef _WX_MSG_H_
17#define _WX_MSG_H_
18
15e8daec
VS
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
decb3a6a
JS
31/*
32 * wxMailMessage
33 * Encapsulates an email message
34 */
35
15e8daec 36class WXDLLIMPEXP_NETUTILS wxMailMessage
decb3a6a
JS
37{
38public:
39
40 // A common usage
41 wxMailMessage(const wxString& subject, const wxString& to,
a23c0047
JS
42 const wxString& body, const wxString& from = wxEmptyString,
43 const wxString& attachment = wxEmptyString,
decb3a6a
JS
44 const wxString& attachmentTitle = wxEmptyString)
45 {
46 m_to.Add(to);
47 m_subject = subject;
48 m_body = body;
a23c0047 49 m_from = from;
decb3a6a
JS
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; }
a23c0047 69 void SetFrom(const wxString& from) { m_from = from; }
decb3a6a
JS
70
71public:
72 wxArrayString m_to; //The To: Recipients
a23c0047 73 wxString m_from; //The From: email address (optional)
decb3a6a
JS
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