kalarm

kamail.h
1 /*
2  * kamail.h - email functions
3  * Program: kalarm
4  * Copyright © 2002-2008 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 <tqstring.h>
25 #include <tqstringlist.h>
26 class KURL;
27 class KAEvent;
28 class EmailAddressList;
29 namespace KPIM { class IdentityManager; }
30 namespace KMime { namespace Types { struct Address; } }
31 
32 struct KAMailData;
33 
34 
35 class KAMail
36 {
37  public:
38  static bool send(const KAEvent&, TQStringList& errmsgs, bool allowNotify = true);
39  static int checkAddress(TQString& address);
40  static int checkAttachment(TQString& attachment, KURL* = 0);
41  static bool checkAttachment(const KURL&);
42  static TQString convertAddresses(const TQString& addresses, EmailAddressList&);
43  static TQString convertAttachments(const TQString& attachments, TQStringList& list);
44  static KPIM::IdentityManager* identityManager();
45  static bool identitiesExist();
46  static uint identityUoid(const TQString& identityUoidOrName);
47  static TQString controlCentreAddress();
48  static TQString getMailBody(TQ_UINT32 serialNumber);
49  static TQString i18n_NeedFromEmailAddress();
50  static TQString i18n_sent_mail();
51 
52  private:
53  static KPIM::IdentityManager* mIdentityManager; // KMail identity manager
54  static TQString sendKMail(const KAMailData&);
55  static TQString initHeaders(const KAMailData&, bool dateId);
56  static TQString appendBodyAttachments(TQString& message, const KAEvent&);
57  static TQString addToKMailFolder(const KAMailData&, const char* folder, bool checkKmailRunning);
58  static bool callKMail(const TQByteArray& callData, const TQCString& iface, const TQCString& function, const TQCString& funcType);
59  static TQString convertAddress(KMime::Types::Address, EmailAddressList&);
60  static void notifyQueued(const KAEvent&);
61  static char* base64Encode(const char* in, TQIODevice::Offset size, TQIODevice::Offset& outSize);
62  static TQStringList errors(const TQString& error = TQString(), bool sendfail = true);
63 };
64 
65 #endif // KAMAIL_H
KAEvent corresponds to a KCal::Event instance.
Definition: alarmevent.h:232