summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/abstractmail.h
authorzautrix <zautrix>2004-07-03 16:33:12 (UTC)
committer zautrix <zautrix>2004-07-03 16:33:12 (UTC)
commite3b89230f065c48c84b48c88edb6eb088374c487 (patch) (side-by-side diff)
tree162ea2ef909a6f82ccfcedf45d80d6c821174912 /kmicromail/libmailwrapper/abstractmail.h
parent2dd6ac0b2d24c91d35ce674a6c26351352df2b15 (diff)
downloadkdepimpi-e3b89230f065c48c84b48c88edb6eb088374c487.zip
kdepimpi-e3b89230f065c48c84b48c88edb6eb088374c487.tar.gz
kdepimpi-e3b89230f065c48c84b48c88edb6eb088374c487.tar.bz2
Initial revision
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.h b/kmicromail/libmailwrapper/abstractmail.h
new file mode 100644
index 0000000..e5d64a6
--- a/dev/null
+++ b/kmicromail/libmailwrapper/abstractmail.h
@@ -0,0 +1,72 @@
+#ifndef __abstract_mail_
+#define __abstract_mail_
+
+#include "maildefines.h"
+
+#include "settings.h"
+
+#include <qobject.h>
+#include <opie2/osmartpointer.h>
+#include "mailtypes.h"
+
+class IMAPwrapper;
+class POP3wrapper;
+class Folder;
+class encodedString;
+struct folderStat;
+
+class AbstractMail:public QObject
+{
+ Q_OBJECT
+public:
+ AbstractMail(){};
+ virtual ~AbstractMail(){}
+ virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0;
+ virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target )=0;
+ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0;
+ virtual RecBodyP fetchBody(const RecMailP&mail)=0;
+ virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0;
+ virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part)=0;
+ virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part)=0;
+ virtual encodedString* fetchRawBody(const RecMailP&mail)=0;
+
+ virtual void deleteMail(const RecMailP&mail)=0;
+ virtual void answeredMail(const RecMailP&mail)=0;
+ virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0;
+ virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> >&target);
+ virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0;
+ virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0;
+
+ virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,
+ const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
+ virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
+
+ virtual void cleanMimeCache(){};
+ /* mail box methods */
+ /* parameter is the box to create.
+ * if the implementing subclass has prefixes,
+ * them has to be appended automatic.
+ */
+ virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0,
+ const QString& delemiter="/",bool getsubfolder=false);
+ virtual void logout()=0;
+
+ static AbstractMail* getWrapper(IMAPaccount *a);
+ static AbstractMail* getWrapper(POP3account *a);
+ static AbstractMail* getWrapper(NNTPaccount *a);
+ /* mbox only! */
+ static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders");
+ static AbstractMail* getWrapper(Account*a);
+
+ static QString defaultLocalfolder();
+ static QString draftFolder();
+
+ virtual MAILLIB::ATYPE getType()const=0;
+ virtual const QString&getName()const=0;
+
+protected:
+ static encodedString*decode_String(const encodedString*text,const QString&enc);
+ static QString convert_String(const char*text);
+ static QString gen_attachment_id();
+};
+#endif