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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 void Akonadi::MessageStatus::setRead( bool read )
303 {
304  if ( read ) {
305  mStatus |= StatusRead;
306  } else {
307  mStatus &= ~StatusRead;
308  }
309 }
310 
311 void Akonadi::MessageStatus::setDeleted( bool deleted )
312 {
313  if ( deleted ) {
314  mStatus |= StatusDeleted;
315  } else {
316  mStatus &= ~StatusDeleted;
317  }
318 }
319 
320 void Akonadi::MessageStatus::setReplied( bool replied )
321 {
322  if ( replied ) {
323  mStatus |= StatusReplied;
324  } else {
325  mStatus &= ~StatusReplied;
326  }
327 }
328 
329 void Akonadi::MessageStatus::setForwarded( bool forwarded )
330 {
331  if ( forwarded ) {
332  mStatus |= StatusForwarded;
333  } else {
334  mStatus &= ~StatusForwarded;
335  }
336 }
337 
338 void Akonadi::MessageStatus::setQueued( bool queued )
339 {
340  if ( queued ) {
341  mStatus |= StatusQueued;
342  } else {
343  mStatus &= ~StatusQueued;
344  }
345 }
346 
347 void Akonadi::MessageStatus::setSent( bool sent )
348 {
349  if ( sent ) {
350  mStatus &= ~StatusQueued;
351  mStatus |= StatusSent;
352  } else {
353  mStatus &= ~StatusSent;
354  }
355 }
356 
357 void Akonadi::MessageStatus::setImportant( bool important )
358 {
359  if ( important ) {
360  mStatus |= StatusFlag;
361  } else {
362  mStatus &= ~StatusFlag;
363  }
364 }
365 
366 // Watched and ignored are mutually exclusive
367 void Akonadi::MessageStatus::setWatched( bool watched )
368 {
369  if ( watched ) {
370  mStatus &= ~StatusIgnored;
371  mStatus |= StatusWatched;
372  } else {
373  mStatus &= ~StatusWatched;
374  }
375 }
376 
377 void Akonadi::MessageStatus::setIgnored( bool ignored )
378 {
379  if ( ignored ) {
380  mStatus &= ~StatusWatched;
381  mStatus |= StatusIgnored;
382  } else {
383  mStatus &= ~StatusIgnored;
384  }
385 }
386 
387 void Akonadi::MessageStatus::setToAct( bool toAct )
388 {
389  if ( toAct ) {
390  mStatus |= StatusToAct;
391  } else {
392  mStatus &= ~StatusToAct;
393  }
394 }
395 
396 // Ham and Spam are mutually exclusive
397 void Akonadi::MessageStatus::setSpam( bool spam )
398 {
399  if ( spam ) {
400  mStatus &= ~StatusHam;
401  mStatus |= StatusSpam;
402  } else {
403  mStatus &= ~StatusSpam;
404  }
405 }
406 
407 void Akonadi::MessageStatus::setHam( bool ham )
408 {
409  if ( ham ) {
410  mStatus &= ~StatusSpam;
411  mStatus |= StatusHam;
412  } else {
413  mStatus &= ~StatusHam;
414  }
415 }
416 
417 void Akonadi::MessageStatus::setHasAttachment( bool withAttachment )
418 {
419  if ( withAttachment ) {
420  mStatus |= StatusHasAttachment;
421  } else {
422  mStatus &= ~StatusHasAttachment;
423  }
424 }
425 
426 void Akonadi::MessageStatus::setHasInvitation( bool withInvitation )
427 {
428  if ( withInvitation ) {
429  mStatus |= StatusHasInvitation;
430  } else {
431  mStatus &= ~StatusHasInvitation;
432  }
433 }
434 
435 void Akonadi::MessageStatus::setSigned( bool value )
436 {
437  if ( value ) {
438  mStatus |= StatusSigned;
439  } else {
440  mStatus &= ~StatusSigned;
441  }
442 }
443 
444 void Akonadi::MessageStatus::setEncrypted( bool value )
445 {
446  if ( value ) {
447  mStatus |= StatusEncrypted;
448  } else {
449  mStatus &= ~StatusEncrypted;
450  }
451 }
452 
453 void Akonadi::MessageStatus::setHasError( bool hasError )
454 {
455  if ( hasError ) {
456  mStatus |= StatusHasError;
457  } else {
458  mStatus &= ~StatusHasError;
459  }
460 }
461 
462 qint32 Akonadi::MessageStatus::toQInt32() const
463 {
464  return mStatus;
465 }
466 
467 void Akonadi::MessageStatus::fromQInt32( qint32 status )
468 {
469  mStatus = status;
470 }
471 
472 QString Akonadi::MessageStatus::statusStr() const
473 {
474  QByteArray sstr;
475  if ( mStatus & StatusRead ) {
476  sstr += 'R';
477  } else {
478  sstr += 'U';
479  }
480  if ( mStatus & StatusDeleted ) {
481  sstr += 'D';
482  }
483  if ( mStatus & StatusReplied ) {
484  sstr += 'A';
485  }
486  if ( mStatus & StatusForwarded ) {
487  sstr += 'F';
488  }
489  if ( mStatus & StatusQueued ) {
490  sstr += 'Q';
491  }
492  if ( mStatus & StatusToAct ) {
493  sstr += 'K';
494  }
495  if ( mStatus & StatusSent ) {
496  sstr += 'S';
497  }
498  if ( mStatus & StatusFlag ) {
499  sstr += 'G';
500  }
501  if ( mStatus & StatusWatched ) {
502  sstr += 'W';
503  }
504  if ( mStatus & StatusIgnored ) {
505  sstr += 'I';
506  }
507  if ( mStatus & StatusSpam ) {
508  sstr += 'P';
509  }
510  if ( mStatus & StatusHam ) {
511  sstr += 'H';
512  }
513  if ( mStatus & StatusHasAttachment ) {
514  sstr += 'T';
515  }
516 
517  return QLatin1String( sstr );
518 }
519 
520 void Akonadi::MessageStatus::setStatusFromStr( const QString& aStr )
521 {
522  mStatus = StatusUnknown;
523 
524  if ( aStr.contains( QLatin1Char( 'U' ) ) ) {
525  setRead( false );
526  }
527  if ( aStr.contains( QLatin1Char( 'R' ) ) ) {
528  setRead();
529  }
530  if ( aStr.contains( QLatin1Char( 'D' ) ) ) {
531  setDeleted();
532  }
533  if ( aStr.contains( QLatin1Char( 'A' ) ) ) {
534  setReplied();
535  }
536  if ( aStr.contains( QLatin1Char( 'F' ) ) ) {
537  setForwarded();
538  }
539  if ( aStr.contains( QLatin1Char( 'Q' ) ) ) {
540  setQueued();
541  }
542  if ( aStr.contains( QLatin1Char( 'K' ) ) ) {
543  setToAct();
544  }
545  if ( aStr.contains( QLatin1Char( 'S' ) ) ) {
546  setSent();
547  }
548  if ( aStr.contains( QLatin1Char( 'G' ) ) ) {
549  setImportant();
550  }
551  if ( aStr.contains( QLatin1Char( 'W' ) ) ) {
552  setWatched();
553  }
554  if ( aStr.contains( QLatin1Char( 'I' ) ) ) {
555  setIgnored();
556  }
557  if ( aStr.contains( QLatin1Char( 'P' ) ) ) {
558  setSpam();
559  }
560  if ( aStr.contains( QLatin1Char( 'H' ) ) ) {
561  setHam();
562  }
563  if ( aStr.contains( QLatin1Char( 'T' ) ) ) {
564  setHasAttachment();
565  }
566  if ( aStr.contains( QLatin1Char( 'C' ) ) ) {
567  setHasAttachment( false );
568  }
569 }
570 
571 QSet<QByteArray> Akonadi::MessageStatus::statusFlags() const
572 {
573  QSet<QByteArray> flags;
574 
575  if ( mStatus & StatusDeleted ) {
576  flags += Akonadi::MessageFlags::Deleted;
577  } else {
578  if ( mStatus & StatusRead )
579  flags += Akonadi::MessageFlags::Seen;
580  if ( mStatus & StatusReplied )
581  flags += Akonadi::MessageFlags::Answered;
582  if ( mStatus & StatusFlag )
583  flags += Akonadi::MessageFlags::Flagged;
584 
585  // non standard flags
586  if ( mStatus & StatusSent )
587  flags += Akonadi::MessageFlags::Sent;
588  if ( mStatus & StatusQueued )
589  flags += Akonadi::MessageFlags::Queued;
590  if ( mStatus & StatusReplied )
591  flags += Akonadi::MessageFlags::Replied;
592  if ( mStatus & StatusForwarded )
593  flags += Akonadi::MessageFlags::Forwarded;
594  if ( mStatus & StatusToAct )
595  flags += Akonadi::MessageFlags::ToAct;
596  if ( mStatus & StatusWatched )
597  flags += Akonadi::MessageFlags::Watched;
598  if ( mStatus & StatusIgnored )
599  flags += Akonadi::MessageFlags::Ignored;
600  if ( mStatus & StatusHasAttachment )
601  flags += Akonadi::MessageFlags::HasAttachment;
602  if ( mStatus & StatusHasInvitation )
603  flags += Akonadi::MessageFlags::HasInvitation;
604  if ( mStatus & StatusSigned )
605  flags += Akonadi::MessageFlags::Signed;
606  if ( mStatus & StatusEncrypted )
607  flags += Akonadi::MessageFlags::Encrypted;
608  if ( mStatus & StatusSpam )
609  flags += Akonadi::MessageFlags::Spam;
610  if ( mStatus & StatusHam )
611  flags += Akonadi::MessageFlags::Ham;
612  if ( mStatus & StatusHasError )
613  flags += Akonadi::MessageFlags::HasError;
614  }
615 
616  return flags;
617 }
618 
619 void Akonadi::MessageStatus::setStatusFromFlags( const QSet<QByteArray> &flags )
620 {
621  mStatus = StatusUnknown;
622 
623  foreach ( const QByteArray &flag, flags ) {
624  const QByteArray &upperedFlag = flag.toUpper();
625  if ( upperedFlag == Akonadi::MessageFlags::Deleted ) {
626  setDeleted();
627  } else if ( upperedFlag == Akonadi::MessageFlags::Seen ) {
628  setRead();
629  } else if ( upperedFlag == Akonadi::MessageFlags::Answered ) {
630  setReplied();
631  } else if ( upperedFlag == Akonadi::MessageFlags::Flagged ) {
632  setImportant();
633 
634  // non standard flags
635  } else if ( upperedFlag == Akonadi::MessageFlags::Sent ) {
636  setSent();
637  } else if ( upperedFlag == Akonadi::MessageFlags::Queued ) {
638  setQueued();
639  } else if ( upperedFlag == Akonadi::MessageFlags::Replied ) {
640  setReplied();
641  } else if ( upperedFlag == Akonadi::MessageFlags::Forwarded ) {
642  setForwarded();
643  } else if ( upperedFlag == Akonadi::MessageFlags::ToAct ) {
644  setToAct();
645  } else if ( upperedFlag == Akonadi::MessageFlags::Watched ) {
646  setWatched();
647  } else if ( upperedFlag == Akonadi::MessageFlags::Ignored ) {
648  setIgnored();
649  } else if ( upperedFlag == Akonadi::MessageFlags::HasAttachment ) {
650  setHasAttachment();
651  } else if ( upperedFlag == Akonadi::MessageFlags::HasInvitation ) {
652  setHasInvitation();
653  } else if ( upperedFlag == Akonadi::MessageFlags::Signed ) {
654  setSigned();
655  } else if ( upperedFlag == Akonadi::MessageFlags::Encrypted ) {
656  setEncrypted();
657  } else if ( upperedFlag == Akonadi::MessageFlags::Spam ) {
658  setSpam();
659  } else if ( upperedFlag == Akonadi::MessageFlags::Ham ) {
660  setHam();
661  } else if ( upperedFlag == Akonadi::MessageFlags::HasError ) {
662  setHasError();
663  }
664  }
665 }
666 
667 const Akonadi::MessageStatus Akonadi::MessageStatus::statusUnread()
668 {
669  Akonadi::MessageStatus st;
670  st.mStatus = StatusUnread;
671  return st;
672 }
673 
674 const Akonadi::MessageStatus Akonadi::MessageStatus::statusRead()
675 {
676  Akonadi::MessageStatus st;
677  st.setRead();
678  return st;
679 }
680 
681 const Akonadi::MessageStatus Akonadi::MessageStatus::statusDeleted()
682 {
683  Akonadi::MessageStatus st;
684  st.setDeleted();
685  return st;
686 }
687 
688 const Akonadi::MessageStatus Akonadi::MessageStatus::statusReplied()
689 {
690  Akonadi::MessageStatus st;
691  st.setReplied();
692  return st;
693 }
694 
695 const Akonadi::MessageStatus Akonadi::MessageStatus::statusForwarded()
696 {
697  Akonadi::MessageStatus st;
698  st.setForwarded();
699  return st;
700 }
701 
702 const Akonadi::MessageStatus Akonadi::MessageStatus::statusQueued()
703 {
704  Akonadi::MessageStatus st;
705  st.setQueued();
706  return st;
707 }
708 
709 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSent()
710 {
711  Akonadi::MessageStatus st;
712  st.setSent();
713  return st;
714 }
715 
716 const Akonadi::MessageStatus Akonadi::MessageStatus::statusImportant()
717 {
718  Akonadi::MessageStatus st;
719  st.setImportant();
720  return st;
721 }
722 
723 const Akonadi::MessageStatus Akonadi::MessageStatus::statusWatched()
724 {
725  Akonadi::MessageStatus st;
726  st.setWatched();
727  return st;
728 }
729 
730 const Akonadi::MessageStatus Akonadi::MessageStatus::statusIgnored()
731 {
732  Akonadi::MessageStatus st;
733  st.setIgnored();
734  return st;
735 }
736 
737 const Akonadi::MessageStatus Akonadi::MessageStatus::statusToAct()
738 {
739  Akonadi::MessageStatus st;
740  st.setToAct();
741  return st;
742 }
743 
744 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSpam()
745 {
746  Akonadi::MessageStatus st;
747  st.setSpam();
748  return st;
749 }
750 
751 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHam()
752 {
753  Akonadi::MessageStatus st;
754  st.setHam();
755  return st;
756 }
757 
758 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasAttachment()
759 {
760  Akonadi::MessageStatus st;
761  st.setHasAttachment();
762  return st;
763 }
764 
765 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasInvitation()
766 {
767  MessageStatus st;
768  st.setHasInvitation();
769  return st;
770 }
771 
772 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSigned()
773 {
774  MessageStatus st;
775  st.setSigned();
776  return st;
777 }
778 
779 const Akonadi::MessageStatus Akonadi::MessageStatus::statusEncrypted()
780 {
781  MessageStatus st;
782  st.setEncrypted();
783  return st;
784 }
785 
786 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasError()
787 {
788  MessageStatus st;
789  st.setHasError();
790  return st;
791 }
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:779
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:730
Akonadi::MessageStatus::setRead
void setRead(bool read=true)
Set the status to read.
Definition: messagestatus.cpp:302
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:723
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:367
Akonadi::MessageStatus::statusHasAttachment
static const MessageStatus statusHasAttachment()
Return a predefined status initialized as Attachment as is useful e.g.
Definition: messagestatus.cpp:758
Akonadi::MessageStatus::setHasInvitation
void setHasInvitation(bool hasInvitation=true)
Set the status for an invitation.
Definition: messagestatus.cpp:426
Akonadi::MessageStatus::toQInt32
qint32 toQInt32() const
Get the status as a whole e.g.
Definition: messagestatus.cpp:462
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:397
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:387
Akonadi::MessageStatus::fromQInt32
void fromQInt32(qint32 status)
Set the status as a whole e.g.
Definition: messagestatus.cpp:467
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:571
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:737
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:357
Akonadi::MessageStatus::statusUnread
static const MessageStatus statusUnread()
Return a special status that expresses Unread.
Definition: messagestatus.cpp:667
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:407
Akonadi::MessageStatus::setStatusFromFlags
void setStatusFromFlags(const QSet< QByteArray > &flags)
Set the status as a whole e.g.
Definition: messagestatus.cpp:619
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:786
Akonadi::MessageStatus::statusRead
static const MessageStatus statusRead()
Return a predefined status initialized as Read as is useful e.g.
Definition: messagestatus.cpp:674
Akonadi::MessageStatus::statusSent
static const MessageStatus statusSent()
Return a predefined status initialized as Sent as is useful e.g.
Definition: messagestatus.cpp:709
Akonadi::MessageStatus::statusSigned
static const MessageStatus statusSigned()
Return a predefined status initialized as Signed as is useful e.g.
Definition: messagestatus.cpp:772
Akonadi::MessageStatus::statusImportant
static const MessageStatus statusImportant()
Return a predefined status initialized as Important as is useful e.g.
Definition: messagestatus.cpp:716
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:320
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:347
Akonadi::MessageStatus::statusForwarded
static const MessageStatus statusForwarded()
Return a predefined status initialized as Forwarded as is useful e.g.
Definition: messagestatus.cpp:695
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:751
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:338
Akonadi::MessageStatus::statusDeleted
static const MessageStatus statusDeleted()
Return a predefined status initialized as Deleted as is useful e.g.
Definition: messagestatus.cpp:681
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:435
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:744
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:453
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:377
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:702
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:688
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:444
Akonadi::MessageStatus::setHasAttachment
void setHasAttachment(bool hasAttachment=true)
Set the status for an attachment.
Definition: messagestatus.cpp:417
Akonadi::MessageStatus::setStatusFromStr
void setStatusFromStr(const QString &aStr)
Set the status based on a string representation.
Definition: messagestatus.cpp:520
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:765
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:311
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:472
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:329
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-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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