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 ;
75 enum class AddressStyle
87 AddressStyle address_style {AddressStyle::Ascii} ;
98 virtual std::unique_ptr<StoredMessage>
next() = 0 ;
108 virtual std::unique_ptr<NewMessage>
newMessage(
const std::string & from ,
109 const SmtpInfo & smtp_info ,
const std::string & from_auth_out ) = 0 ;
118 virtual std::unique_ptr<StoredMessage>
get(
const MessageId &
id ) = 0 ;
122 virtual std::unique_ptr<Iterator>
iterator(
bool lock ) = 0 ;
130 virtual std::vector<MessageId>
ids() = 0 ;
163 std::unique_ptr<StoredMessage> operator++( std::shared_ptr<MessageStore::Iterator> & iter ) ;
A somewhat opaque identifer for a GStore::MessageStore message id.
static MessageId none()
Returns an in-valid() id.
bool valid() const
Returns true if valid.
std::string str() const
Returns the id string.
MessageId(const std::string &)
Constructor.
A class which allows SMTP messages to be stored and retrieved.
virtual std::unique_ptr< Iterator > iterator(bool lock)=0
Returns an iterator for stored messages.
virtual void unfailAll()=0
Unfails all failed messages.
virtual void rescan()=0
Requests that a messageStoreRescanSignal() is emitted.
virtual std::unique_ptr< NewMessage > newMessage(const std::string &from, const SmtpInfo &smtp_info, const std::string &from_auth_out)=0
Creates a new message.
virtual std::vector< MessageId > ids()=0
Returns a list of spooled message ids (excluding new or locked messages).
virtual ~MessageStore()=default
Destructor.
virtual std::vector< MessageId > failures()=0
Returns a list of failed message ids.
static AddressStyle addressStyle(std::string_view address)
Parses an address to determine whether it has ASCII or UTF-8 parts.
virtual G::Slot::Signal & messageStoreRescanSignal() noexcept=0
Provides a signal which is emitted when rescan() is called.
virtual G::Slot::Signal & messageStoreUpdateSignal() noexcept=0
Provides a signal which is emitted when something might have changed in the store.
virtual std::unique_ptr< StoredMessage > get(const MessageId &id)=0
Pulls the specified message out of the store.
virtual bool empty() const =0
Returns true if the message store is empty.
virtual void updated()=0
Called by associated classes to indicate that the store has changed.
virtual std::string location(const MessageId &) const =0
Returns the location of the given message.
A base class for GStore::MessageStore iterators.
virtual ~Iterator()=default
Destructor.
virtual std::unique_ptr< StoredMessage > next()=0
Returns the next stored message or a null pointer.
Information on the SMTP options used when submitted.
A slot holder, with connect() and emit() methods.