Akonadi::TransportResourceBase Class
| Header: | #include <Akonadi/TransportResourceBase> |
| CMake: | find_package(KPim6 REQUIRED COMPONENTS AkonadiAgentBase)target_link_libraries(mytarget PRIVATE KPim6::AkonadiAgentBase) |
Public Types
| enum | TransportResult { TransportSucceeded, TransportFailed } |
Public Functions
| TransportResourceBase() | |
| virtual | ~TransportResourceBase() |
| void | itemSent(const Akonadi::Item &item, Akonadi::TransportResourceBase::TransportResult result, const QString &message = QString()) |
| virtual void | sendItem(const Akonadi::Item &item) = 0 |
Detailed Description
* * * * * \short Resource implementing mail transport capability. * * This class allows a resource to provide mail transport (i.e. sending * mail). A resource than can provide mail transport inherits from both * ResourceBase and TransportResourceBase, implements the virtual method * sendItem(), and calls itemSent() when finished sending. * * The resource must also have the "MailTransport" capability flag. For example * the desktop file may contain:
X-Akonadi-Capabilities=Resource,MailTransport
* * For an example of a transport-enabled resource, see * kdepim/runtime/resources/mailtransport_dummy * * Author: Constantin Berzan <exit3219@gmail.com> *
Member Type Documentation
enum TransportResourceBase::TransportResult
Describes the result of the transport process.
Member Function Documentation
TransportResourceBase::TransportResourceBase()
Creates a new transport resource base.
[virtual noexcept] TransportResourceBase::~TransportResourceBase()
Destroys the transport resource base.
void TransportResourceBase::itemSent(const Akonadi::Item &item, Akonadi::TransportResourceBase::TransportResult result, const QString &message = QString())
This method marks the sending of the passed \p item as finished.
item The item that was sent. result The result that indicates whether the sending was successful or not. message An optional text explanation of the result. \see Transport.
[pure virtual] void TransportResourceBase::sendItem(const Akonadi::Item &item)
This method is called when the given \p item shall be send. When the sending is done or an error occurred during sending, call itemSent() with the appropriate result flag.
item The message item to be send. \see itemSent().