kalarm

kamail.h

00001 /*
00002  *  kamail.h  -  email functions
00003  *  Program:  kalarm
00004  *  Copyright (c) 2002 - 2005 by David Jarvie <software@astrojar.org.uk>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef KAMAIL_H
00022 #define KAMAIL_H
00023 
00024 #include <qstring.h>
00025 #include <qstringlist.h>
00026 class KAEvent;
00027 class EmailAddressList;
00028 namespace KPIM { class IdentityManager; }
00029 namespace KMime { namespace Types { struct Address; } }
00030 
00031 struct KAMailData;
00032 
00033 
00034 class KAMail
00035 {
00036     public:
00037         static bool        send(const KAEvent&, QStringList& errmsgs, bool allowNotify = true);
00038         static int         checkAddress(QString& address);
00039         static int         checkAttachment(QString& attachment, KURL* = 0);
00040         static bool        checkAttachment(const KURL&);
00041         static QString     convertAddresses(const QString& addresses, EmailAddressList&);
00042         static QString     convertAttachments(const QString& attachments, QStringList& list);
00043         static KPIM::IdentityManager* identityManager();
00044         static bool        identitiesExist();
00045         static QString     controlCentreAddress();
00046         static QString     getMailBody(Q_UINT32 serialNumber);
00047         static QString     i18n_NeedFromEmailAddress();
00048         static QString     i18n_sent_mail();
00049 
00050     private:
00051         static KPIM::IdentityManager* mIdentityManager;     // KMail identity manager
00052         static QString     sendKMail(const KAMailData&);
00053         static QString     initHeaders(const KAMailData&, bool dateId);
00054         static QString     appendBodyAttachments(QString& message, const KAEvent&);
00055         static QString     addToKMailFolder(const KAMailData&, const char* folder, bool checkKmailRunning);
00056         static bool        callKMail(const QByteArray& callData, const QCString& iface, const QCString& function, const QCString& funcType);
00057         static QString     convertAddress(KMime::Types::Address, EmailAddressList&);
00058         static void        notifyQueued(const KAEvent&);
00059         static char*       base64Encode(const char* in, QIODevice::Offset size, QIODevice::Offset& outSize);
00060         static QStringList errors(const QString& error = QString::null, bool sendfail = true);
00061 };
00062 
00063 #endif // KAMAIL_H
KDE Home | KDE Accessibility Home | Description of Access Keys