KIMAP::IdleJob Class
Idles the connection to the IMAP server. More...
| Header: | #include <KIMAP/IdleJob> |
| CMake: | find_package(KPim6IMAP REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::IMAP) |
| Inherits: | KIMAP::Job |
Public Functions
| IdleJob(KIMAP::Session *session) | |
| virtual | ~IdleJob() override |
| QString | lastMailBox() const |
| int | lastMessageCount() const |
| int | lastRecentCount() const |
Public Slots
| void | stop() |
Signals
| void | mailBoxMessageFlagsChanged(KIMAP::IdleJob *job, qint64 uid) |
| void | mailBoxStats(KIMAP::IdleJob *job, const QString &mailBox, int messageCount, int recentCount) |
Detailed Description
This job can be run while the client has no other use for the connection, and the server will send updates about the selected mailbox.
Note that although the server may send a variety of responses while the job is running (including EXPUNGE, for example), only RECENT and EXISTS responses are actually reported by this job.
The job also processes updates in pairs - if the server sends an EXISTS update but not a RECENT one (because another client is changing the mailbox contents), this job will not report the update.
It only makes sense to run this job when the session is in the selected state.
This job requires that the server supports the IDLE capability, defined in RFC 2177.
Member Function Documentation
[explicit] IdleJob::IdleJob(KIMAP::Session *session)
[override virtual noexcept] IdleJob::~IdleJob()
QString IdleJob::lastMailBox() const
The last mailbox status that was reported.
This is just the session's selected mailbox.
int IdleJob::lastMessageCount() const
The last message count that was reported.
The server will send updates about the number of messages in the mailbox when that number changes. This is the last number it reported.
Returns the last message count the server reported, or -1 if it has not reported a message count since the job started.
int IdleJob::lastRecentCount() const
The last recent message count that was reported.
The server will send updates about the number of messages in the mailbox that are tagged with Recent when that number changes. This is the last number it reported.
Returns the last recent message count the server reported, or -1 if it has not reported a recent message count since the job started.
[signal] void IdleJob::mailBoxMessageFlagsChanged(KIMAP::IdleJob *job, qint64 uid)
Signals that the server has notified that the some messages flags have changed
job this object
uid UID of message that has changed
[signal] void IdleJob::mailBoxStats(KIMAP::IdleJob *job, const QString &mailBox, int messageCount, int recentCount)
Signals that the server has notified that the total and recent message counts have changed.
job this object
mailBox the selected mailbox
messageCount the new total message count reported by the server
recentCount the new "recent message" count reported by the server
[slot] void IdleJob::stop()
Stops the idle job.