summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp1
-rw-r--r--noncore/net/mail/accountview.h2
-rw-r--r--noncore/net/mail/imapwrapper.cpp2
-rw-r--r--noncore/net/mail/imapwrapper.h25
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.h25
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.h19
-rw-r--r--noncore/net/mail/mail.pro3
-rw-r--r--noncore/net/mail/mailwrapper.h19
9 files changed, 57 insertions, 41 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index c6a44ab..a531976 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,13 +1,14 @@
1#include "accountview.h" 1#include "accountview.h"
2#include "imapwrapper.h"
2#include "defines.h" 3#include "defines.h"
3 4
4IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent ) 5IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent )
5 : AccountViewItem( parent ) 6 : AccountViewItem( parent )
6{ 7{
7 account = a; 8 account = a;
8 wrapper = new IMAPwrapper( account ); 9 wrapper = new IMAPwrapper( account );
9 setPixmap( 0, PIXMAP_IMAPFOLDER ); 10 setPixmap( 0, PIXMAP_IMAPFOLDER );
10 setText( 0, account->getAccountName() ); 11 setText( 0, account->getAccountName() );
11 setOpen( true ); 12 setOpen( true );
12} 13}
13 14
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h
index 14d8efa..2bc8023 100644
--- a/noncore/net/mail/accountview.h
+++ b/noncore/net/mail/accountview.h
@@ -1,20 +1,22 @@
1#ifndef ACCOUNTVIEW_H 1#ifndef ACCOUNTVIEW_H
2#define ACCOUNTVIEW_H 2#define ACCOUNTVIEW_H
3 3
4#include <qlistview.h> 4#include <qlistview.h>
5 5
6#include "settings.h" 6#include "settings.h"
7#include "mailwrapper.h" 7#include "mailwrapper.h"
8 8
9class IMAPwrapper;
10
9class AccountViewItem : public QListViewItem 11class AccountViewItem : public QListViewItem
10{ 12{
11 13
12public: 14public:
13 AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} 15 AccountViewItem( QListView *parent ) : QListViewItem( parent ) {}
14 AccountViewItem( QListViewItem *parent ) : QListViewItem( parent ) {} 16 AccountViewItem( QListViewItem *parent ) : QListViewItem( parent ) {}
15 virtual void refresh(Maillist&)=0; 17 virtual void refresh(Maillist&)=0;
16 virtual QString fetchBody(const RecMail&)=0; 18 virtual QString fetchBody(const RecMail&)=0;
17}; 19};
18 20
19class IMAPviewItem : public AccountViewItem 21class IMAPviewItem : public AccountViewItem
20{ 22{
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index fc12947..7b78499 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -1,16 +1,16 @@
1 1
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include "mailwrapper.h" 4#include "imapwrapper.h"
5 5
6 6
7IMAPwrapper::IMAPwrapper( IMAPaccount *a ) 7IMAPwrapper::IMAPwrapper( IMAPaccount *a )
8{ 8{
9 account = a; 9 account = a;
10} 10}
11 11
12void imap_progress( size_t current, size_t maximum ) 12void imap_progress( size_t current, size_t maximum )
13{ 13{
14 qDebug( "IMAP: %i of %i", current, maximum ); 14 qDebug( "IMAP: %i of %i", current, maximum );
15} 15}
16 16
diff --git a/noncore/net/mail/imapwrapper.h b/noncore/net/mail/imapwrapper.h
new file mode 100644
index 0000000..65c36e0
--- a/dev/null
+++ b/noncore/net/mail/imapwrapper.h
@@ -0,0 +1,25 @@
1#ifndef __IMAPWRAPPER
2#define __IMAPWRAPPER
3
4#include "mailwrapper.h"
5#include <libetpan/mailimap.h>
6
7class IMAPwrapper : public QObject
8{
9 Q_OBJECT
10
11public:
12 IMAPwrapper( IMAPaccount *a );
13 QList<IMAPFolder>* listFolders();
14 void listMessages(const QString & mailbox,Maillist&target );
15 QString fetchBody(const QString & mailbox,const RecMail&mail);
16
17protected:
18 RecMail*parse_list_result(mailimap_msg_att*);
19
20private:
21 IMAPaccount *account;
22
23};
24
25#endif
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index fc12947..7b78499 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -1,16 +1,16 @@
1 1
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include "mailwrapper.h" 4#include "imapwrapper.h"
5 5
6 6
7IMAPwrapper::IMAPwrapper( IMAPaccount *a ) 7IMAPwrapper::IMAPwrapper( IMAPaccount *a )
8{ 8{
9 account = a; 9 account = a;
10} 10}
11 11
12void imap_progress( size_t current, size_t maximum ) 12void imap_progress( size_t current, size_t maximum )
13{ 13{
14 qDebug( "IMAP: %i of %i", current, maximum ); 14 qDebug( "IMAP: %i of %i", current, maximum );
15} 15}
16 16
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h
new file mode 100644
index 0000000..65c36e0
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.h
@@ -0,0 +1,25 @@
1#ifndef __IMAPWRAPPER
2#define __IMAPWRAPPER
3
4#include "mailwrapper.h"
5#include <libetpan/mailimap.h>
6
7class IMAPwrapper : public QObject
8{
9 Q_OBJECT
10
11public:
12 IMAPwrapper( IMAPaccount *a );
13 QList<IMAPFolder>* listFolders();
14 void listMessages(const QString & mailbox,Maillist&target );
15 QString fetchBody(const QString & mailbox,const RecMail&mail);
16
17protected:
18 RecMail*parse_list_result(mailimap_msg_att*);
19
20private:
21 IMAPaccount *account;
22
23};
24
25#endif
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h
index f45eab7..955a8e2 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.h
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.h
@@ -1,21 +1,20 @@
1#ifndef MAILWRAPPER_H 1#ifndef MAILWRAPPER_H
2#define MAILWRAPPER_H 2#define MAILWRAPPER_H
3 3
4#include <qpe/applnk.h> 4#include <qpe/applnk.h>
5 5
6#include <libetpan/mailmime.h> 6#include <libetpan/mailmime.h>
7#include <libetpan/mailimf.h> 7#include <libetpan/mailimf.h>
8#include <libetpan/mailsmtp.h> 8#include <libetpan/mailsmtp.h>
9#include <libetpan/mailimap.h>
10#include <libetpan/mailstorage.h> 9#include <libetpan/mailstorage.h>
11#include <libetpan/maildriver.h> 10#include <libetpan/maildriver.h>
12#include <qbitarray.h> 11#include <qbitarray.h>
13#include <qdatetime.h> 12#include <qdatetime.h>
14 13
15#include "settings.h" 14#include "settings.h"
16 15
17class Attachment 16class Attachment
18{ 17{
19public: 18public:
20 Attachment( DocLnk lnk ); 19 Attachment( DocLnk lnk );
21 virtual ~Attachment(){} 20 virtual ~Attachment(){}
@@ -153,31 +152,13 @@ private:
153 clist *createRcptList( mailimf_fields *fields ); 152 clist *createRcptList( mailimf_fields *fields );
154 char *getFrom( mailmime *mail ); 153 char *getFrom( mailmime *mail );
155 SMTPaccount *getAccount( QString from ); 154 SMTPaccount *getAccount( QString from );
156 void writeToFile( QString file, mailmime *mail ); 155 void writeToFile( QString file, mailmime *mail );
157 void readFromFile( QString file, char **data, size_t *size ); 156 void readFromFile( QString file, char **data, size_t *size );
158 static QString mailsmtpError( int err ); 157 static QString mailsmtpError( int err );
159 static QString getTmpFile(); 158 static QString getTmpFile();
160 159
161 Settings *settings; 160 Settings *settings;
162 161
163}; 162};
164 163
165class IMAPwrapper : public QObject
166{
167 Q_OBJECT
168
169public:
170 IMAPwrapper( IMAPaccount *a );
171 QList<IMAPFolder>* listFolders();
172 void listMessages(const QString & mailbox,Maillist&target );
173 QString fetchBody(const QString & mailbox,const RecMail&mail);
174
175protected:
176 RecMail*parse_list_result(mailimap_msg_att*);
177
178private:
179 IMAPaccount *account;
180
181};
182
183#endif 164#endif
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 46a476d..2142cdc 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -1,23 +1,24 @@
1 CONFIG += qt warn_on debug quick-app 1 CONFIG += qt warn_on debug quick-app
2 2
3 HEADERS = defines.h \ 3 HEADERS = defines.h \
4 logindialog.h \ 4 logindialog.h \
5 settings.h \ 5 settings.h \
6 editaccounts.h \ 6 editaccounts.h \
7 mailwrapper.h \ 7 mailwrapper.h \
8 composemail.h \ 8 composemail.h \
9 accountview.h \ 9 accountview.h \
10 mainwindow.h \ 10 mainwindow.h \
11 opiemail.h 11 opiemail.h \
12 imapwrapper.h
12 13
13 SOURCES = main.cpp \ 14 SOURCES = main.cpp \
14 opiemail.cpp \ 15 opiemail.cpp \
15 mainwindow.cpp \ 16 mainwindow.cpp \
16 accountview.cpp \ 17 accountview.cpp \
17 composemail.cpp \ 18 composemail.cpp \
18 mailwrapper.cpp \ 19 mailwrapper.cpp \
19 imapwrapper.cpp \ 20 imapwrapper.cpp \
20 addresspicker.cpp \ 21 addresspicker.cpp \
21 editaccounts.cpp \ 22 editaccounts.cpp \
22 logindialog.cpp \ 23 logindialog.cpp \
23 settings.cpp 24 settings.cpp
diff --git a/noncore/net/mail/mailwrapper.h b/noncore/net/mail/mailwrapper.h
index f45eab7..955a8e2 100644
--- a/noncore/net/mail/mailwrapper.h
+++ b/noncore/net/mail/mailwrapper.h
@@ -1,21 +1,20 @@
1#ifndef MAILWRAPPER_H 1#ifndef MAILWRAPPER_H
2#define MAILWRAPPER_H 2#define MAILWRAPPER_H
3 3
4#include <qpe/applnk.h> 4#include <qpe/applnk.h>
5 5
6#include <libetpan/mailmime.h> 6#include <libetpan/mailmime.h>
7#include <libetpan/mailimf.h> 7#include <libetpan/mailimf.h>
8#include <libetpan/mailsmtp.h> 8#include <libetpan/mailsmtp.h>
9#include <libetpan/mailimap.h>
10#include <libetpan/mailstorage.h> 9#include <libetpan/mailstorage.h>
11#include <libetpan/maildriver.h> 10#include <libetpan/maildriver.h>
12#include <qbitarray.h> 11#include <qbitarray.h>
13#include <qdatetime.h> 12#include <qdatetime.h>
14 13
15#include "settings.h" 14#include "settings.h"
16 15
17class Attachment 16class Attachment
18{ 17{
19public: 18public:
20 Attachment( DocLnk lnk ); 19 Attachment( DocLnk lnk );
21 virtual ~Attachment(){} 20 virtual ~Attachment(){}
@@ -153,31 +152,13 @@ private:
153 clist *createRcptList( mailimf_fields *fields ); 152 clist *createRcptList( mailimf_fields *fields );
154 char *getFrom( mailmime *mail ); 153 char *getFrom( mailmime *mail );
155 SMTPaccount *getAccount( QString from ); 154 SMTPaccount *getAccount( QString from );
156 void writeToFile( QString file, mailmime *mail ); 155 void writeToFile( QString file, mailmime *mail );
157 void readFromFile( QString file, char **data, size_t *size ); 156 void readFromFile( QString file, char **data, size_t *size );
158 static QString mailsmtpError( int err ); 157 static QString mailsmtpError( int err );
159 static QString getTmpFile(); 158 static QString getTmpFile();
160 159
161 Settings *settings; 160 Settings *settings;
162 161
163}; 162};
164 163
165class IMAPwrapper : public QObject
166{
167 Q_OBJECT
168
169public:
170 IMAPwrapper( IMAPaccount *a );
171 QList<IMAPFolder>* listFolders();
172 void listMessages(const QString & mailbox,Maillist&target );
173 QString fetchBody(const QString & mailbox,const RecMail&mail);
174
175protected:
176 RecMail*parse_list_result(mailimap_msg_att*);
177
178private:
179 IMAPaccount *account;
180
181};
182
183#endif 164#endif