00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AKONADI_KMIME_MESSAGESTATUS_H
00023 #define AKONADI_KMIME_MESSAGESTATUS_H
00024
00025 #include <QtCore/QSet>
00026
00027 #include "akonadi-kmime_export.h"
00028
00029 class QString;
00030
00031 namespace Akonadi {
00032
00033
00051 class AKONADI_KMIME_EXPORT MessageStatus
00052 {
00053 public:
00055 MessageStatus();
00056
00061 MessageStatus &operator = ( const MessageStatus &other );
00062
00066 bool operator == ( const MessageStatus &other ) const;
00067
00071 bool operator != ( const MessageStatus &other ) const;
00072
00077 bool operator & ( const MessageStatus &other ) const;
00078
00080 void clear();
00081
00088 void set( const MessageStatus &other );
00089
00094 void toggle( const MessageStatus &other );
00095
00096
00097
00101 bool isOfUnknownStatus() const;
00102
00106 bool isRead() const;
00107
00111 bool isDeleted() const;
00112
00116 bool isReplied() const;
00117
00121 bool isForwarded() const;
00122
00126 bool isQueued() const;
00127
00131 bool isSent() const;
00132
00136 bool isImportant() const;
00137
00141 bool isWatched() const;
00142
00146 bool isIgnored() const;
00147
00151 bool isToAct() const;
00152
00156 bool isSpam() const;
00157
00161 bool isHam() const;
00162
00166 bool hasAttachment() const;
00167
00171 bool hasInvitation() const;
00172
00176 bool isSigned() const;
00177
00181 bool isEncrypted() const;
00182
00186 bool hasError() const;
00187
00188
00189
00191 void setRead( bool read = true );
00192
00196 void setDeleted( bool deleted = true );
00197
00201 void setReplied( bool replied = true );
00202
00206 void setForwarded( bool forwarded = true );
00207
00211 void setQueued( bool queued = true );
00212
00216 void setSent( bool sent = true );
00217
00221 void setImportant( bool important = true );
00222
00226 void setWatched( bool watched = true );
00227
00231 void setIgnored( bool ignored = true );
00232
00236 void setToAct( bool toAct = true );
00237
00241 void setSpam( bool spam = true );
00242
00246 void setHam( bool ham = true );
00247
00251 void setHasAttachment( bool hasAttachment = true );
00252
00256 void setHasInvitation( bool hasInvitation = true );
00257
00261 void setSigned( bool value = true );
00262
00266 void setEncrypted( bool value = true );
00267
00271 void setHasError( bool value = true );
00272
00273
00274
00280 qint32 toQInt32() const;
00281
00287 void fromQInt32( qint32 status );
00288
00295 QString statusStr() const;
00296
00304 void setStatusFromStr( const QString &aStr );
00305
00309 QSet<QByteArray> statusFlags() const;
00310
00314 void setStatusFromFlags( const QSet<QByteArray> &flags );
00315
00316
00317
00321 static const MessageStatus statusUnread();
00322
00327 static const MessageStatus statusRead();
00328
00333 static const MessageStatus statusDeleted();
00334
00339 static const MessageStatus statusReplied();
00340
00345 static const MessageStatus statusForwarded();
00346
00351 static const MessageStatus statusQueued();
00352
00357 static const MessageStatus statusSent();
00358
00363 static const MessageStatus statusImportant();
00364
00369 static const MessageStatus statusWatched();
00370
00375 static const MessageStatus statusIgnored();
00376
00381 static const MessageStatus statusToAct();
00382
00387 static const MessageStatus statusSpam();
00388
00393 static const MessageStatus statusHam();
00394
00399 static const MessageStatus statusHasAttachment();
00400
00405 static const MessageStatus statusHasInvitation();
00406
00411 static const MessageStatus statusSigned();
00412
00417 static const MessageStatus statusEncrypted();
00418
00423 static const MessageStatus statusHasError();
00424
00425 private:
00426 quint32 mStatus;
00427 };
00428
00429 }
00430
00431 #endif