KDE 4.9 PyKDE API Reference

- KDE's Python API

# MessageStatus Class Reference

`from PyKDE4.akonadi import *`

Namespace: Akonadi

## Detailed Description

Akonadi KMime Message Status.

Author:
  Andreas Gungl <a.gungl@gmx.de>

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.

## Methods

| __init__ (self)
| clear (self)
| fromQInt32 (self, int status)
bool | hasAttachment (self)
bool | hasError (self)
bool | hasInvitation (self)
bool | isDeleted (self)
bool | isEncrypted (self)
bool | isForwarded (self)
bool | isHam (self)
bool | isIgnored (self)
bool | isImportant (self)
bool | isOfUnknownStatus (self)
bool | isQueued (self)
bool | isRead (self)
bool | isReplied (self)
bool | isSent (self)
bool | isSigned (self)
bool | isSpam (self)
bool | isToAct (self)
bool | isWatched (self)
bool | operator != (self, Akonadi.MessageStatus other)
bool | operator & (self, Akonadi.MessageStatus other)
bool | operator == (self, Akonadi.MessageStatus other)
| set (self, Akonadi.MessageStatus other)
| setDeleted (self, bool deleted=1)
| setEncrypted (self, bool value=1)
| setForwarded (self, bool forwarded=1)
| setHam (self, bool ham=1)
| setHasAttachment (self, bool hasAttachment=1)
| setHasError (self, bool value=1)
| setHasInvitation (self, bool hasInvitation=1)
| setIgnored (self, bool ignored=1)
| setImportant (self, bool important=1)
| setQueued (self, bool queued=1)
| setRead (self, bool read=1)
| setReplied (self, bool replied=1)
| setSent (self, bool sent=1)
| setSigned (self, bool value=1)
| setSpam (self, bool spam=1)
| setStatusFromFlags (self, QSet<QByteArray> flags)
| setStatusFromStr (self, QString aStr)
| setToAct (self, bool toAct=1)
| setWatched (self, bool watched=1)
QSet<QByteArray> | statusFlags (self)
QString | statusStr (self)
int | toQInt32 (self)
| toggle (self, Akonadi.MessageStatus other)

## Static Methods

Akonadi.MessageStatus | statusDeleted ()
Akonadi.MessageStatus | statusEncrypted ()
Akonadi.MessageStatus | statusForwarded ()
Akonadi.MessageStatus | statusHam ()
Akonadi.MessageStatus | statusHasAttachment ()
Akonadi.MessageStatus | statusHasError ()
Akonadi.MessageStatus | statusHasInvitation ()
Akonadi.MessageStatus | statusIgnored ()
Akonadi.MessageStatus | statusImportant ()
Akonadi.MessageStatus | statusQueued ()
Akonadi.MessageStatus | statusRead ()
Akonadi.MessageStatus | statusReplied ()
Akonadi.MessageStatus | statusSent ()
Akonadi.MessageStatus | statusSigned ()
Akonadi.MessageStatus | statusSpam ()
Akonadi.MessageStatus | statusToAct ()
Akonadi.MessageStatus | statusUnread ()
Akonadi.MessageStatus | statusWatched ()

## Method Documentation

__init__ | ( |  | self ) |

Constructor - sets status initially to unknown.

clear | ( |  | self ) |

Clear all status flags, this resets to unknown.

fromQInt32 | ( | self, |
|  | int | 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.

bool hasAttachment | ( |  | self ) |

Check for Attachment status.

Returns:
  true if status indicates an attachment.

bool hasError | ( |  | self ) |

Check for error status.

Returns:
  true if status indicates an error.

bool hasInvitation | ( |  | self ) |

Check for Invitation status.

Returns:
  true if status indicates an invitation.

bool isDeleted | ( |  | self ) |

Check for Deleted status.

Returns:
  true if status is deleted.

bool isEncrypted | ( |  | self ) |

Check for Encrypted status.

Returns:
  true if status is encrypted.

bool isForwarded | ( |  | self ) |

Check for Forwarded status.

Returns:
  true if status is forwarded.

bool isHam | ( |  | self ) |

Check for Ham status.

Returns:
  true if status is not spam.

bool isIgnored | ( |  | self ) |

Check for Ignored status.

Returns:
  true if status is ignored.

bool isImportant | ( |  | self ) |

Check for Important status.

Returns:
  true if status is important.

bool isOfUnknownStatus | ( |  | self ) |

Check for Unknown status.

Returns:
  true if status is unknown.

bool isQueued | ( |  | self ) |

Check for Queued status.

Returns:
  true if status is queued.

bool isRead | ( |  | self ) |

Check for Read status. Note that ignored messages are read.

Returns:
  true if status is read.

bool isReplied | ( |  | self ) |

Check for Replied status.

Returns:
  true if status is replied.

bool isSent | ( |  | self ) |

Check for Sent status.

Returns:
  true if status is sent.

bool isSigned | ( |  | self ) |

Check for Signed status.

Returns:
  true if status is signed.

bool isSpam | ( |  | self ) |

Check for Spam status.

Returns:
  true if status is spam.

bool isToAct | ( |  | self ) |

Check for ToAct status.

Returns:
  true if status is action item.

bool isWatched | ( |  | self ) |

Check for Watched status.

Returns:
  true if status is watched.

bool operator != | ( | self, |
|  | Akonadi.MessageStatus | other
| ) |  |  |

Compare the status with that from another instance.

Returns:
  true if the stati are equal, false if different.

bool operator & | ( | self, |
|  | Akonadi.MessageStatus | other
| ) |  |  |

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.

bool operator == | ( | self, |
|  | Akonadi.MessageStatus | other
| ) |  |  |

Compare the status with that from another instance.

Returns:
  true if the stati are equal, false if different.

set | ( | self, |
|  | Akonadi.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.

setDeleted | ( | self, |
|  | bool | deleted=1
| ) |  |  |

Set the status for deleted.

Parameters:

  | deleted | Set (true) or unset (false) this status flag.

setEncrypted | ( | self, |
|  | bool | value=1
| ) |  |  |

Set the status to encrypted.

Parameters:

  | value | Set (true) or unset (false) this status flag.

setForwarded | ( | self, |
|  | bool | forwarded=1
| ) |  |  |

Set the status for forwarded.

Parameters:

  | forwarded | Set (true) or unset (false) this status flag.

setHam | ( | self, |
|  | bool | ham=1
| ) |  |  |

Set the status to not spam.

Parameters:

  | ham | Set (true) or unset (false) this status flag.

setHasAttachment | ( | self, |
|  | bool | hasAttachment=1
| ) |  |  |

Set the status for an attachment.

Parameters:

  | hasAttachment | Set (true) or unset (false) this status flag.

setHasError | ( | self, |
|  | bool | value=1
| ) |  |  |

Set the status to error.

Parameters:

  | value | Set (true) or unset (false) this status flag.

setHasInvitation | ( | self, |
|  | bool | hasInvitation=1
| ) |  |  |

Set the status for an invitation.

Parameters:

  | hasInvitation | Set (true) or unset (false) this status flag.

setIgnored | ( | self, |
|  | bool | ignored=1
| ) |  |  |

Set the status to ignored.

Parameters:

  | ignored | Set (true) or unset (false) this status flag.

setImportant | ( | self, |
|  | bool | important=1
| ) |  |  |

Set the status for important.

Parameters:

  | important | Set (true) or unset (false) this status flag.

setQueued | ( | self, |
|  | bool | queued=1
| ) |  |  |

Set the status for queued.

Parameters:

  | queued | Set (true) or unset (false) this status flag.

setRead | ( | self, |
|  | bool | read=1
| ) |  |  |

Set the status to read.

setReplied | ( | self, |
|  | bool | replied=1
| ) |  |  |

Set the status for replied.

Parameters:

  | replied | Set (true) or unset (false) this status flag.

setSent | ( | self, |
|  | bool | sent=1
| ) |  |  |

Set the status for sent.

Parameters:

  | sent | Set (true) or unset (false) this status flag.

setSigned | ( | self, |
|  | bool | value=1
| ) |  |  |

Set the status to signed.

Parameters:

  | value | Set (true) or unset (false) this status flag.

setSpam | ( | self, |
|  | bool | spam=1
| ) |  |  |

Set the status to spam.

Parameters:

  | spam | Set (true) or unset (false) this status flag.

setStatusFromFlags | ( | self, |
|  | QSet<QByteArray> | flags
| ) |  |  |

Set the status as a whole e.g. for reading from IMAP flags.

Parameters:

  | status | The status encoded in bits to be set in this instance.

setStatusFromStr | ( | self, |
|  | 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

setToAct | ( | self, |
|  | bool | toAct=1
| ) |  |  |

Set the status to action item.

Parameters:

  | toAct | Set (true) or unset (false) this status flag.

setWatched | ( | self, |
|  | bool | watched=1
| ) |  |  |

Set the status to watched.

Parameters:

  | watched | Set (true) or unset (false) this status flag.

QSet<QByteArray> statusFlags | ( |  | self ) |

Get the status as a whole e.g. for storage as IMAP flags.

Returns:
  The status encoded in flags.

QString statusStr | ( |  | self ) |

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

int toQInt32 | ( |  | self ) |

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.

toggle | ( | self, |
|  | Akonadi.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.

## Static Method Documentation

Akonadi.MessageStatus statusDeleted | ( |  | ) |

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.

Akonadi.MessageStatus statusEncrypted | ( |  | ) |

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.

Akonadi.MessageStatus statusForwarded | ( |  | ) |

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.

Akonadi.MessageStatus statusHam | ( |  | ) |

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.

Akonadi.MessageStatus statusHasAttachment | ( |  | ) |

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.

Akonadi.MessageStatus statusHasError | ( |  | ) |

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.

Akonadi.MessageStatus statusHasInvitation | ( |  | ) |

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.

Akonadi.MessageStatus statusIgnored | ( |  | ) |

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.

Akonadi.MessageStatus statusImportant | ( |  | ) |

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.

Akonadi.MessageStatus statusQueued | ( |  | ) |

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.

Akonadi.MessageStatus statusRead | ( |  | ) |

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.

Akonadi.MessageStatus statusReplied | ( |  | ) |

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.

Akonadi.MessageStatus statusSent | ( |  | ) |

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.

Akonadi.MessageStatus statusSigned | ( |  | ) |

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.

Akonadi.MessageStatus statusSpam | ( |  | ) |

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.

Akonadi.MessageStatus statusToAct | ( |  | ) |

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.

Akonadi.MessageStatus statusUnread | ( |  | ) |

Return a special status that expresses Unread. This status can only be used for comparison with other states.

Akonadi.MessageStatus statusWatched | ( |  | ) |

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.