gnewmessage.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
20 
21 #ifndef G_SMTP_NEW_MESSAGE_H
22 #define G_SMTP_NEW_MESSAGE_H
23 
24 #include "gdef.h"
25 #include "gsmtp.h"
26 
28 namespace GSmtp
29 {
30  class NewMessage ;
31  class MessageStoreImp ;
32 }
33 
40 {
41 public:
42  virtual void addTo( const std::string & to , bool local ) = 0 ;
44 
45  virtual bool addText( const std::string & line ) = 0 ;
47 
48  virtual std::string prepare( const std::string & auth_id , const std::string & peer_socket_address ,
49  const std::string & peer_socket_name , const std::string & peer_certificate ) = 0 ;
52 
53  virtual void commit() = 0 ;
55 
56  virtual unsigned long id() const = 0 ;
58 
59  virtual ~NewMessage() ;
62 
63 private:
64  void operator=( const NewMessage & ) ; // not implemented
65 } ;
66 
67 #endif
68 
SMTP and message-store classes.
virtual std::string prepare(const std::string &auth_id, const std::string &peer_socket_address, const std::string &peer_socket_name, const std::string &peer_certificate)=0
Prepares to store the message in the message store.
virtual ~NewMessage()
Destructor.
Definition: gnewmessage.cpp:27
virtual void addTo(const std::string &to, bool local)=0
Adds a 'to' address.
virtual bool addText(const std::string &line)=0
Adds a line of content. Returns false on overflow.
An abstract class to allow the creation of a new message in the message store.
Definition: gnewmessage.h:39
virtual void commit()=0
Commits the prepare()d message to the store.
virtual unsigned long id() const =0
Returns the message's unique non-zero identifier.