• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 API Reference
  • KDE Home
  • Contact Us
 

akonadi/kmime

  • akonadi
  • kmime
messagestatus.cpp
1 /*
2  This file is part of Akonadi.
3  Copyright (c) 2003 Andreas Gungl <a.gungl@gmx.de>
4  Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5  Copyright (c) 2010 Leo Franchi <lfranchi@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to the
19  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #include "messagestatus.h"
24 
25 #include "messageflags.h"
26 
27 #include <KDE/KDebug>
28 
29 #include <QtCore/QString>
30 
37 enum Status {
38  StatusUnknown = 0x00000000,
39  StatusUnread = 0x00000002, // deprecated
40  StatusRead = 0x00000004,
41  StatusDeleted = 0x00000010,
42  StatusReplied = 0x00000020,
43  StatusForwarded = 0x00000040,
44  StatusQueued = 0x00000080,
45  StatusSent = 0x00000100,
46  StatusFlag = 0x00000200, // flag means important
47  StatusWatched = 0x00000400,
48  StatusIgnored = 0x00000800, // forces isRead()
49  StatusToAct = 0x00001000,
50  StatusSpam = 0x00002000,
51  StatusHam = 0x00004000,
52  StatusHasAttachment = 0x00008000,
53  StatusHasInvitation = 0x00010000,
54  StatusSigned = 0x00020000,
55  StatusEncrypted = 0x00040000,
56  StatusHasError = 0x00080000
57 };
58 
59 Akonadi::MessageStatus::MessageStatus()
60 {
61  mStatus = StatusUnknown;
62 }
63 
64 Akonadi::MessageStatus &Akonadi::MessageStatus::operator = ( const Akonadi::MessageStatus &other )
65 {
66  mStatus = other.mStatus;
67  return *this;
68 }
69 
70 bool Akonadi::MessageStatus::operator == ( const Akonadi::MessageStatus &other ) const
71 {
72  return ( mStatus == other.mStatus );
73 }
74 
75 bool Akonadi::MessageStatus::operator != ( const Akonadi::MessageStatus &other ) const
76 {
77  return ( mStatus != other.mStatus );
78 }
79 
80 bool Akonadi::MessageStatus::operator & ( const Akonadi::MessageStatus &other ) const
81 {
82  if ( mStatus == StatusUnread )
83  return !(other.mStatus & StatusRead);
84 
85  if ( other.mStatus == StatusUnread )
86  return !(mStatus & StatusRead);
87 
88  return ( mStatus & other.mStatus );
89 }
90 
91 void Akonadi::MessageStatus::clear()
92 {
93  mStatus = StatusUnknown;
94 }
95 
96 void Akonadi::MessageStatus::set( const Akonadi::MessageStatus &other )
97 {
98  Q_ASSERT( !(other.mStatus & StatusUnread) );
99 
100  // Those stati are exclusive, but we have to lock at the
101  // internal representation because Ignored can manipulate
102  // the result of the getter methods.
103  if ( other.mStatus & StatusRead ) {
104  setRead();
105  }
106  if ( other.isDeleted() ) {
107  setDeleted();
108  }
109  if ( other.isReplied() ) {
110  setReplied();
111  }
112  if ( other.isForwarded() ) {
113  setForwarded();
114  }
115  if ( other.isQueued() ) {
116  setQueued();
117  }
118  if ( other.isSent() ) {
119  setSent();
120  }
121  if ( other.isImportant() ) {
122  setImportant();
123  }
124 
125  if ( other.isWatched() ) {
126  setWatched();
127  }
128  if ( other.isIgnored() ) {
129  setIgnored();
130  }
131  if ( other.isToAct() ) {
132  setToAct();
133  }
134  if ( other.isSpam() ) {
135  setSpam();
136  }
137  if ( other.isHam() ) {
138  setHam();
139  }
140  if ( other.hasAttachment() ) {
141  setHasAttachment();
142  }
143  if ( other.hasInvitation() ) {
144  setHasInvitation();
145  }
146  if ( other.isSigned() ) {
147  setSigned();
148  }
149  if ( other.isEncrypted() ) {
150  setEncrypted();
151  }
152  if ( other.hasError() ) {
153  setHasError();
154  }
155 }
156 
157 void Akonadi::MessageStatus::toggle( const Akonadi::MessageStatus &other )
158 {
159  Q_ASSERT( !(other.mStatus & StatusUnread) );
160 
161  if ( other.isDeleted() ) {
162  setDeleted( !( mStatus & StatusDeleted ) );
163  }
164  if ( other.isReplied() ) {
165  setReplied( !( mStatus & StatusReplied ) );
166  }
167  if ( other.isForwarded() ) {
168  setForwarded( !( mStatus & StatusForwarded ) );
169  }
170  if ( other.isQueued() ) {
171  setQueued( !( mStatus & StatusQueued ) );
172  }
173  if ( other.isSent() ) {
174  setSent( !( mStatus & StatusSent ) );
175  }
176  if ( other.isImportant() ) {
177  setImportant( !( mStatus & StatusFlag ) );
178  }
179 
180  if ( other.isWatched() ) {
181  setWatched( !( mStatus & StatusWatched ) );
182  }
183  if ( other.isIgnored() ) {
184  setIgnored( !( mStatus & StatusIgnored ) );
185  }
186  if ( other.isToAct() ) {
187  setToAct( !( mStatus & StatusToAct ) );
188  }
189  if ( other.isSpam() ) {
190  setSpam( !( mStatus & StatusSpam ) );
191  }
192  if ( other.isHam() ) {
193  setHam( !( mStatus & StatusHam ) );
194  }
195  if ( other.hasAttachment() ) {
196  setHasAttachment( !( mStatus & StatusHasAttachment ) );
197  }
198  if ( other.hasInvitation() ) {
199  setHasInvitation( !( mStatus & StatusHasInvitation ) );
200  }
201  if ( other.isSigned() ) {
202  setSigned( !( mStatus & StatusSigned ) );
203  }
204  if ( other.isEncrypted() ) {
205  setEncrypted( !( mStatus & StatusEncrypted ) );
206  }
207  if ( other.hasError() ) {
208  setHasError( !( mStatus & StatusHasError ) );
209  }
210 }
211 
212 bool Akonadi::MessageStatus::isOfUnknownStatus() const
213 {
214  return ( mStatus == StatusUnknown );
215 }
216 
217 bool Akonadi::MessageStatus::isRead() const
218 {
219  return ( (mStatus & StatusRead) || (mStatus & StatusIgnored) );
220 }
221 
222 bool Akonadi::MessageStatus::isDeleted() const
223 {
224  return ( mStatus & StatusDeleted );
225 }
226 
227 bool Akonadi::MessageStatus::isReplied() const
228 {
229  return ( mStatus & StatusReplied );
230 }
231 
232 bool Akonadi::MessageStatus::isForwarded() const
233 {
234  return ( mStatus & StatusForwarded );
235 }
236 
237 bool Akonadi::MessageStatus::isQueued() const
238 {
239  return ( mStatus & StatusQueued );
240 }
241 
242 bool Akonadi::MessageStatus::isSent() const
243 {
244  return ( mStatus & StatusSent );
245 }
246 
247 bool Akonadi::MessageStatus::isImportant() const
248 {
249  return ( mStatus & StatusFlag );
250 }
251 
252 bool Akonadi::MessageStatus::isWatched() const
253 {
254  return ( mStatus & StatusWatched );
255 }
256 
257 bool Akonadi::MessageStatus::isIgnored() const
258 {
259  return ( mStatus & StatusIgnored );
260 }
261 
262 bool Akonadi::MessageStatus::isToAct() const
263 {
264  return ( mStatus & StatusToAct );
265 }
266 
267 bool Akonadi::MessageStatus::isSpam() const
268 {
269  return ( mStatus & StatusSpam );
270 }
271 
272 bool Akonadi::MessageStatus::isHam() const
273 {
274  return ( mStatus & StatusHam );
275 }
276 
277 bool Akonadi::MessageStatus::hasAttachment() const
278 {
279  return ( mStatus & StatusHasAttachment );
280 }
281 
282 bool Akonadi::MessageStatus::hasInvitation() const
283 {
284  return ( mStatus & StatusHasInvitation );
285 }
286 
287 bool Akonadi::MessageStatus::isSigned() const
288 {
289  return ( mStatus & StatusSigned );
290 }
291 
292 bool Akonadi::MessageStatus::isEncrypted() const
293 {
294  return ( mStatus & StatusEncrypted );
295 }
296 
297 bool Akonadi::MessageStatus::hasError() const
298 {
299  return ( mStatus & StatusHasError );
300 }
301 
302 
303 void Akonadi::MessageStatus::setRead( bool read )
304 {
305  if ( read ) {
306  mStatus |= StatusRead;
307  } else {
308  mStatus &= ~StatusRead;
309  }
310 }
311 
312 void Akonadi::MessageStatus::setDeleted( bool deleted )
313 {
314  if ( deleted ) {
315  mStatus |= StatusDeleted;
316  } else {
317  mStatus &= ~StatusDeleted;
318  }
319 }
320 
321 void Akonadi::MessageStatus::setReplied( bool replied )
322 {
323  if ( replied ) {
324  mStatus |= StatusReplied;
325  } else {
326  mStatus &= ~StatusReplied;
327  }
328 }
329 
330 void Akonadi::MessageStatus::setForwarded( bool forwarded )
331 {
332  if ( forwarded ) {
333  mStatus |= StatusForwarded;
334  } else {
335  mStatus &= ~StatusForwarded;
336  }
337 }
338 
339 void Akonadi::MessageStatus::setQueued( bool queued )
340 {
341  if ( queued ) {
342  mStatus |= StatusQueued;
343  } else {
344  mStatus &= ~StatusQueued;
345  }
346 }
347 
348 void Akonadi::MessageStatus::setSent( bool sent )
349 {
350  if ( sent ) {
351  mStatus &= ~StatusQueued;
352  mStatus |= StatusSent;
353  } else {
354  mStatus &= ~StatusSent;
355  }
356 }
357 
358 void Akonadi::MessageStatus::setImportant( bool important )
359 {
360  if ( important ) {
361  mStatus |= StatusFlag;
362  } else {
363  mStatus &= ~StatusFlag;
364  }
365 }
366 
367 // Watched and ignored are mutually exclusive
368 void Akonadi::MessageStatus::setWatched( bool watched )
369 {
370  if ( watched ) {
371  mStatus &= ~StatusIgnored;
372  mStatus |= StatusWatched;
373  } else {
374  mStatus &= ~StatusWatched;
375  }
376 }
377 
378 void Akonadi::MessageStatus::setIgnored( bool ignored )
379 {
380  if ( ignored ) {
381  mStatus &= ~StatusWatched;
382  mStatus |= StatusIgnored;
383  } else {
384  mStatus &= ~StatusIgnored;
385  }
386 }
387 
388 void Akonadi::MessageStatus::setToAct( bool toAct )
389 {
390  if ( toAct ) {
391  mStatus |= StatusToAct;
392  } else {
393  mStatus &= ~StatusToAct;
394  }
395 }
396 
397 // Ham and Spam are mutually exclusive
398 void Akonadi::MessageStatus::setSpam( bool spam )
399 {
400  if ( spam ) {
401  mStatus &= ~StatusHam;
402  mStatus |= StatusSpam;
403  } else {
404  mStatus &= ~StatusSpam;
405  }
406 }
407 
408 void Akonadi::MessageStatus::setHam( bool ham )
409 {
410  if ( ham ) {
411  mStatus &= ~StatusSpam;
412  mStatus |= StatusHam;
413  } else {
414  mStatus &= ~StatusHam;
415  }
416 }
417 
418 void Akonadi::MessageStatus::setHasAttachment( bool withAttachment )
419 {
420  if ( withAttachment ) {
421  mStatus |= StatusHasAttachment;
422  } else {
423  mStatus &= ~StatusHasAttachment;
424  }
425 }
426 
427 void Akonadi::MessageStatus::setHasInvitation( bool withInvitation )
428 {
429  if ( withInvitation ) {
430  mStatus |= StatusHasInvitation;
431  } else {
432  mStatus &= ~StatusHasInvitation;
433  }
434 }
435 
436 void Akonadi::MessageStatus::setSigned( bool value )
437 {
438  if ( value ) {
439  mStatus |= StatusSigned;
440  } else {
441  mStatus &= ~StatusSigned;
442  }
443 }
444 
445 void Akonadi::MessageStatus::setEncrypted( bool value )
446 {
447  if ( value ) {
448  mStatus |= StatusEncrypted;
449  } else {
450  mStatus &= ~StatusEncrypted;
451  }
452 }
453 
454 void Akonadi::MessageStatus::setHasError( bool hasError )
455 {
456  if ( hasError ) {
457  mStatus |= StatusHasError;
458  } else {
459  mStatus &= ~StatusHasError;
460  }
461 }
462 
463 qint32 Akonadi::MessageStatus::toQInt32() const
464 {
465  return mStatus;
466 }
467 
468 
469 void Akonadi::MessageStatus::fromQInt32( qint32 status )
470 {
471  mStatus = status;
472 }
473 
474 QString Akonadi::MessageStatus::statusStr() const
475 {
476  QByteArray sstr;
477  if ( mStatus & StatusRead ) {
478  sstr += 'R';
479  } else {
480  sstr += 'U';
481  }
482  if ( mStatus & StatusDeleted ) {
483  sstr += 'D';
484  }
485  if ( mStatus & StatusReplied ) {
486  sstr += 'A';
487  }
488  if ( mStatus & StatusForwarded ) {
489  sstr += 'F';
490  }
491  if ( mStatus & StatusQueued ) {
492  sstr += 'Q';
493  }
494  if ( mStatus & StatusToAct ) {
495  sstr += 'K';
496  }
497  if ( mStatus & StatusSent ) {
498  sstr += 'S';
499  }
500  if ( mStatus & StatusFlag ) {
501  sstr += 'G';
502  }
503  if ( mStatus & StatusWatched ) {
504  sstr += 'W';
505  }
506  if ( mStatus & StatusIgnored ) {
507  sstr += 'I';
508  }
509  if ( mStatus & StatusSpam ) {
510  sstr += 'P';
511  }
512  if ( mStatus & StatusHam ) {
513  sstr += 'H';
514  }
515  if ( mStatus & StatusHasAttachment ) {
516  sstr += 'T';
517  }
518 
519  return QLatin1String( sstr );
520 }
521 
522 void Akonadi::MessageStatus::setStatusFromStr( const QString& aStr )
523 {
524  mStatus = StatusUnknown;
525 
526  if ( aStr.contains( QLatin1Char( 'U' ) ) ) {
527  setRead( false );
528  }
529  if ( aStr.contains( QLatin1Char( 'R' ) ) ) {
530  setRead();
531  }
532  if ( aStr.contains( QLatin1Char( 'D' ) ) ) {
533  setDeleted();
534  }
535  if ( aStr.contains( QLatin1Char( 'A' ) ) ) {
536  setReplied();
537  }
538  if ( aStr.contains( QLatin1Char( 'F' ) ) ) {
539  setForwarded();
540  }
541  if ( aStr.contains( QLatin1Char( 'Q' ) ) ) {
542  setQueued();
543  }
544  if ( aStr.contains( QLatin1Char( 'K' ) ) ) {
545  setToAct();
546  }
547  if ( aStr.contains( QLatin1Char( 'S' ) ) ) {
548  setSent();
549  }
550  if ( aStr.contains( QLatin1Char( 'G' ) ) ) {
551  setImportant();
552  }
553  if ( aStr.contains( QLatin1Char( 'W' ) ) ) {
554  setWatched();
555  }
556  if ( aStr.contains( QLatin1Char( 'I' ) ) ) {
557  setIgnored();
558  }
559  if ( aStr.contains( QLatin1Char( 'P' ) ) ) {
560  setSpam();
561  }
562  if ( aStr.contains( QLatin1Char( 'H' ) ) ) {
563  setHam();
564  }
565  if ( aStr.contains( QLatin1Char( 'T' ) ) ) {
566  setHasAttachment();
567  }
568  if ( aStr.contains( QLatin1Char( 'C' ) ) ) {
569  setHasAttachment( false );
570  }
571 }
572 
573 QSet<QByteArray> Akonadi::MessageStatus::statusFlags() const
574 {
575  QSet<QByteArray> flags;
576 
577  if ( mStatus & StatusDeleted ) {
578  flags += Akonadi::MessageFlags::Deleted;
579  } else {
580  if ( mStatus & StatusRead )
581  flags += Akonadi::MessageFlags::Seen;
582  if ( mStatus & StatusReplied )
583  flags += Akonadi::MessageFlags::Answered;
584  if ( mStatus & StatusFlag )
585  flags += Akonadi::MessageFlags::Flagged;
586 
587  // non standard flags
588  if ( mStatus & StatusSent )
589  flags += Akonadi::MessageFlags::Sent;
590  if ( mStatus & StatusQueued )
591  flags += Akonadi::MessageFlags::Queued;
592  if ( mStatus & StatusReplied )
593  flags += Akonadi::MessageFlags::Replied;
594  if ( mStatus & StatusForwarded )
595  flags += Akonadi::MessageFlags::Forwarded;
596  if ( mStatus & StatusToAct )
597  flags += Akonadi::MessageFlags::ToAct;
598  if ( mStatus & StatusWatched )
599  flags += Akonadi::MessageFlags::Watched;
600  if ( mStatus & StatusIgnored )
601  flags += Akonadi::MessageFlags::Ignored;
602  if ( mStatus & StatusHasAttachment )
603  flags += Akonadi::MessageFlags::HasAttachment;
604  if ( mStatus & StatusHasInvitation )
605  flags += Akonadi::MessageFlags::HasInvitation;
606  if ( mStatus & StatusSigned )
607  flags += Akonadi::MessageFlags::Signed;
608  if ( mStatus & StatusEncrypted )
609  flags += Akonadi::MessageFlags::Encrypted;
610  if ( mStatus & StatusSpam )
611  flags += Akonadi::MessageFlags::Spam;
612  if ( mStatus & StatusHam )
613  flags += Akonadi::MessageFlags::Ham;
614  if ( mStatus & StatusHasError )
615  flags += Akonadi::MessageFlags::HasError;
616  }
617 
618  return flags;
619 }
620 
621 void Akonadi::MessageStatus::setStatusFromFlags( const QSet<QByteArray> &flags )
622 {
623  mStatus = StatusUnknown;
624 
625  foreach ( const QByteArray &flag, flags ) {
626  const QByteArray &upperedFlag = flag.toUpper();
627  if ( upperedFlag == Akonadi::MessageFlags::Deleted ) {
628  setDeleted();
629  } else if ( upperedFlag == Akonadi::MessageFlags::Seen ) {
630  setRead();
631  } else if ( upperedFlag == Akonadi::MessageFlags::Answered ) {
632  setReplied();
633  } else if ( upperedFlag == Akonadi::MessageFlags::Flagged ) {
634  setImportant();
635 
636  // non standard flags
637  } else if ( upperedFlag == Akonadi::MessageFlags::Sent ) {
638  setSent();
639  } else if ( upperedFlag == Akonadi::MessageFlags::Queued ) {
640  setQueued();
641  } else if ( upperedFlag == Akonadi::MessageFlags::Replied ) {
642  setReplied();
643  } else if ( upperedFlag == Akonadi::MessageFlags::Forwarded ) {
644  setForwarded();
645  } else if ( upperedFlag == Akonadi::MessageFlags::ToAct ) {
646  setToAct();
647  } else if ( upperedFlag == Akonadi::MessageFlags::Watched ) {
648  setWatched();
649  } else if ( upperedFlag == Akonadi::MessageFlags::Ignored ) {
650  setIgnored();
651  } else if ( upperedFlag == Akonadi::MessageFlags::HasAttachment ) {
652  setHasAttachment();
653  } else if ( upperedFlag == Akonadi::MessageFlags::HasInvitation ) {
654  setHasInvitation();
655  } else if ( upperedFlag == Akonadi::MessageFlags::Signed ) {
656  setSigned();
657  } else if ( upperedFlag == Akonadi::MessageFlags::Encrypted ) {
658  setEncrypted();
659  } else if ( upperedFlag == Akonadi::MessageFlags::Spam ) {
660  setSpam();
661  } else if ( upperedFlag == Akonadi::MessageFlags::Ham ) {
662  setHam();
663  } else if ( upperedFlag == Akonadi::MessageFlags::HasError ) {
664  setHasError();
665  }
666  }
667 }
668 
669 const Akonadi::MessageStatus Akonadi::MessageStatus::statusUnread()
670 {
671  Akonadi::MessageStatus st;
672  st.mStatus = StatusUnread;
673  return st;
674 }
675 
676 const Akonadi::MessageStatus Akonadi::MessageStatus::statusRead()
677 {
678  Akonadi::MessageStatus st;
679  st.setRead();
680  return st;
681 }
682 
683 const Akonadi::MessageStatus Akonadi::MessageStatus::statusDeleted()
684 {
685  Akonadi::MessageStatus st;
686  st.setDeleted();
687  return st;
688 }
689 
690 const Akonadi::MessageStatus Akonadi::MessageStatus::statusReplied()
691 {
692  Akonadi::MessageStatus st;
693  st.setReplied();
694  return st;
695 }
696 
697 const Akonadi::MessageStatus Akonadi::MessageStatus::statusForwarded()
698 {
699  Akonadi::MessageStatus st;
700  st.setForwarded();
701  return st;
702 }
703 
704 const Akonadi::MessageStatus Akonadi::MessageStatus::statusQueued()
705 {
706  Akonadi::MessageStatus st;
707  st.setQueued();
708  return st;
709 }
710 
711 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSent()
712 {
713  Akonadi::MessageStatus st;
714  st.setSent();
715  return st;
716 }
717 
718 const Akonadi::MessageStatus Akonadi::MessageStatus::statusImportant()
719 {
720  Akonadi::MessageStatus st;
721  st.setImportant();
722  return st;
723 }
724 
725 const Akonadi::MessageStatus Akonadi::MessageStatus::statusWatched()
726 {
727  Akonadi::MessageStatus st;
728  st.setWatched();
729  return st;
730 }
731 
732 const Akonadi::MessageStatus Akonadi::MessageStatus::statusIgnored()
733 {
734  Akonadi::MessageStatus st;
735  st.setIgnored();
736  return st;
737 }
738 
739 const Akonadi::MessageStatus Akonadi::MessageStatus::statusToAct()
740 {
741  Akonadi::MessageStatus st;
742  st.setToAct();
743  return st;
744 }
745 
746 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSpam()
747 {
748  Akonadi::MessageStatus st;
749  st.setSpam();
750  return st;
751 }
752 
753 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHam()
754 {
755  Akonadi::MessageStatus st;
756  st.setHam();
757  return st;
758 }
759 
760 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasAttachment()
761 {
762  Akonadi::MessageStatus st;
763  st.setHasAttachment();
764  return st;
765 }
766 
767 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasInvitation()
768 {
769  MessageStatus st;
770  st.setHasInvitation();
771  return st;
772 }
773 
774 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSigned()
775 {
776  MessageStatus st;
777  st.setSigned();
778  return st;
779 }
780 
781 const Akonadi::MessageStatus Akonadi::MessageStatus::statusEncrypted()
782 {
783  MessageStatus st;
784  st.setEncrypted();
785  return st;
786 }
787 
788 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasError()
789 {
790  MessageStatus st;
791  st.setHasError();
792  return st;
793 }
Akonadi::MessageStatus::operator&
bool operator&(const MessageStatus &other) const
Check, if some of the flags in the status match with those flags from another instance.
Definition: messagestatus.cpp:80
Akonadi::MessageStatus::isOfUnknownStatus
bool isOfUnknownStatus() const
Check for Unknown status.
Definition: messagestatus.cpp:212
Akonadi::MessageStatus::isReplied
bool isReplied() const
Check for Replied status.
Definition: messagestatus.cpp:227
Akonadi::MessageStatus::hasError
bool hasError() const
Check for error status.
Definition: messagestatus.cpp:297
Akonadi::MessageStatus::statusEncrypted
static const MessageStatus statusEncrypted()
Return a predefined status initialized as Encrypted as is useful e.g.
Definition: messagestatus.cpp:781
Akonadi::MessageStatus::isHam
bool isHam() const
Check for Ham status.
Definition: messagestatus.cpp:272
Akonadi::MessageStatus::statusIgnored
static const MessageStatus statusIgnored()
Return a predefined status initialized as Ignored as is useful e.g.
Definition: messagestatus.cpp:732
Akonadi::MessageStatus::setRead
void setRead(bool read=true)
Set the status to read.
Definition: messagestatus.cpp:303
Akonadi::MessageFlags::Signed
AKONADI_KMIME_EXPORT const char * Signed
The flag for a message being marked as signed.
Definition: messageflags.cpp:37
Akonadi::MessageFlags::HasInvitation
AKONADI_KMIME_EXPORT const char * HasInvitation
The flag for a message being marked as having an invitation.
Definition: messageflags.cpp:29
Akonadi::MessageStatus::statusWatched
static const MessageStatus statusWatched()
Return a predefined status initialized as Watched as is useful e.g.
Definition: messagestatus.cpp:725
Akonadi::MessageFlags::Seen
AKONADI_KMIME_EXPORT const char * Seen
The flag for a message being seen (i.e.
Definition: messageflags.cpp:23
Akonadi::MessageStatus::setWatched
void setWatched(bool watched=true)
Set the status to watched.
Definition: messagestatus.cpp:368
Akonadi::MessageStatus::statusHasAttachment
static const MessageStatus statusHasAttachment()
Return a predefined status initialized as Attachment as is useful e.g.
Definition: messagestatus.cpp:760
Akonadi::MessageStatus::setHasInvitation
void setHasInvitation(bool hasInvitation=true)
Set the status for an invitation.
Definition: messagestatus.cpp:427
Akonadi::MessageStatus::toQInt32
qint32 toQInt32() const
Get the status as a whole e.g.
Definition: messagestatus.cpp:463
Akonadi::MessageStatus::isSpam
bool isSpam() const
Check for Spam status.
Definition: messagestatus.cpp:267
Akonadi::MessageStatus::isSigned
bool isSigned() const
Check for Signed status.
Definition: messagestatus.cpp:287
Akonadi::MessageStatus::setSpam
void setSpam(bool spam=true)
Set the status to spam.
Definition: messagestatus.cpp:398
Akonadi::MessageFlags::Encrypted
AKONADI_KMIME_EXPORT const char * Encrypted
The flag for a message being marked as encrypted.
Definition: messageflags.cpp:38
Akonadi::MessageStatus::setToAct
void setToAct(bool toAct=true)
Set the status to action item.
Definition: messagestatus.cpp:388
Akonadi::MessageStatus::fromQInt32
void fromQInt32(qint32 status)
Set the status as a whole e.g.
Definition: messagestatus.cpp:469
Akonadi::MessageStatus::isSent
bool isSent() const
Check for Sent status.
Definition: messagestatus.cpp:242
Akonadi::MessageStatus::statusFlags
QSet< QByteArray > statusFlags() const
Get the status as a whole e.g.
Definition: messagestatus.cpp:573
Akonadi::MessageStatus::isQueued
bool isQueued() const
Check for Queued status.
Definition: messagestatus.cpp:237
Akonadi::MessageStatus::statusToAct
static const MessageStatus statusToAct()
Return a predefined status initialized as Action Item as is useful e.g.
Definition: messagestatus.cpp:739
Akonadi::MessageStatus::hasInvitation
bool hasInvitation() const
Check for Invitation status.
Definition: messagestatus.cpp:282
Akonadi::MessageStatus::operator!=
bool operator!=(const MessageStatus &other) const
Compare the status with that from another instance.
Definition: messagestatus.cpp:75
Akonadi::MessageFlags::Flagged
AKONADI_KMIME_EXPORT const char * Flagged
The flag for a message being marked as flagged.
Definition: messageflags.cpp:26
Akonadi::MessageStatus::setImportant
void setImportant(bool important=true)
Set the status for important.
Definition: messagestatus.cpp:358
Akonadi::MessageStatus::statusUnread
static const MessageStatus statusUnread()
Return a special status that expresses Unread.
Definition: messagestatus.cpp:669
Akonadi::MessageStatus::isIgnored
bool isIgnored() const
Check for Ignored status.
Definition: messagestatus.cpp:257
Akonadi::MessageFlags::Deleted
AKONADI_KMIME_EXPORT const char * Deleted
The flag for a message being deleted by the user.
Definition: messageflags.cpp:24
Akonadi::MessageFlags::Answered
AKONADI_KMIME_EXPORT const char * Answered
The flag for a message being replied to by the user.
Definition: messageflags.cpp:25
Akonadi::MessageStatus::operator=
MessageStatus & operator=(const MessageStatus &other)
Assign the status from another instance.
Definition: messagestatus.cpp:64
Akonadi::MessageStatus::clear
void clear()
Clear all status flags, this resets to unknown.
Definition: messagestatus.cpp:91
Akonadi::MessageStatus::setHam
void setHam(bool ham=true)
Set the status to not spam.
Definition: messagestatus.cpp:408
Akonadi::MessageStatus::setStatusFromFlags
void setStatusFromFlags(const QSet< QByteArray > &flags)
Set the status as a whole e.g.
Definition: messagestatus.cpp:621
Akonadi::MessageStatus::MessageStatus
MessageStatus()
Constructor - sets status initially to unknown.
Definition: messagestatus.cpp:59
Akonadi::MessageFlags::HasError
AKONADI_KMIME_EXPORT const char * HasError
The flag for a message being marked with an error.
Definition: messageflags.cpp:27
Akonadi::MessageFlags::Ham
AKONADI_KMIME_EXPORT const char * Ham
The flag for a message being marked as ham.
Definition: messageflags.cpp:40
Akonadi::MessageStatus::statusHasError
static const MessageStatus statusHasError()
Return a predefined status initialized as Error as is useful e.g.
Definition: messagestatus.cpp:788
Akonadi::MessageStatus::statusRead
static const MessageStatus statusRead()
Return a predefined status initialized as Read as is useful e.g.
Definition: messagestatus.cpp:676
Akonadi::MessageStatus::statusSent
static const MessageStatus statusSent()
Return a predefined status initialized as Sent as is useful e.g.
Definition: messagestatus.cpp:711
Akonadi::MessageStatus::statusSigned
static const MessageStatus statusSigned()
Return a predefined status initialized as Signed as is useful e.g.
Definition: messagestatus.cpp:774
Akonadi::MessageStatus::statusImportant
static const MessageStatus statusImportant()
Return a predefined status initialized as Important as is useful e.g.
Definition: messagestatus.cpp:718
Akonadi::MessageStatus::isToAct
bool isToAct() const
Check for ToAct status.
Definition: messagestatus.cpp:262
Akonadi::MessageStatus::setReplied
void setReplied(bool replied=true)
Set the status for replied.
Definition: messagestatus.cpp:321
Akonadi::MessageFlags::HasAttachment
AKONADI_KMIME_EXPORT const char * HasAttachment
The flag for a message being marked as having an attachment.
Definition: messageflags.cpp:28
Akonadi::MessageStatus::setSent
void setSent(bool sent=true)
Set the status for sent.
Definition: messagestatus.cpp:348
Akonadi::MessageStatus::statusForwarded
static const MessageStatus statusForwarded()
Return a predefined status initialized as Forwarded as is useful e.g.
Definition: messagestatus.cpp:697
Akonadi::MessageStatus::toggle
void toggle(const MessageStatus &other)
Toggle one or more stati described by another MessageStatus object.
Definition: messagestatus.cpp:157
Akonadi::MessageStatus::statusHam
static const MessageStatus statusHam()
Return a predefined status initialized as Ham as is useful e.g.
Definition: messagestatus.cpp:753
Akonadi::MessageStatus::isWatched
bool isWatched() const
Check for Watched status.
Definition: messagestatus.cpp:252
Akonadi::MessageStatus::setQueued
void setQueued(bool queued=true)
Set the status for queued.
Definition: messagestatus.cpp:339
Akonadi::MessageStatus::statusDeleted
static const MessageStatus statusDeleted()
Return a predefined status initialized as Deleted as is useful e.g.
Definition: messagestatus.cpp:683
Akonadi::MessageStatus::isForwarded
bool isForwarded() const
Check for Forwarded status.
Definition: messagestatus.cpp:232
Akonadi::MessageFlags::Watched
AKONADI_KMIME_EXPORT const char * Watched
The flag for a message being marked as watched.
Definition: messageflags.cpp:35
Akonadi::MessageStatus::setSigned
void setSigned(bool value=true)
Set the status to signed.
Definition: messagestatus.cpp:436
Akonadi::MessageFlags::Spam
AKONADI_KMIME_EXPORT const char * Spam
The flag for a message being marked as spam.
Definition: messageflags.cpp:39
Akonadi::MessageStatus::statusSpam
static const MessageStatus statusSpam()
Return a predefined status initialized as Spam as is useful e.g.
Definition: messagestatus.cpp:746
Akonadi::MessageStatus::isDeleted
bool isDeleted() const
Check for Deleted status.
Definition: messagestatus.cpp:222
Akonadi::MessageStatus::setHasError
void setHasError(bool value=true)
Set the status to error.
Definition: messagestatus.cpp:454
Akonadi::MessageFlags::Sent
AKONADI_KMIME_EXPORT const char * Sent
The flag for a message being marked as sent.
Definition: messageflags.cpp:30
Akonadi::MessageStatus::setIgnored
void setIgnored(bool ignored=true)
Set the status to ignored.
Definition: messagestatus.cpp:378
Akonadi::MessageStatus::operator==
bool operator==(const MessageStatus &other) const
Compare the status with that from another instance.
Definition: messagestatus.cpp:70
Akonadi::MessageStatus::statusQueued
static const MessageStatus statusQueued()
Return a predefined status initialized as Queued as is useful e.g.
Definition: messagestatus.cpp:704
Akonadi::MessageStatus
Akonadi KMime Message Status.
Definition: messagestatus.h:51
Akonadi::MessageStatus::statusReplied
static const MessageStatus statusReplied()
Return a predefined status initialized as Replied as is useful e.g.
Definition: messagestatus.cpp:690
Akonadi::MessageStatus::set
void set(const MessageStatus &other)
Set / add stati described by another MessageStatus object.
Definition: messagestatus.cpp:96
Akonadi::MessageStatus::setEncrypted
void setEncrypted(bool value=true)
Set the status to encrypted.
Definition: messagestatus.cpp:445
Akonadi::MessageStatus::setHasAttachment
void setHasAttachment(bool hasAttachment=true)
Set the status for an attachment.
Definition: messagestatus.cpp:418
Akonadi::MessageStatus::setStatusFromStr
void setStatusFromStr(const QString &aStr)
Set the status based on a string representation.
Definition: messagestatus.cpp:522
Akonadi::MessageFlags::Ignored
AKONADI_KMIME_EXPORT const char * Ignored
The flag for a message being marked as ignored.
Definition: messageflags.cpp:36
Akonadi::MessageFlags::ToAct
AKONADI_KMIME_EXPORT const char * ToAct
The flag for a message being marked as action item to act on.
Definition: messageflags.cpp:34
Akonadi::MessageStatus::statusHasInvitation
static const MessageStatus statusHasInvitation()
Return a predefined status initialized as Invitation as is useful e.g.
Definition: messagestatus.cpp:767
Akonadi::MessageFlags::Forwarded
AKONADI_KMIME_EXPORT const char * Forwarded
The flag for a message being marked as forwarded.
Definition: messageflags.cpp:33
Akonadi::MessageStatus::setDeleted
void setDeleted(bool deleted=true)
Set the status for deleted.
Definition: messagestatus.cpp:312
Akonadi::MessageStatus::isEncrypted
bool isEncrypted() const
Check for Encrypted status.
Definition: messagestatus.cpp:292
Akonadi::MessageStatus::statusStr
QString statusStr() const
Convert the status to a string representation.
Definition: messagestatus.cpp:474
Akonadi::MessageFlags::Replied
AKONADI_KMIME_EXPORT const char * Replied
The flag for a message being marked as replied.
Definition: messageflags.cpp:32
Akonadi::MessageStatus::setForwarded
void setForwarded(bool forwarded=true)
Set the status for forwarded.
Definition: messagestatus.cpp:330
Akonadi::MessageStatus::hasAttachment
bool hasAttachment() const
Check for Attachment status.
Definition: messagestatus.cpp:277
Akonadi::MessageStatus::isRead
bool isRead() const
Check for Read status.
Definition: messagestatus.cpp:217
Akonadi::MessageFlags::Queued
AKONADI_KMIME_EXPORT const char * Queued
The flag for a message being marked as queued.
Definition: messageflags.cpp:31
Akonadi::MessageStatus::isImportant
bool isImportant() const
Check for Important status.
Definition: messagestatus.cpp:247
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:54 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi/kmime

Skip menu "akonadi/kmime"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal