21#ifndef G_SMTP_MESSAGE_STORE_H
22#define G_SMTP_MESSAGE_STORE_H
45 explicit MessageId(
const std::string & ) ;
54 std::string
str()
const ;
77 virtual std::unique_ptr<StoredMessage>
next() = 0 ;
91 virtual std::unique_ptr<NewMessage>
newMessage(
const std::string & from ,
92 const std::string & from_auth_in ,
const std::string & from_auth_out ) = 0 ;
95 virtual bool empty()
const = 0 ;
108 virtual std::shared_ptr<Iterator>
iterator(
bool lock ) = 0 ;
148 std::unique_ptr<StoredMessage> operator++( std::shared_ptr<MessageStore::Iterator> & iter ) ;
A somewhat opaque identifer for a MessageStore message.
static MessageId none()
Returns an in-valid() id.
bool valid() const
Returns true if valid.
MessageId(const std::string &)
Constructor.
std::string str() const
Returns the id string.
A class which allows SMTP messages to be stored and retrieved.
virtual void rescan()=0
Requests that a messageStoreRescanSignal() is emitted.
virtual bool empty() const =0
Returns true if the message store is empty.
virtual std::shared_ptr< Iterator > failures()=0
Returns an iterator for failed messages.
static G::Path defaultDirectory()
Returns a default spool directory, such as "/var/spool/emailrelay".
virtual G::Slot::Signal & messageStoreUpdateSignal()=0
Provides a signal which is when something might have changed in the store.
virtual void updated()=0
Called by associated classes to indicate that the store has changed.
virtual std::unique_ptr< StoredMessage > get(const MessageId &)=0
Pulls the specified message out of the store.
virtual void unfailAll()=0
Causes messages marked as failed to be unmarked.
virtual std::string location(const MessageId &) const =0
Returns the location of the given message.
virtual G::Slot::Signal & messageStoreRescanSignal()=0
Provides a signal which is emitted when rescan() is called.
virtual std::unique_ptr< NewMessage > newMessage(const std::string &from, const std::string &from_auth_in, const std::string &from_auth_out)=0
Creates a new message.
virtual std::shared_ptr< Iterator > iterator(bool lock)=0
Returns an iterator for stored messages.
virtual ~MessageStore()=default
Destructor.
A Path object represents a file system path.
SMTP and message-store classes.
A base class for GSmtp::MessageStore iterators.
virtual std::unique_ptr< StoredMessage > next()=0
Returns the next stored message or a null pointer.
virtual ~Iterator()=default
Destructor.
A slot holder, with connect() and emit() methods.