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

kalarm

  • sources
  • kde-4.14
  • kdepim
  • kalarm
kamail.h
Go to the documentation of this file.
1 /*
2  * kamail.h - email functions
3  * Program: kalarm
4  * Copyright © 2002-2011 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef KAMAIL_H
22 #define KAMAIL_H
23 
24 #include <kalarmcal/kaevent.h>
25 
26 #ifdef USE_AKONADI
27 #include <kcalcore/person.h>
28 #else
29 #include <kcal/person.h>
30 #endif
31 
32 #include <QObject>
33 #include <QString>
34 #include <QStringList>
35 #include <QQueue>
36 #ifdef USE_AKONADI
37 #include <QList>
38 #endif
39 
40 class KUrl;
41 class KJob;
42 namespace MailTransport { class MessageQueueJob; }
43 namespace KMime {
44  namespace Types { struct Address; }
45  class Message;
46 }
47 
48 using namespace KAlarmCal;
49 
50 class KAMail : public QObject
51 {
52  Q_OBJECT
53  public:
54  // Data to store for each mail send job.
55  // Some data is required by KAMail, while other data is used by the caller.
56  struct JobData
57  {
58  JobData() {}
59  JobData(KAEvent& e, const KAAlarm& a, bool resched, bool notify)
60  : event(e), alarm(a), reschedule(resched), allowNotify(notify), queued(false) {}
61  KAEvent event;
62  KAAlarm alarm;
63  QString from, bcc, subject;
64  bool reschedule;
65  bool allowNotify;
66  bool queued;
67  };
68 
69  static int send(JobData&, QStringList& errmsgs);
70  static int checkAddress(QString& address);
71  static int checkAttachment(QString& attachment, KUrl* = 0);
72  static bool checkAttachment(const KUrl&);
73 #ifdef USE_AKONADI
74  static QString convertAddresses(const QString& addresses, KCalCore::Person::List&);
75 #else
76  static QString convertAddresses(const QString& addresses, QList<KCal::Person>&);
77 #endif
78  static QString convertAttachments(const QString& attachments, QStringList& list);
79  static QString controlCentreAddress();
80 #ifdef KMAIL_SUPPORTED
81  static QString getMailBody(quint32 serialNumber);
82 #endif
83  static QString i18n_NeedFromEmailAddress();
84  static QString i18n_sent_mail();
85 
86  private slots:
87  void slotEmailSent(KJob*);
88 
89  private:
90  KAMail() {}
91  static KAMail* instance();
92  static QString appendBodyAttachments(KMime::Message& message, JobData&);
93  static void notifyQueued(const KAEvent&);
94  enum ErrType { SEND_FAIL, SEND_ERROR };
95  static QStringList errors(const QString& error = QString(), ErrType = SEND_FAIL);
96 
97  static KAMail* mInstance;
98  static QQueue<MailTransport::MessageQueueJob*> mJobs;
99  static QQueue<JobData> mJobData;
100 };
101 
102 #endif // KAMAIL_H
103 
104 // vim: et sw=4:
KAMail::JobData::JobData
JobData(KAEvent &e, const KAAlarm &a, bool resched, bool notify)
Definition: kamail.h:59
QQueue< MailTransport::MessageQueueJob * >
KAMail::JobData::alarm
KAAlarm alarm
Definition: kamail.h:62
KAMail::JobData::subject
QString subject
Definition: kamail.h:63
KAMail::JobData::event
KAEvent event
Definition: kamail.h:61
KAMail::JobData::queued
bool queued
Definition: kamail.h:66
from
QString from() const
QObject
KAMail
Definition: kamail.h:50
KAMail::JobData::JobData
JobData()
Definition: kamail.h:58
QString
QList< KCal::Person >
QStringList
KAMail::JobData::reschedule
bool reschedule
Definition: kamail.h:64
KAMail::JobData
Definition: kamail.h:56
serialNumber
quint32 serialNumber() const
KAMail::JobData::allowNotify
bool allowNotify
Definition: kamail.h:65
KJob
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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