summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/abstractmail.cpp13
-rw-r--r--noncore/net/mail/abstractmail.h30
-rw-r--r--noncore/net/mail/accountview.cpp16
-rw-r--r--noncore/net/mail/accountview.h15
-rw-r--r--noncore/net/mail/imapwrapper.cpp5
-rw-r--r--noncore/net/mail/imapwrapper.h17
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp13
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.h30
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.h17
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp21
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.h11
-rw-r--r--noncore/net/mail/mail.pro6
-rw-r--r--noncore/net/mail/mainwindow.h1
-rw-r--r--noncore/net/mail/opiemail.h2
-rw-r--r--noncore/net/mail/pop3wrapper.cpp21
-rw-r--r--noncore/net/mail/pop3wrapper.h11
17 files changed, 179 insertions, 55 deletions
diff --git a/noncore/net/mail/abstractmail.cpp b/noncore/net/mail/abstractmail.cpp
new file mode 100644
index 0000000..7380c31
--- a/dev/null
+++ b/noncore/net/mail/abstractmail.cpp
@@ -0,0 +1,13 @@
+#include "abstractmail.h"
+#include "imapwrapper.h"
+#include "pop3wrapper.h"
+
+AbstractMail* AbstractMail::getWrapper(IMAPaccount *a)
+{
+ return new IMAPwrapper(a);
+}
+
+AbstractMail* AbstractMail::getWrapper(POP3account *a)
+{
+ return new POP3wrapper(a);
+}
diff --git a/noncore/net/mail/abstractmail.h b/noncore/net/mail/abstractmail.h
new file mode 100644
index 0000000..bc8938f
--- a/dev/null
+++ b/noncore/net/mail/abstractmail.h
@@ -0,0 +1,30 @@
+#ifndef __abstract_mail_
+#define __abstract_mail_
+
+#include <qobject.h>
+#include "settings.h"
+
+class RecMail;
+class RecBody;
+class RecPart;
+class IMAPwrapper;
+class POP3wrapper;
+class Folder;
+
+class AbstractMail:public QObject
+{
+ Q_OBJECT
+public:
+ AbstractMail(){};
+ virtual ~AbstractMail(){}
+ virtual QList<Folder>* listFolders()=0;
+ virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0;
+ virtual RecBody fetchBody(const RecMail&mail)=0;
+ virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false)=0;
+ virtual QString fetchPart(const RecMail&mail,const RecPart&part)=0;
+
+ static AbstractMail* getWrapper(IMAPaccount *a);
+ static AbstractMail* getWrapper(POP3account *a);
+};
+
+#endif
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index c7b1eeb..1069b9f 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,37 +1,35 @@
#include "accountview.h"
-#include "imapwrapper.h"
-#include "pop3wrapper.h"
#include "mailtypes.h"
#include "defines.h"
/**
* POP3 Account stuff
*/
POP3viewItem::POP3viewItem( POP3account *a, QListView *parent )
: AccountViewItem( parent )
{
account = a;
- wrapper = new POP3wrapper( account );
+ wrapper = AbstractMail::getWrapper( account );
setPixmap( 0, PIXMAP_POP3FOLDER );
setText( 0, account->getAccountName() );
}
POP3viewItem::~POP3viewItem()
{
delete wrapper;
}
void POP3viewItem::refresh( QList<RecMail> &target )
{
qDebug( "POP3: refresh" );
- wrapper->listMessages( target );
+ wrapper->listMessages("INBOX", target );
}
RecBody POP3viewItem::fetchBody( const RecMail &mail )
{
qDebug( "POP3 fetchBody" );
return wrapper->fetchBody( mail );
}
@@ -39,60 +37,60 @@ RecBody POP3viewItem::fetchBody( const RecMail &mail )
/**
* IMAP Account stuff
*/
IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent )
: AccountViewItem( parent )
{
account = a;
- wrapper = new IMAPwrapper( account );
+ wrapper = AbstractMail::getWrapper( account );
setPixmap( 0, PIXMAP_IMAPFOLDER );
setText( 0, account->getAccountName() );
setOpen( true );
}
IMAPviewItem::~IMAPviewItem()
{
delete wrapper;
}
-IMAPwrapper *IMAPviewItem::getWrapper()
+AbstractMail *IMAPviewItem::getWrapper()
{
return wrapper;
}
void IMAPviewItem::refresh(QList<RecMail>&)
{
- QList<IMAPFolder> *folders = wrapper->listFolders();
+ QList<Folder> *folders = wrapper->listFolders();
QListViewItem *child = firstChild();
while ( child ) {
QListViewItem *tmp = child;
child = child->nextSibling();
delete tmp;
}
- IMAPFolder *it;
+ Folder *it;
for ( it = folders->first(); it; it = folders->next() ) {
(void) new IMAPfolderItem( it, this );
}
}
RecBody IMAPviewItem::fetchBody(const RecMail&)
{
return RecBody();
}
IMAPfolderItem::~IMAPfolderItem()
{
delete folder;
}
-IMAPfolderItem::IMAPfolderItem( IMAPFolder *folderInit, IMAPviewItem *parent )
+IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent )
: AccountViewItem( parent )
{
folder = folderInit;
imap = parent;
setPixmap( 0, PIXMAP_IMAPFOLDER );
setText( 0, folder->getDisplayName() );
}
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h
index 4cac673..83d49af 100644
--- a/noncore/net/mail/accountview.h
+++ b/noncore/net/mail/accountview.h
@@ -1,18 +1,18 @@
#ifndef ACCOUNTVIEW_H
#define ACCOUNTVIEW_H
#include <qlistview.h>
#include <qlist.h>
#include "settings.h"
#include "mailwrapper.h"
+#include "abstractmail.h"
-class IMAPwrapper;
class POP3wrapper;
class RecMail;
class RecBody;
class AccountViewItem : public QListViewItem
{
public:
@@ -28,47 +28,44 @@ class POP3viewItem : public AccountViewItem
public:
POP3viewItem( POP3account *a, QListView *parent );
~POP3viewItem();
virtual void refresh( QList<RecMail> &target );
virtual RecBody fetchBody( const RecMail &mail );
private:
POP3account *account;
- POP3wrapper *wrapper;
+ AbstractMail *wrapper;
};
class IMAPviewItem : public AccountViewItem
{
public:
IMAPviewItem( IMAPaccount *a, QListView *parent );
~IMAPviewItem();
virtual void refresh(QList<RecMail>&);
virtual RecBody fetchBody(const RecMail&);
- IMAPwrapper *getWrapper();
-
+ AbstractMail *getWrapper();
private:
IMAPaccount *account;
- IMAPwrapper *wrapper;
-
+ AbstractMail *wrapper;
};
class IMAPfolderItem : public AccountViewItem
{
public:
- IMAPfolderItem( IMAPFolder *folder, IMAPviewItem *parent );
+ IMAPfolderItem( Folder *folder, IMAPviewItem *parent );
~IMAPfolderItem();
virtual void refresh(QList<RecMail>&);
virtual RecBody fetchBody(const RecMail&);
-
private:
- IMAPFolder *folder;
+ Folder *folder;
IMAPviewItem *imap;
};
class AccountView : public QListView
{
Q_OBJECT
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index 48e476b..e5eb335 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -1,16 +1,17 @@
#include <stdlib.h>
#include "imapwrapper.h"
#include "mailtypes.h"
#include <libetpan/mailimap.h>
IMAPwrapper::IMAPwrapper( IMAPaccount *a )
+ : AbstractMail()
{
account = a;
m_imap = 0;
}
IMAPwrapper::~IMAPwrapper()
{
logout();
@@ -134,24 +135,24 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
}
}
} else {
qDebug("Error fetching headers: %s",m_imap->imap_response);
}
mailimap_fetch_list_free(result);
}
-QList<IMAPFolder>* IMAPwrapper::listFolders()
+QList<Folder>* IMAPwrapper::listFolders()
{
const char *path, *mask;
int err = MAILIMAP_NO_ERROR;
clist *result;
clistcell *current;
- QList<IMAPFolder> * folders = new QList<IMAPFolder>();
+ QList<Folder> * folders = new QList<Folder>();
folders->setAutoDelete( true );
login();
if (!m_imap) {
return folders;
}
/*
* First we have to check for INBOX 'cause it sometimes it's not inside the path.
diff --git a/noncore/net/mail/imapwrapper.h b/noncore/net/mail/imapwrapper.h
index 95de215..f88457a 100644
--- a/noncore/net/mail/imapwrapper.h
+++ b/noncore/net/mail/imapwrapper.h
@@ -1,38 +1,35 @@
#ifndef __IMAPWRAPPER
#define __IMAPWRAPPER
#include <qlist.h>
#include "mailwrapper.h"
+#include "abstractmail.h"
struct mailimap;
struct mailimap_body_type_1part;
struct mailimap_body_type_text;
struct mailimap_body_type_basic;
struct mailimap_body_type_msg;
struct mailimap_body_type_mpart;
struct mailimap_body_fields;
struct mailimap_msg_att;
-class RecMail;
-class RecBody;
-class RecPart;
-class IMAPwrapper : public QObject
+class IMAPwrapper : public AbstractMail
{
Q_OBJECT
-
public:
IMAPwrapper( IMAPaccount *a );
virtual ~IMAPwrapper();
- QList<IMAPFolder>* listFolders();
- void listMessages(const QString & mailbox,QList<RecMail>&target );
- RecBody fetchBody(const RecMail&mail);
- QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
- QString fetchPart(const RecMail&mail,const RecPart&part);
+ virtual QList<Folder>* listFolders();
+ virtual void listMessages(const QString & mailbox,QList<RecMail>&target );
+ virtual RecBody fetchBody(const RecMail&mail);
+ virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
+ virtual QString fetchPart(const RecMail&mail,const RecPart&part);
static void imap_progress( size_t current, size_t maximum );
protected:
RecMail*parse_list_result(mailimap_msg_att*);
void login();
void logout();
void searchBodyText(const RecMail&mail,mailimap_body_type_1part*mailDescription,RecBody&target_body);
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
new file mode 100644
index 0000000..7380c31
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -0,0 +1,13 @@
+#include "abstractmail.h"
+#include "imapwrapper.h"
+#include "pop3wrapper.h"
+
+AbstractMail* AbstractMail::getWrapper(IMAPaccount *a)
+{
+ return new IMAPwrapper(a);
+}
+
+AbstractMail* AbstractMail::getWrapper(POP3account *a)
+{
+ return new POP3wrapper(a);
+}
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h
new file mode 100644
index 0000000..bc8938f
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/abstractmail.h
@@ -0,0 +1,30 @@
+#ifndef __abstract_mail_
+#define __abstract_mail_
+
+#include <qobject.h>
+#include "settings.h"
+
+class RecMail;
+class RecBody;
+class RecPart;
+class IMAPwrapper;
+class POP3wrapper;
+class Folder;
+
+class AbstractMail:public QObject
+{
+ Q_OBJECT
+public:
+ AbstractMail(){};
+ virtual ~AbstractMail(){}
+ virtual QList<Folder>* listFolders()=0;
+ virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0;
+ virtual RecBody fetchBody(const RecMail&mail)=0;
+ virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false)=0;
+ virtual QString fetchPart(const RecMail&mail,const RecPart&part)=0;
+
+ static AbstractMail* getWrapper(IMAPaccount *a);
+ static AbstractMail* getWrapper(POP3account *a);
+};
+
+#endif
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 48e476b..e5eb335 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -1,16 +1,17 @@
#include <stdlib.h>
#include "imapwrapper.h"
#include "mailtypes.h"
#include <libetpan/mailimap.h>
IMAPwrapper::IMAPwrapper( IMAPaccount *a )
+ : AbstractMail()
{
account = a;
m_imap = 0;
}
IMAPwrapper::~IMAPwrapper()
{
logout();
@@ -134,24 +135,24 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
}
}
} else {
qDebug("Error fetching headers: %s",m_imap->imap_response);
}
mailimap_fetch_list_free(result);
}
-QList<IMAPFolder>* IMAPwrapper::listFolders()
+QList<Folder>* IMAPwrapper::listFolders()
{
const char *path, *mask;
int err = MAILIMAP_NO_ERROR;
clist *result;
clistcell *current;
- QList<IMAPFolder> * folders = new QList<IMAPFolder>();
+ QList<Folder> * folders = new QList<Folder>();
folders->setAutoDelete( true );
login();
if (!m_imap) {
return folders;
}
/*
* First we have to check for INBOX 'cause it sometimes it's not inside the path.
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h
index 95de215..f88457a 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.h
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.h
@@ -1,38 +1,35 @@
#ifndef __IMAPWRAPPER
#define __IMAPWRAPPER
#include <qlist.h>
#include "mailwrapper.h"
+#include "abstractmail.h"
struct mailimap;
struct mailimap_body_type_1part;
struct mailimap_body_type_text;
struct mailimap_body_type_basic;
struct mailimap_body_type_msg;
struct mailimap_body_type_mpart;
struct mailimap_body_fields;
struct mailimap_msg_att;
-class RecMail;
-class RecBody;
-class RecPart;
-class IMAPwrapper : public QObject
+class IMAPwrapper : public AbstractMail
{
Q_OBJECT
-
public:
IMAPwrapper( IMAPaccount *a );
virtual ~IMAPwrapper();
- QList<IMAPFolder>* listFolders();
- void listMessages(const QString & mailbox,QList<RecMail>&target );
- RecBody fetchBody(const RecMail&mail);
- QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
- QString fetchPart(const RecMail&mail,const RecPart&part);
+ virtual QList<Folder>* listFolders();
+ virtual void listMessages(const QString & mailbox,QList<RecMail>&target );
+ virtual RecBody fetchBody(const RecMail&mail);
+ virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
+ virtual QString fetchPart(const RecMail&mail,const RecPart&part);
static void imap_progress( size_t current, size_t maximum );
protected:
RecMail*parse_list_result(mailimap_msg_att*);
void login();
void logout();
void searchBodyText(const RecMail&mail,mailimap_body_type_1part*mailDescription,RecBody&target_body);
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index abb5a42..49c3b7a 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -54,17 +54,17 @@ RecBody POP3wrapper::parseBody( const char *message )
qDebug( "POP3: bodytext found" );
// TODO: why does this line segfault???? gdb says segfault in strlen(), maybe a bug in libetpan.
body.setBodytext( QString( result->msg_body->bd_text ) );
}
return body;
}
-void POP3wrapper::listMessages( QList<RecMail> &target )
+void POP3wrapper::listMessages(const QString &, QList<RecMail> &target )
{
int err = MAILPOP3_NO_ERROR;
char *header;
size_t length;
carray *messages;
login();
if (!m_pop3) return;
@@ -263,8 +263,27 @@ void POP3wrapper::logout()
{
int err = MAILPOP3_NO_ERROR;
if ( m_pop3 == NULL ) return;
err = mailpop3_quit( m_pop3 );
mailpop3_free( m_pop3 );
m_pop3 = NULL;
}
+
+QList<Folder>* POP3wrapper::listFolders()
+{
+ QList<Folder> * folders = new QList<Folder>();
+ folders->setAutoDelete( true );
+ Folder*inb=new Folder("INBOX");
+ folders->append(inb);
+ return folders;
+}
+
+QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool)
+{
+ return "";
+}
+
+QString POP3wrapper::fetchPart(const RecMail&,const RecPart&)
+{
+ return "";
+}
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h
index 995bed0..3b24564 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.h
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h
@@ -1,25 +1,31 @@
#ifndef __POP3WRAPPER
#define __POP3WRAPPER
#include "mailwrapper.h"
+#include "abstractmail.h"
class RecMail;
class RecBody;
struct mailpop3;
-class POP3wrapper : public QObject
+class POP3wrapper : public AbstractMail
{
Q_OBJECT
public:
POP3wrapper( POP3account *a );
virtual ~POP3wrapper();
- void listMessages( QList<RecMail> &target );
+ /* mailbox will be ignored */
+ virtual void listMessages(const QString & mailbox, QList<RecMail> &target );
+ virtual QList<Folder>* listFolders();
+ virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
+ virtual QString fetchPart(const RecMail&mail,const RecPart&part);
+
RecBody fetchBody( const RecMail &mail );
static void pop3_progress( size_t current, size_t maximum );
protected:
void login();
void logout();
private:
@@ -27,12 +33,11 @@ private:
RecBody parseBody( const char *message );
QString parseMailboxList( mailimf_mailbox_list *list );
QString parseMailbox( mailimf_mailbox *box );
QString parseGroup( mailimf_group *group );
QString parseAddressList( mailimf_address_list *list );
QString parseDateTime( mailimf_date_time *date );
POP3account *account;
mailpop3 *m_pop3;
-
};
#endif
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 0e7cff6..e7519c6 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -9,33 +9,35 @@ HEADERS = defines.h \
accountview.h \
mainwindow.h \
viewmail.h \
viewmailbase.h \
opiemail.h \
imapwrapper.h \
mailtypes.h \
mailistviewitem.h \
- pop3wrapper.h
+ pop3wrapper.h \
+ abstractmail.h
SOURCES = main.cpp \
opiemail.cpp \
mainwindow.cpp \
accountview.cpp \
composemail.cpp \
mailwrapper.cpp \
imapwrapper.cpp \
addresspicker.cpp \
editaccounts.cpp \
logindialog.cpp \
viewmail.cpp \
viewmailbase.cpp \
settings.cpp \
mailtypes.cpp \
- pop3wrapper.cpp
+ pop3wrapper.cpp \
+ abstractmail.cpp
INTERFACES = editaccountsui.ui \
selectmailtypeui.ui \
imapconfigui.ui \
pop3configui.ui \
nntpconfigui.ui \
smtpconfigui.ui \
addresspickerui.ui \
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h
index 74bce5a..6c1cda0 100644
--- a/noncore/net/mail/mainwindow.h
+++ b/noncore/net/mail/mainwindow.h
@@ -13,17 +13,16 @@
class RecMail;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
- static QString appName() { return QString::fromLatin1("opiemail"); }
public slots:
void slotAdjustColumns();
protected slots:
virtual void slotShowFolders( bool show );
virtual void refreshMailView(QList<RecMail>*);
virtual void displayMail(QListViewItem*);
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h
index dcab47c..7bcd818 100644
--- a/noncore/net/mail/opiemail.h
+++ b/noncore/net/mail/opiemail.h
@@ -5,19 +5,17 @@
#include "settings.h"
class OpieMail : public MainWindow
{
Q_OBJECT
public:
OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
-
static QString appName() { return QString::fromLatin1("opiemail"); }
-
protected slots:
void slotComposeMail();
void slotSendQueued();
void slotSearchMails();
void slotEditSettings();
void slotEditAccounts();
private:
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp
index abb5a42..49c3b7a 100644
--- a/noncore/net/mail/pop3wrapper.cpp
+++ b/noncore/net/mail/pop3wrapper.cpp
@@ -54,17 +54,17 @@ RecBody POP3wrapper::parseBody( const char *message )
qDebug( "POP3: bodytext found" );
// TODO: why does this line segfault???? gdb says segfault in strlen(), maybe a bug in libetpan.
body.setBodytext( QString( result->msg_body->bd_text ) );
}
return body;
}
-void POP3wrapper::listMessages( QList<RecMail> &target )
+void POP3wrapper::listMessages(const QString &, QList<RecMail> &target )
{
int err = MAILPOP3_NO_ERROR;
char *header;
size_t length;
carray *messages;
login();
if (!m_pop3) return;
@@ -263,8 +263,27 @@ void POP3wrapper::logout()
{
int err = MAILPOP3_NO_ERROR;
if ( m_pop3 == NULL ) return;
err = mailpop3_quit( m_pop3 );
mailpop3_free( m_pop3 );
m_pop3 = NULL;
}
+
+QList<Folder>* POP3wrapper::listFolders()
+{
+ QList<Folder> * folders = new QList<Folder>();
+ folders->setAutoDelete( true );
+ Folder*inb=new Folder("INBOX");
+ folders->append(inb);
+ return folders;
+}
+
+QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool)
+{
+ return "";
+}
+
+QString POP3wrapper::fetchPart(const RecMail&,const RecPart&)
+{
+ return "";
+}
diff --git a/noncore/net/mail/pop3wrapper.h b/noncore/net/mail/pop3wrapper.h
index 995bed0..3b24564 100644
--- a/noncore/net/mail/pop3wrapper.h
+++ b/noncore/net/mail/pop3wrapper.h
@@ -1,25 +1,31 @@
#ifndef __POP3WRAPPER
#define __POP3WRAPPER
#include "mailwrapper.h"
+#include "abstractmail.h"
class RecMail;
class RecBody;
struct mailpop3;
-class POP3wrapper : public QObject
+class POP3wrapper : public AbstractMail
{
Q_OBJECT
public:
POP3wrapper( POP3account *a );
virtual ~POP3wrapper();
- void listMessages( QList<RecMail> &target );
+ /* mailbox will be ignored */
+ virtual void listMessages(const QString & mailbox, QList<RecMail> &target );
+ virtual QList<Folder>* listFolders();
+ virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
+ virtual QString fetchPart(const RecMail&mail,const RecPart&part);
+
RecBody fetchBody( const RecMail &mail );
static void pop3_progress( size_t current, size_t maximum );
protected:
void login();
void logout();
private:
@@ -27,12 +33,11 @@ private:
RecBody parseBody( const char *message );
QString parseMailboxList( mailimf_mailbox_list *list );
QString parseMailbox( mailimf_mailbox *box );
QString parseGroup( mailimf_group *group );
QString parseAddressList( mailimf_address_list *list );
QString parseDateTime( mailimf_date_time *date );
POP3account *account;
mailpop3 *m_pop3;
-
};
#endif