akonadi
#include <messagestatus.h>
Public Member Functions | |
MessageStatus () | |
void | clear () |
void | fromQInt32 (qint32 status) |
bool | hasAttachment () const |
bool | hasError () const |
bool | hasInvitation () const |
bool | isDeleted () const |
bool | isEncrypted () const |
bool | isForwarded () const |
bool | isHam () const |
bool | isIgnored () const |
bool | isImportant () const |
bool | isOfUnknownStatus () const |
bool | isQueued () const |
bool | isRead () const |
bool | isReplied () const |
bool | isSent () const |
bool | isSigned () const |
bool | isSpam () const |
bool | isToAct () const |
bool | isWatched () const |
bool | operator!= (const MessageStatus &other) const |
bool | operator& (const MessageStatus &other) const |
MessageStatus & | operator= (const MessageStatus &other) |
bool | operator== (const MessageStatus &other) const |
void | set (const MessageStatus &other) |
void | setDeleted (bool deleted=true) |
void | setEncrypted (bool value=true) |
void | setForwarded (bool forwarded=true) |
void | setHam (bool ham=true) |
void | setHasAttachment (bool hasAttachment=true) |
void | setHasError (bool value=true) |
void | setHasInvitation (bool hasInvitation=true) |
void | setIgnored (bool ignored=true) |
void | setImportant (bool important=true) |
void | setQueued (bool queued=true) |
void | setRead (bool read=true) |
void | setReplied (bool replied=true) |
void | setSent (bool sent=true) |
void | setSigned (bool value=true) |
void | setSpam (bool spam=true) |
void | setStatusFromFlags (const QSet< QByteArray > &flags) |
void | setStatusFromStr (const QString &aStr) |
void | setToAct (bool toAct=true) |
void | setWatched (bool watched=true) |
QSet< QByteArray > | statusFlags () const |
QString | statusStr () const |
void | toggle (const MessageStatus &other) |
qint32 | toQInt32 () const |
Static Public Member Functions | |
static const MessageStatus | statusDeleted () |
static const MessageStatus | statusEncrypted () |
static const MessageStatus | statusForwarded () |
static const MessageStatus | statusHam () |
static const MessageStatus | statusHasAttachment () |
static const MessageStatus | statusHasError () |
static const MessageStatus | statusHasInvitation () |
static const MessageStatus | statusIgnored () |
static const MessageStatus | statusImportant () |
static const MessageStatus | statusQueued () |
static const MessageStatus | statusRead () |
static const MessageStatus | statusReplied () |
static const MessageStatus | statusSent () |
static const MessageStatus | statusSigned () |
static const MessageStatus | statusSpam () |
static const MessageStatus | statusToAct () |
static const MessageStatus | statusUnread () |
static const MessageStatus | statusWatched () |
Detailed Description
Akonadi KMime Message Status.
The class encapsulates the handling of the different flags which describe the status of a message. The flags themselves are not intended to be used outside this class.
In the status pairs Watched/Ignored and Spam/Ham, there both values can't be set at the same time, however they can be unset at the same time.
Note that this class does not sync with the Akonadi storage. It is used as an in-memory helper when manipulating Akonadi items.
- Since
- 4.6.
Definition at line 51 of file messagestatus.h.
Constructor & Destructor Documentation
Akonadi::MessageStatus::MessageStatus | ( | ) |
Constructor - sets status initially to unknown.
Definition at line 59 of file messagestatus.cpp.
Member Function Documentation
void Akonadi::MessageStatus::clear | ( | ) |
Clear all status flags, this resets to unknown.
Definition at line 93 of file messagestatus.cpp.
void Akonadi::MessageStatus::fromQInt32 | ( | qint32 | status | ) |
Set the status as a whole e.g.
for reading from an index. Don't manipulte the index via this value, this bypasses all integrity checks in the setter methods.
- Parameters
-
status The status encoded in bits to be set in this instance.
Definition at line 469 of file messagestatus.cpp.
bool Akonadi::MessageStatus::hasAttachment | ( | ) | const |
Check for Attachment status.
- Returns
- true if status indicates an attachment.
Definition at line 279 of file messagestatus.cpp.
bool Akonadi::MessageStatus::hasError | ( | ) | const |
Check for error status.
- Returns
- true if status indicates an error.
Definition at line 299 of file messagestatus.cpp.
bool Akonadi::MessageStatus::hasInvitation | ( | ) | const |
Check for Invitation status.
- Returns
- true if status indicates an invitation.
Definition at line 284 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isDeleted | ( | ) | const |
Check for Deleted status.
- Returns
- true if status is deleted.
Definition at line 224 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isEncrypted | ( | ) | const |
Check for Encrypted status.
- Returns
- true if status is encrypted.
Definition at line 294 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isForwarded | ( | ) | const |
Check for Forwarded status.
- Returns
- true if status is forwarded.
Definition at line 234 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isHam | ( | ) | const |
Check for Ham status.
- Returns
- true if status is not spam.
Definition at line 274 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isIgnored | ( | ) | const |
Check for Ignored status.
- Returns
- true if status is ignored.
Definition at line 259 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isImportant | ( | ) | const |
Check for Important status.
- Returns
- true if status is important.
Definition at line 249 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isOfUnknownStatus | ( | ) | const |
Check for Unknown status.
- Returns
- true if status is unknown.
Definition at line 214 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isQueued | ( | ) | const |
Check for Queued status.
- Returns
- true if status is queued.
Definition at line 239 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isRead | ( | ) | const |
Check for Read status.
Note that ignored messages are read.
- Returns
- true if status is read.
Definition at line 219 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isReplied | ( | ) | const |
Check for Replied status.
- Returns
- true if status is replied.
Definition at line 229 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isSent | ( | ) | const |
Check for Sent status.
- Returns
- true if status is sent.
Definition at line 244 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isSigned | ( | ) | const |
Check for Signed status.
- Returns
- true if status is signed.
Definition at line 289 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isSpam | ( | ) | const |
Check for Spam status.
- Returns
- true if status is spam.
Definition at line 269 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isToAct | ( | ) | const |
Check for ToAct status.
- Returns
- true if status is action item.
Definition at line 264 of file messagestatus.cpp.
bool Akonadi::MessageStatus::isWatched | ( | ) | const |
Check for Watched status.
- Returns
- true if status is watched.
Definition at line 254 of file messagestatus.cpp.
bool Akonadi::MessageStatus::operator!= | ( | const MessageStatus & | other | ) | const |
Compare the status with that from another instance.
- Returns
- true if the stati are equal, false if different.
- Parameters
-
other message status to compare with current object
Definition at line 75 of file messagestatus.cpp.
bool Akonadi::MessageStatus::operator& | ( | const MessageStatus & | other | ) | const |
Check, if some of the flags in the status match with those flags from another instance.
- Returns
- true if at least one flag is set in both stati.
- Parameters
-
other message status to compare objects' flags
Definition at line 80 of file messagestatus.cpp.
Akonadi::MessageStatus & Akonadi::MessageStatus::operator= | ( | const MessageStatus & | other | ) |
Assign the status from another instance.
The internal representation is identical afterwards, i.e. a comparison by operator == will return true.
- Parameters
-
other message status to copy from
Definition at line 64 of file messagestatus.cpp.
bool Akonadi::MessageStatus::operator== | ( | const MessageStatus & | other | ) | const |
Compare the status with that from another instance.
- Returns
- true if the stati are equal, false if different.
- Parameters
-
other message status to compare with current object
Definition at line 70 of file messagestatus.cpp.
void Akonadi::MessageStatus::set | ( | const MessageStatus & | other | ) |
Set / add stati described by another MessageStatus object.
This can be used to merge in multiple stati at once without using the single setter methods. However, internally the setters are used anyway to ensure the integrity of the resulting status.
- Parameters
-
other message status to set
Definition at line 98 of file messagestatus.cpp.
void Akonadi::MessageStatus::setDeleted | ( | bool | deleted = true | ) |
Set the status for deleted.
- Parameters
-
deleted Set (true) or unset (false) this status flag.
Definition at line 313 of file messagestatus.cpp.
void Akonadi::MessageStatus::setEncrypted | ( | bool | value = true | ) |
Set the status to encrypted.
- Parameters
-
value Set (true) or unset (false) this status flag.
Definition at line 446 of file messagestatus.cpp.
void Akonadi::MessageStatus::setForwarded | ( | bool | forwarded = true | ) |
Set the status for forwarded.
- Parameters
-
forwarded Set (true) or unset (false) this status flag.
Definition at line 331 of file messagestatus.cpp.
void Akonadi::MessageStatus::setHam | ( | bool | ham = true | ) |
Set the status to not spam.
- Parameters
-
ham Set (true) or unset (false) this status flag.
Definition at line 409 of file messagestatus.cpp.
void Akonadi::MessageStatus::setHasAttachment | ( | bool | hasAttachment = true | ) |
Set the status for an attachment.
- Parameters
-
hasAttachment Set (true) or unset (false) this status flag.
Definition at line 419 of file messagestatus.cpp.
void Akonadi::MessageStatus::setHasError | ( | bool | value = true | ) |
Set the status to error.
- Parameters
-
value Set (true) or unset (false) this status flag.
Definition at line 455 of file messagestatus.cpp.
void Akonadi::MessageStatus::setHasInvitation | ( | bool | hasInvitation = true | ) |
Set the status for an invitation.
- Parameters
-
hasInvitation Set (true) or unset (false) this status flag.
Definition at line 428 of file messagestatus.cpp.
void Akonadi::MessageStatus::setIgnored | ( | bool | ignored = true | ) |
Set the status to ignored.
- Parameters
-
ignored Set (true) or unset (false) this status flag.
Definition at line 379 of file messagestatus.cpp.
void Akonadi::MessageStatus::setImportant | ( | bool | important = true | ) |
Set the status for important.
- Parameters
-
important Set (true) or unset (false) this status flag.
Definition at line 359 of file messagestatus.cpp.
void Akonadi::MessageStatus::setQueued | ( | bool | queued = true | ) |
Set the status for queued.
- Parameters
-
queued Set (true) or unset (false) this status flag.
Definition at line 340 of file messagestatus.cpp.
void Akonadi::MessageStatus::setRead | ( | bool | read = true | ) |
Set the status to read.
- Parameters
-
read new read status
Definition at line 304 of file messagestatus.cpp.
void Akonadi::MessageStatus::setReplied | ( | bool | replied = true | ) |
Set the status for replied.
- Parameters
-
replied Set (true) or unset (false) this status flag.
Definition at line 322 of file messagestatus.cpp.
void Akonadi::MessageStatus::setSent | ( | bool | sent = true | ) |
Set the status for sent.
- Parameters
-
sent Set (true) or unset (false) this status flag.
Definition at line 349 of file messagestatus.cpp.
void Akonadi::MessageStatus::setSigned | ( | bool | value = true | ) |
Set the status to signed.
- Parameters
-
value Set (true) or unset (false) this status flag.
Definition at line 437 of file messagestatus.cpp.
void Akonadi::MessageStatus::setSpam | ( | bool | spam = true | ) |
Set the status to spam.
- Parameters
-
spam Set (true) or unset (false) this status flag.
Definition at line 399 of file messagestatus.cpp.
void Akonadi::MessageStatus::setStatusFromFlags | ( | const QSet< QByteArray > & | flags | ) |
Set the status as a whole e.g.
for reading from IMAP flags.
- Parameters
-
flags set of flags for status as a whole
Definition at line 638 of file messagestatus.cpp.
void Akonadi::MessageStatus::setStatusFromStr | ( | const QString & | aStr | ) |
Set the status based on a string representation.
- Parameters
-
aStr The status string to be analyzed. Normally it is a string obtained using getStatusStr().
- Note
- This code is legacy for the KMail1 indexes
Definition at line 522 of file messagestatus.cpp.
void Akonadi::MessageStatus::setToAct | ( | bool | toAct = true | ) |
Set the status to action item.
- Parameters
-
toAct Set (true) or unset (false) this status flag.
Definition at line 389 of file messagestatus.cpp.
void Akonadi::MessageStatus::setWatched | ( | bool | watched = true | ) |
Set the status to watched.
- Parameters
-
watched Set (true) or unset (false) this status flag.
Definition at line 369 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Deleted as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Deleted.
Definition at line 700 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Encrypted as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Encrypted.
Definition at line 798 of file messagestatus.cpp.
QSet< QByteArray > Akonadi::MessageStatus::statusFlags | ( | ) | const |
Get the status as a whole e.g.
for storage as IMAP flags.
- Returns
- The status encoded in flags.
Definition at line 573 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Forwarded as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Forwarded.
Definition at line 714 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Ham as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Ham.
Definition at line 770 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Attachment as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Attachment.
Definition at line 777 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Error as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Error.
Definition at line 805 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Invitation as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Invitation.
Definition at line 784 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Ignored as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Ignored.
Definition at line 749 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Important as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Important.
Definition at line 735 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Queued as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Queued.
Definition at line 721 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Read as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Read.
Definition at line 693 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Replied as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Replied.
Definition at line 707 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Sent as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Sent.
Definition at line 728 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Signed as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Signed.
Definition at line 791 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Spam as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Spam.
Definition at line 763 of file messagestatus.cpp.
QString Akonadi::MessageStatus::statusStr | ( | ) | const |
Convert the status to a string representation.
- Returns
- A string containing coded uppercase letters which describe the status.
- Note
- This code is legacy for the KMail1 indexes
Definition at line 474 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Action Item as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as ToAct.
Definition at line 756 of file messagestatus.cpp.
|
static |
Return a special status that expresses Unread.
This status can only be used for comparison with other states.
Definition at line 686 of file messagestatus.cpp.
|
static |
Return a predefined status initialized as Watched as is useful e.g.
when providing a state for comparison.
- Returns
- A reference to a status instance initialized as Watched.
Definition at line 742 of file messagestatus.cpp.
void Akonadi::MessageStatus::toggle | ( | const MessageStatus & | other | ) |
Toggle one or more stati described by another MessageStatus object.
Internally the setters are used to ensure the integrity of the resulting status.
- Parameters
-
other message status to toggle
Definition at line 159 of file messagestatus.cpp.
qint32 Akonadi::MessageStatus::toQInt32 | ( | ) | const |
Get the status as a whole e.g.
for storage in an index. D on't manipulte the *index via this value, this bypasses all integrity checks in the setter methods.
- Returns
- The status encoded in bits.
Definition at line 464 of file messagestatus.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.