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

akonadi/kmime

  • sources
  • kde-4.14
  • 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 
86  if (other.mStatus == StatusUnread) {
87  return !(mStatus & StatusRead);
88  }
89 
90  return (mStatus & other.mStatus);
91 }
92 
93 void Akonadi::MessageStatus::clear()
94 {
95  mStatus = StatusUnknown;
96 }
97 
98 void Akonadi::MessageStatus::set(const Akonadi::MessageStatus &other)
99 {
100  Q_ASSERT(!(other.mStatus &StatusUnread));
101 
102  // Those stati are exclusive, but we have to lock at the
103  // internal representation because Ignored can manipulate
104  // the result of the getter methods.
105  if (other.mStatus & StatusRead) {
106  setRead();
107  }
108  if (other.isDeleted()) {
109  setDeleted();
110  }
111  if (other.isReplied()) {
112  setReplied();
113  }
114  if (other.isForwarded()) {
115  setForwarded();
116  }
117  if (other.isQueued()) {
118  setQueued();
119  }
120  if (other.isSent()) {
121  setSent();
122  }
123  if (other.isImportant()) {
124  setImportant();
125  }
126 
127  if (other.isWatched()) {
128  setWatched();
129  }
130  if (other.isIgnored()) {
131  setIgnored();
132  }
133  if (other.isToAct()) {
134  setToAct();
135  }
136  if (other.isSpam()) {
137  setSpam();
138  }
139  if (other.isHam()) {
140  setHam();
141  }
142  if (other.hasAttachment()) {
143  setHasAttachment();
144  }
145  if (other.hasInvitation()) {
146  setHasInvitation();
147  }
148  if (other.isSigned()) {
149  setSigned();
150  }
151  if (other.isEncrypted()) {
152  setEncrypted();
153  }
154  if (other.hasError()) {
155  setHasError();
156  }
157 }
158 
159 void Akonadi::MessageStatus::toggle(const Akonadi::MessageStatus &other)
160 {
161  Q_ASSERT(!(other.mStatus & StatusUnread));
162 
163  if (other.isDeleted()) {
164  setDeleted(!(mStatus & StatusDeleted));
165  }
166  if (other.isReplied()) {
167  setReplied(!(mStatus & StatusReplied));
168  }
169  if (other.isForwarded()) {
170  setForwarded(!(mStatus & StatusForwarded));
171  }
172  if (other.isQueued()) {
173  setQueued(!(mStatus & StatusQueued));
174  }
175  if (other.isSent()) {
176  setSent(!(mStatus & StatusSent));
177  }
178  if (other.isImportant()) {
179  setImportant(!(mStatus & StatusFlag));
180  }
181 
182  if (other.isWatched()) {
183  setWatched(!(mStatus & StatusWatched));
184  }
185  if (other.isIgnored()) {
186  setIgnored(!(mStatus & StatusIgnored));
187  }
188  if (other.isToAct()) {
189  setToAct(!(mStatus & StatusToAct));
190  }
191  if (other.isSpam()) {
192  setSpam(!(mStatus & StatusSpam));
193  }
194  if (other.isHam()) {
195  setHam(!(mStatus & StatusHam));
196  }
197  if (other.hasAttachment()) {
198  setHasAttachment(!(mStatus & StatusHasAttachment));
199  }
200  if (other.hasInvitation()) {
201  setHasInvitation(!(mStatus & StatusHasInvitation));
202  }
203  if (other.isSigned()) {
204  setSigned(!(mStatus & StatusSigned));
205  }
206  if (other.isEncrypted()) {
207  setEncrypted(!(mStatus & StatusEncrypted));
208  }
209  if (other.hasError()) {
210  setHasError(!(mStatus & StatusHasError));
211  }
212 }
213 
214 bool Akonadi::MessageStatus::isOfUnknownStatus() const
215 {
216  return (mStatus == StatusUnknown);
217 }
218 
219 bool Akonadi::MessageStatus::isRead() const
220 {
221  return ((mStatus & StatusRead) || (mStatus & StatusIgnored));
222 }
223 
224 bool Akonadi::MessageStatus::isDeleted() const
225 {
226  return (mStatus & StatusDeleted);
227 }
228 
229 bool Akonadi::MessageStatus::isReplied() const
230 {
231  return (mStatus & StatusReplied);
232 }
233 
234 bool Akonadi::MessageStatus::isForwarded() const
235 {
236  return (mStatus & StatusForwarded);
237 }
238 
239 bool Akonadi::MessageStatus::isQueued() const
240 {
241  return (mStatus & StatusQueued);
242 }
243 
244 bool Akonadi::MessageStatus::isSent() const
245 {
246  return (mStatus & StatusSent);
247 }
248 
249 bool Akonadi::MessageStatus::isImportant() const
250 {
251  return (mStatus & StatusFlag);
252 }
253 
254 bool Akonadi::MessageStatus::isWatched() const
255 {
256  return (mStatus & StatusWatched);
257 }
258 
259 bool Akonadi::MessageStatus::isIgnored() const
260 {
261  return (mStatus & StatusIgnored);
262 }
263 
264 bool Akonadi::MessageStatus::isToAct() const
265 {
266  return (mStatus & StatusToAct);
267 }
268 
269 bool Akonadi::MessageStatus::isSpam() const
270 {
271  return (mStatus & StatusSpam);
272 }
273 
274 bool Akonadi::MessageStatus::isHam() const
275 {
276  return (mStatus & StatusHam);
277 }
278 
279 bool Akonadi::MessageStatus::hasAttachment() const
280 {
281  return (mStatus & StatusHasAttachment);
282 }
283 
284 bool Akonadi::MessageStatus::hasInvitation() const
285 {
286  return (mStatus & StatusHasInvitation);
287 }
288 
289 bool Akonadi::MessageStatus::isSigned() const
290 {
291  return (mStatus & StatusSigned);
292 }
293 
294 bool Akonadi::MessageStatus::isEncrypted() const
295 {
296  return (mStatus & StatusEncrypted);
297 }
298 
299 bool Akonadi::MessageStatus::hasError() const
300 {
301  return (mStatus & StatusHasError);
302 }
303 
304 void Akonadi::MessageStatus::setRead(bool read)
305 {
306  if (read) {
307  mStatus |= StatusRead;
308  } else {
309  mStatus &= ~StatusRead;
310  }
311 }
312 
313 void Akonadi::MessageStatus::setDeleted(bool deleted)
314 {
315  if (deleted) {
316  mStatus |= StatusDeleted;
317  } else {
318  mStatus &= ~StatusDeleted;
319  }
320 }
321 
322 void Akonadi::MessageStatus::setReplied(bool replied)
323 {
324  if (replied) {
325  mStatus |= StatusReplied;
326  } else {
327  mStatus &= ~StatusReplied;
328  }
329 }
330 
331 void Akonadi::MessageStatus::setForwarded(bool forwarded)
332 {
333  if (forwarded) {
334  mStatus |= StatusForwarded;
335  } else {
336  mStatus &= ~StatusForwarded;
337  }
338 }
339 
340 void Akonadi::MessageStatus::setQueued(bool queued)
341 {
342  if (queued) {
343  mStatus |= StatusQueued;
344  } else {
345  mStatus &= ~StatusQueued;
346  }
347 }
348 
349 void Akonadi::MessageStatus::setSent(bool sent)
350 {
351  if (sent) {
352  mStatus &= ~StatusQueued;
353  mStatus |= StatusSent;
354  } else {
355  mStatus &= ~StatusSent;
356  }
357 }
358 
359 void Akonadi::MessageStatus::setImportant(bool important)
360 {
361  if (important) {
362  mStatus |= StatusFlag;
363  } else {
364  mStatus &= ~StatusFlag;
365  }
366 }
367 
368 // Watched and ignored are mutually exclusive
369 void Akonadi::MessageStatus::setWatched(bool watched)
370 {
371  if (watched) {
372  mStatus &= ~StatusIgnored;
373  mStatus |= StatusWatched;
374  } else {
375  mStatus &= ~StatusWatched;
376  }
377 }
378 
379 void Akonadi::MessageStatus::setIgnored(bool ignored)
380 {
381  if (ignored) {
382  mStatus &= ~StatusWatched;
383  mStatus |= StatusIgnored;
384  } else {
385  mStatus &= ~StatusIgnored;
386  }
387 }
388 
389 void Akonadi::MessageStatus::setToAct(bool toAct)
390 {
391  if (toAct) {
392  mStatus |= StatusToAct;
393  } else {
394  mStatus &= ~StatusToAct;
395  }
396 }
397 
398 // Ham and Spam are mutually exclusive
399 void Akonadi::MessageStatus::setSpam(bool spam)
400 {
401  if (spam) {
402  mStatus &= ~StatusHam;
403  mStatus |= StatusSpam;
404  } else {
405  mStatus &= ~StatusSpam;
406  }
407 }
408 
409 void Akonadi::MessageStatus::setHam(bool ham)
410 {
411  if (ham) {
412  mStatus &= ~StatusSpam;
413  mStatus |= StatusHam;
414  } else {
415  mStatus &= ~StatusHam;
416  }
417 }
418 
419 void Akonadi::MessageStatus::setHasAttachment(bool withAttachment)
420 {
421  if (withAttachment) {
422  mStatus |= StatusHasAttachment;
423  } else {
424  mStatus &= ~StatusHasAttachment;
425  }
426 }
427 
428 void Akonadi::MessageStatus::setHasInvitation(bool withInvitation)
429 {
430  if (withInvitation) {
431  mStatus |= StatusHasInvitation;
432  } else {
433  mStatus &= ~StatusHasInvitation;
434  }
435 }
436 
437 void Akonadi::MessageStatus::setSigned(bool value)
438 {
439  if (value) {
440  mStatus |= StatusSigned;
441  } else {
442  mStatus &= ~StatusSigned;
443  }
444 }
445 
446 void Akonadi::MessageStatus::setEncrypted(bool value)
447 {
448  if (value) {
449  mStatus |= StatusEncrypted;
450  } else {
451  mStatus &= ~StatusEncrypted;
452  }
453 }
454 
455 void Akonadi::MessageStatus::setHasError(bool hasError)
456 {
457  if (hasError) {
458  mStatus |= StatusHasError;
459  } else {
460  mStatus &= ~StatusHasError;
461  }
462 }
463 
464 qint32 Akonadi::MessageStatus::toQInt32() const
465 {
466  return mStatus;
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  }
583  if (mStatus & StatusReplied) {
584  flags += Akonadi::MessageFlags::Answered;
585  }
586  if (mStatus & StatusFlag) {
587  flags += Akonadi::MessageFlags::Flagged;
588  }
589 
590  // non standard flags
591  if (mStatus & StatusSent) {
592  flags += Akonadi::MessageFlags::Sent;
593  }
594  if (mStatus & StatusQueued) {
595  flags += Akonadi::MessageFlags::Queued;
596  }
597  if (mStatus & StatusReplied) {
598  flags += Akonadi::MessageFlags::Replied;
599  }
600  if (mStatus & StatusForwarded) {
601  flags += Akonadi::MessageFlags::Forwarded;
602  }
603  if (mStatus & StatusToAct) {
604  flags += Akonadi::MessageFlags::ToAct;
605  }
606  if (mStatus & StatusWatched) {
607  flags += Akonadi::MessageFlags::Watched;
608  }
609  if (mStatus & StatusIgnored) {
610  flags += Akonadi::MessageFlags::Ignored;
611  }
612  if (mStatus & StatusHasAttachment) {
613  flags += Akonadi::MessageFlags::HasAttachment;
614  }
615  if (mStatus & StatusHasInvitation) {
616  flags += Akonadi::MessageFlags::HasInvitation;
617  }
618  if (mStatus & StatusSigned) {
619  flags += Akonadi::MessageFlags::Signed;
620  }
621  if (mStatus & StatusEncrypted) {
622  flags += Akonadi::MessageFlags::Encrypted;
623  }
624  if (mStatus & StatusSpam) {
625  flags += Akonadi::MessageFlags::Spam;
626  }
627  if (mStatus & StatusHam) {
628  flags += Akonadi::MessageFlags::Ham;
629  }
630  if (mStatus & StatusHasError) {
631  flags += Akonadi::MessageFlags::HasError;
632  }
633  }
634 
635  return flags;
636 }
637 
638 void Akonadi::MessageStatus::setStatusFromFlags(const QSet<QByteArray> &flags)
639 {
640  mStatus = StatusUnknown;
641 
642  foreach (const QByteArray &flag, flags) {
643  const QByteArray &upperedFlag = flag.toUpper();
644  if (upperedFlag == Akonadi::MessageFlags::Deleted) {
645  setDeleted();
646  } else if (upperedFlag == Akonadi::MessageFlags::Seen) {
647  setRead();
648  } else if (upperedFlag == Akonadi::MessageFlags::Answered) {
649  setReplied();
650  } else if (upperedFlag == Akonadi::MessageFlags::Flagged) {
651  setImportant();
652 
653  // non standard flags
654  } else if (upperedFlag == Akonadi::MessageFlags::Sent) {
655  setSent();
656  } else if (upperedFlag == Akonadi::MessageFlags::Queued) {
657  setQueued();
658  } else if (upperedFlag == Akonadi::MessageFlags::Replied) {
659  setReplied();
660  } else if (upperedFlag == Akonadi::MessageFlags::Forwarded) {
661  setForwarded();
662  } else if (upperedFlag == Akonadi::MessageFlags::ToAct) {
663  setToAct();
664  } else if (upperedFlag == Akonadi::MessageFlags::Watched) {
665  setWatched();
666  } else if (upperedFlag == Akonadi::MessageFlags::Ignored) {
667  setIgnored();
668  } else if (upperedFlag == Akonadi::MessageFlags::HasAttachment) {
669  setHasAttachment();
670  } else if (upperedFlag == Akonadi::MessageFlags::HasInvitation) {
671  setHasInvitation();
672  } else if (upperedFlag == Akonadi::MessageFlags::Signed) {
673  setSigned();
674  } else if (upperedFlag == Akonadi::MessageFlags::Encrypted) {
675  setEncrypted();
676  } else if (upperedFlag == Akonadi::MessageFlags::Spam) {
677  setSpam();
678  } else if (upperedFlag == Akonadi::MessageFlags::Ham) {
679  setHam();
680  } else if (upperedFlag == Akonadi::MessageFlags::HasError) {
681  setHasError();
682  }
683  }
684 }
685 
686 const Akonadi::MessageStatus Akonadi::MessageStatus::statusUnread()
687 {
688  Akonadi::MessageStatus st;
689  st.mStatus = StatusUnread;
690  return st;
691 }
692 
693 const Akonadi::MessageStatus Akonadi::MessageStatus::statusRead()
694 {
695  Akonadi::MessageStatus st;
696  st.setRead();
697  return st;
698 }
699 
700 const Akonadi::MessageStatus Akonadi::MessageStatus::statusDeleted()
701 {
702  Akonadi::MessageStatus st;
703  st.setDeleted();
704  return st;
705 }
706 
707 const Akonadi::MessageStatus Akonadi::MessageStatus::statusReplied()
708 {
709  Akonadi::MessageStatus st;
710  st.setReplied();
711  return st;
712 }
713 
714 const Akonadi::MessageStatus Akonadi::MessageStatus::statusForwarded()
715 {
716  Akonadi::MessageStatus st;
717  st.setForwarded();
718  return st;
719 }
720 
721 const Akonadi::MessageStatus Akonadi::MessageStatus::statusQueued()
722 {
723  Akonadi::MessageStatus st;
724  st.setQueued();
725  return st;
726 }
727 
728 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSent()
729 {
730  Akonadi::MessageStatus st;
731  st.setSent();
732  return st;
733 }
734 
735 const Akonadi::MessageStatus Akonadi::MessageStatus::statusImportant()
736 {
737  Akonadi::MessageStatus st;
738  st.setImportant();
739  return st;
740 }
741 
742 const Akonadi::MessageStatus Akonadi::MessageStatus::statusWatched()
743 {
744  Akonadi::MessageStatus st;
745  st.setWatched();
746  return st;
747 }
748 
749 const Akonadi::MessageStatus Akonadi::MessageStatus::statusIgnored()
750 {
751  Akonadi::MessageStatus st;
752  st.setIgnored();
753  return st;
754 }
755 
756 const Akonadi::MessageStatus Akonadi::MessageStatus::statusToAct()
757 {
758  Akonadi::MessageStatus st;
759  st.setToAct();
760  return st;
761 }
762 
763 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSpam()
764 {
765  Akonadi::MessageStatus st;
766  st.setSpam();
767  return st;
768 }
769 
770 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHam()
771 {
772  Akonadi::MessageStatus st;
773  st.setHam();
774  return st;
775 }
776 
777 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasAttachment()
778 {
779  Akonadi::MessageStatus st;
780  st.setHasAttachment();
781  return st;
782 }
783 
784 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasInvitation()
785 {
786  MessageStatus st;
787  st.setHasInvitation();
788  return st;
789 }
790 
791 const Akonadi::MessageStatus Akonadi::MessageStatus::statusSigned()
792 {
793  MessageStatus st;
794  st.setSigned();
795  return st;
796 }
797 
798 const Akonadi::MessageStatus Akonadi::MessageStatus::statusEncrypted()
799 {
800  MessageStatus st;
801  st.setEncrypted();
802  return st;
803 }
804 
805 const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasError()
806 {
807  MessageStatus st;
808  st.setHasError();
809  return st;
810 }
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:214
Akonadi::MessageStatus::isReplied
bool isReplied() const
Check for Replied status.
Definition: messagestatus.cpp:229
Akonadi::MessageStatus::hasError
bool hasError() const
Check for error status.
Definition: messagestatus.cpp:299
Akonadi::MessageStatus::statusEncrypted
static const MessageStatus statusEncrypted()
Return a predefined status initialized as Encrypted as is useful e.g.
Definition: messagestatus.cpp:798
Akonadi::MessageStatus::isHam
bool isHam() const
Check for Ham status.
Definition: messagestatus.cpp:274
Akonadi::MessageStatus::statusIgnored
static const MessageStatus statusIgnored()
Return a predefined status initialized as Ignored as is useful e.g.
Definition: messagestatus.cpp:749
Akonadi::MessageStatus::setRead
void setRead(bool read=true)
Set the status to read.
Definition: messagestatus.cpp:304
Akonadi::MessageFlags::Signed
AKONADI_KMIME_EXPORT const char * Signed
The flag for a message being marked as signed.
Definition: messageflags.cpp:41
Akonadi::MessageFlags::HasInvitation
AKONADI_KMIME_EXPORT const char * HasInvitation
The flag for a message being marked as having an invitation.
Definition: messageflags.cpp:33
Akonadi::MessageStatus::statusWatched
static const MessageStatus statusWatched()
Return a predefined status initialized as Watched as is useful e.g.
Definition: messagestatus.cpp:742
Akonadi::MessageFlags::Seen
AKONADI_KMIME_EXPORT const char * Seen
The flag for a message being seen (i.e.
Definition: messageflags.cpp:27
QByteArray
Akonadi::MessageStatus::setWatched
void setWatched(bool watched=true)
Set the status to watched.
Definition: messagestatus.cpp:369
Akonadi::MessageStatus::statusHasAttachment
static const MessageStatus statusHasAttachment()
Return a predefined status initialized as Attachment as is useful e.g.
Definition: messagestatus.cpp:777
Akonadi::MessageStatus::setHasInvitation
void setHasInvitation(bool hasInvitation=true)
Set the status for an invitation.
Definition: messagestatus.cpp:428
Akonadi::MessageStatus::toQInt32
qint32 toQInt32() const
Get the status as a whole e.g.
Definition: messagestatus.cpp:464
Akonadi::MessageStatus::isSpam
bool isSpam() const
Check for Spam status.
Definition: messagestatus.cpp:269
QByteArray::toUpper
QByteArray toUpper() const
Akonadi::MessageStatus::isSigned
bool isSigned() const
Check for Signed status.
Definition: messagestatus.cpp:289
Akonadi::MessageStatus::setSpam
void setSpam(bool spam=true)
Set the status to spam.
Definition: messagestatus.cpp:399
Akonadi::MessageFlags::Encrypted
AKONADI_KMIME_EXPORT const char * Encrypted
The flag for a message being marked as encrypted.
Definition: messageflags.cpp:42
Akonadi::MessageStatus::setToAct
void setToAct(bool toAct=true)
Set the status to action item.
Definition: messagestatus.cpp:389
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:244
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:239
Akonadi::MessageStatus::statusToAct
static const MessageStatus statusToAct()
Return a predefined status initialized as Action Item as is useful e.g.
Definition: messagestatus.cpp:756
Akonadi::MessageStatus::hasInvitation
bool hasInvitation() const
Check for Invitation status.
Definition: messagestatus.cpp:284
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:30
Akonadi::MessageStatus::setImportant
void setImportant(bool important=true)
Set the status for important.
Definition: messagestatus.cpp:359
Akonadi::MessageStatus::statusUnread
static const MessageStatus statusUnread()
Return a special status that expresses Unread.
Definition: messagestatus.cpp:686
Akonadi::MessageStatus::isIgnored
bool isIgnored() const
Check for Ignored status.
Definition: messagestatus.cpp:259
Akonadi::MessageFlags::Deleted
AKONADI_KMIME_EXPORT const char * Deleted
The flag for a message being deleted by the user.
Definition: messageflags.cpp:28
Akonadi::MessageFlags::Answered
AKONADI_KMIME_EXPORT const char * Answered
The flag for a message being replied to by the user.
Definition: messageflags.cpp:29
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:93
Akonadi::MessageStatus::setHam
void setHam(bool ham=true)
Set the status to not spam.
Definition: messagestatus.cpp:409
Akonadi::MessageStatus::setStatusFromFlags
void setStatusFromFlags(const QSet< QByteArray > &flags)
Set the status as a whole e.g.
Definition: messagestatus.cpp:638
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:31
Akonadi::MessageFlags::Ham
AKONADI_KMIME_EXPORT const char * Ham
The flag for a message being marked as ham.
Definition: messageflags.cpp:44
Akonadi::MessageStatus::statusHasError
static const MessageStatus statusHasError()
Return a predefined status initialized as Error as is useful e.g.
Definition: messagestatus.cpp:805
Akonadi::MessageStatus::statusRead
static const MessageStatus statusRead()
Return a predefined status initialized as Read as is useful e.g.
Definition: messagestatus.cpp:693
Akonadi::MessageStatus::statusSent
static const MessageStatus statusSent()
Return a predefined status initialized as Sent as is useful e.g.
Definition: messagestatus.cpp:728
Akonadi::MessageStatus::statusSigned
static const MessageStatus statusSigned()
Return a predefined status initialized as Signed as is useful e.g.
Definition: messagestatus.cpp:791
Akonadi::MessageStatus::statusImportant
static const MessageStatus statusImportant()
Return a predefined status initialized as Important as is useful e.g.
Definition: messagestatus.cpp:735
Akonadi::MessageStatus::isToAct
bool isToAct() const
Check for ToAct status.
Definition: messagestatus.cpp:264
Akonadi::MessageStatus::setReplied
void setReplied(bool replied=true)
Set the status for replied.
Definition: messagestatus.cpp:322
Akonadi::MessageFlags::HasAttachment
AKONADI_KMIME_EXPORT const char * HasAttachment
The flag for a message being marked as having an attachment.
Definition: messageflags.cpp:32
Akonadi::MessageStatus::setSent
void setSent(bool sent=true)
Set the status for sent.
Definition: messagestatus.cpp:349
Akonadi::MessageStatus::statusForwarded
static const MessageStatus statusForwarded()
Return a predefined status initialized as Forwarded as is useful e.g.
Definition: messagestatus.cpp:714
Akonadi::MessageStatus::toggle
void toggle(const MessageStatus &other)
Toggle one or more stati described by another MessageStatus object.
Definition: messagestatus.cpp:159
QSet
Akonadi::MessageStatus::statusHam
static const MessageStatus statusHam()
Return a predefined status initialized as Ham as is useful e.g.
Definition: messagestatus.cpp:770
QString
Akonadi::MessageStatus::isWatched
bool isWatched() const
Check for Watched status.
Definition: messagestatus.cpp:254
Akonadi::MessageStatus::setQueued
void setQueued(bool queued=true)
Set the status for queued.
Definition: messagestatus.cpp:340
QString::contains
bool contains(QChar ch, Qt::CaseSensitivity cs) const
Akonadi::MessageStatus::statusDeleted
static const MessageStatus statusDeleted()
Return a predefined status initialized as Deleted as is useful e.g.
Definition: messagestatus.cpp:700
QLatin1Char
Akonadi::MessageStatus::isForwarded
bool isForwarded() const
Check for Forwarded status.
Definition: messagestatus.cpp:234
Akonadi::MessageFlags::Watched
AKONADI_KMIME_EXPORT const char * Watched
The flag for a message being marked as watched.
Definition: messageflags.cpp:39
Akonadi::MessageStatus::setSigned
void setSigned(bool value=true)
Set the status to signed.
Definition: messagestatus.cpp:437
Akonadi::MessageFlags::Spam
AKONADI_KMIME_EXPORT const char * Spam
The flag for a message being marked as spam.
Definition: messageflags.cpp:43
Akonadi::MessageStatus::statusSpam
static const MessageStatus statusSpam()
Return a predefined status initialized as Spam as is useful e.g.
Definition: messagestatus.cpp:763
Akonadi::MessageStatus::isDeleted
bool isDeleted() const
Check for Deleted status.
Definition: messagestatus.cpp:224
QLatin1String
Akonadi::MessageStatus::setHasError
void setHasError(bool value=true)
Set the status to error.
Definition: messagestatus.cpp:455
Akonadi::MessageFlags::Sent
AKONADI_KMIME_EXPORT const char * Sent
The flag for a message being marked as sent.
Definition: messageflags.cpp:34
Akonadi::MessageStatus::setIgnored
void setIgnored(bool ignored=true)
Set the status to ignored.
Definition: messagestatus.cpp:379
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:721
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:707
Akonadi::MessageStatus::set
void set(const MessageStatus &other)
Set / add stati described by another MessageStatus object.
Definition: messagestatus.cpp:98
Akonadi::MessageStatus::setEncrypted
void setEncrypted(bool value=true)
Set the status to encrypted.
Definition: messagestatus.cpp:446
Akonadi::MessageStatus::setHasAttachment
void setHasAttachment(bool hasAttachment=true)
Set the status for an attachment.
Definition: messagestatus.cpp:419
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:40
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:38
Akonadi::MessageStatus::statusHasInvitation
static const MessageStatus statusHasInvitation()
Return a predefined status initialized as Invitation as is useful e.g.
Definition: messagestatus.cpp:784
Akonadi::MessageFlags::Forwarded
AKONADI_KMIME_EXPORT const char * Forwarded
The flag for a message being marked as forwarded.
Definition: messageflags.cpp:37
Akonadi::MessageStatus::setDeleted
void setDeleted(bool deleted=true)
Set the status for deleted.
Definition: messagestatus.cpp:313
Akonadi::MessageStatus::isEncrypted
bool isEncrypted() const
Check for Encrypted status.
Definition: messagestatus.cpp:294
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:36
Akonadi::MessageStatus::setForwarded
void setForwarded(bool forwarded=true)
Set the status for forwarded.
Definition: messagestatus.cpp:331
Akonadi::MessageStatus::hasAttachment
bool hasAttachment() const
Check for Attachment status.
Definition: messagestatus.cpp:279
Akonadi::MessageStatus::isRead
bool isRead() const
Check for Read status.
Definition: messagestatus.cpp:219
Akonadi::MessageFlags::Queued
AKONADI_KMIME_EXPORT const char * Queued
The flag for a message being marked as queued.
Definition: messageflags.cpp:35
Akonadi::MessageStatus::isImportant
bool isImportant() const
Check for Important status.
Definition: messagestatus.cpp:249
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:24 by doxygen 1.8.7 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 Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs 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

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