summaryrefslogtreecommitdiff
authorharlekin <harlekin>2004-01-04 02:46:56 (UTC)
committer harlekin <harlekin>2004-01-04 02:46:56 (UTC)
commitcda867a4d179eb3320c5a043cb9116014fa736b8 (patch) (unidiff)
tree1dafac9c041634e19fab18759f181c41500346a5
parent7bfc0889cf761e20402f775a46c8b8508c48ed8f (diff)
downloadopie-cda867a4d179eb3320c5a043cb9116014fa736b8.zip
opie-cda867a4d179eb3320c5a043cb9116014fa736b8.tar.gz
opie-cda867a4d179eb3320c5a043cb9116014fa736b8.tar.bz2
adapted includes to the new lib
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp10
-rw-r--r--noncore/net/mail/accountview.h6
-rw-r--r--noncore/net/mail/composemail.cpp11
-rw-r--r--noncore/net/mail/composemail.h5
-rw-r--r--noncore/net/mail/editaccounts.h3
-rw-r--r--noncore/net/mail/mail.pro4
-rw-r--r--noncore/net/mail/mailistviewitem.h3
-rw-r--r--noncore/net/mail/mainwindow.cpp3
-rw-r--r--noncore/net/mail/opiemail.cpp2
-rw-r--r--noncore/net/mail/opiemail.h3
-rw-r--r--noncore/net/mail/viewmail.cpp6
-rw-r--r--noncore/net/mail/viewmail.h3
12 files changed, 33 insertions, 26 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 9f07f56..2ce89db 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,19 +1,19 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include "accountview.h" 2#include "accountview.h"
3#include "mailtypes.h" 3#include <libmailwrapper/mailtypes.h>
4#include "defines.h" 4#include "defines.h"
5#include "newmaildir.h" 5#include "newmaildir.h"
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qpopupmenu.h> 7#include <qpopupmenu.h>
8 8
9/** 9/**
10 * POP3 Account stuff 10 * POP3 Account stuff
11 */ 11 */
12POP3viewItem::POP3viewItem( POP3account *a, QListView *parent ) 12POP3viewItem::POP3viewItem( POP3account *a, QListView *parent )
13 : AccountViewItem( parent ) 13 : AccountViewItem( parent )
14{ 14{
15 account = a; 15 account = a;
16 wrapper = AbstractMail::getWrapper( account ); 16 wrapper = AbstractMail::getWrapper( account );
17 setPixmap( 0, PIXMAP_POP3FOLDER ); 17 setPixmap( 0, PIXMAP_POP3FOLDER );
18 setText( 0, account->getAccountName() ); 18 setText( 0, account->getAccountName() );
19 setOpen( true ); 19 setOpen( true );
@@ -150,47 +150,47 @@ IMAPfolderItem*IMAPviewItem::findSubItem(const QString&path,IMAPfolderItem*start
150 } 150 }
151 pitem=(IMAPfolderItem*)pitem->nextSibling(); 151 pitem=(IMAPfolderItem*)pitem->nextSibling();
152 } 152 }
153 return pitem; 153 return pitem;
154} 154}
155 155
156void IMAPviewItem::refresh(QList<RecMail>&) 156void IMAPviewItem::refresh(QList<RecMail>&)
157{ 157{
158 refreshFolders(false); 158 refreshFolders(false);
159} 159}
160 160
161void IMAPviewItem::refreshFolders(bool force) 161void IMAPviewItem::refreshFolders(bool force)
162{ 162{
163 if (childCount()>0 && force==false) return; 163 if (childCount()>0 && force==false) return;
164 QList<Folder> *folders = wrapper->listFolders(); 164 QList<Folder> *folders = wrapper->listFolders();
165 165
166 QListViewItem *child = firstChild(); 166 QListViewItem *child = firstChild();
167 while ( child ) { 167 while ( child ) {
168 QListViewItem *tmp = child; 168 QListViewItem *tmp = child;
169 child = child->nextSibling(); 169 child = child->nextSibling();
170 delete tmp; 170 delete tmp;
171 } 171 }
172 172
173 Folder *it; 173 Folder *it;
174 QListViewItem*item = 0; 174 QListViewItem*item = 0;
175 QListViewItem*titem = 0; 175 QListViewItem*titem = 0;
176 QString fname,del,search; 176 QString fname,del,search;
177 int pos; 177 int pos;
178 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 178 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
179 folders->setAutoDelete(false); 179 folders->setAutoDelete(false);
180 180
181 for ( it = folders->first(); it; it = folders->next() ) { 181 for ( it = folders->first(); it; it = folders->next() ) {
182 if (it->getDisplayName().lower()=="inbox") { 182 if (it->getDisplayName().lower()=="inbox") {
183 item = new IMAPfolderItem( it, this , item ); 183 item = new IMAPfolderItem( it, this , item );
184 folders->remove(it); 184 folders->remove(it);
185 qDebug("inbox found"); 185 qDebug("inbox found");
186 break; 186 break;
187 } 187 }
188 } 188 }
189 for ( it = folders->first(); it; it = folders->next() ) { 189 for ( it = folders->first(); it; it = folders->next() ) {
190 fname = it->getDisplayName(); 190 fname = it->getDisplayName();
191 pos = fname.findRev(it->Separator()); 191 pos = fname.findRev(it->Separator());
192 if (pos != -1) { 192 if (pos != -1) {
193 fname = fname.left(pos); 193 fname = fname.left(pos);
194 } 194 }
195 IMAPfolderItem*pitem = findSubItem(fname); 195 IMAPfolderItem*pitem = findSubItem(fname);
196 if (pitem) { 196 if (pitem) {
@@ -404,33 +404,33 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,Folder*folder)
404 QObject::tr("No",contextName),QString::null,1,1); 404 QObject::tr("No",contextName),QString::null,1,1);
405 qDebug("Auswahl: %i",yesno); 405 qDebug("Auswahl: %i",yesno);
406 if (yesno == 0) { 406 if (yesno == 0) {
407 if (wrapper->deleteAllMail(folder)) { 407 if (wrapper->deleteAllMail(folder)) {
408 AccountView * view = (AccountView*)listView(); 408 AccountView * view = (AccountView*)listView();
409 if (view) view->refreshCurrent(); 409 if (view) view->refreshCurrent();
410 } 410 }
411 } 411 }
412} 412}
413 413
414AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 414AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
415 : QListView( parent, name, flags ) 415 : QListView( parent, name, flags )
416{ 416{
417 connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), 417 connect( this, SIGNAL( selectionChanged( QListViewItem * ) ),
418 SLOT( refresh( QListViewItem * ) ) ); 418 SLOT( refresh( QListViewItem * ) ) );
419 connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, 419 connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this,
420 SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) ); 420 SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) );
421 421
422 setSorting(0); 422 setSorting(0);
423} 423}
424 424
425void AccountView::slotContextMenu(int id) 425void AccountView::slotContextMenu(int id)
426{ 426{
427 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); 427 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
428 if (!view) return; 428 if (!view) return;
429 view->contextMenuSelected(id); 429 view->contextMenuSelected(id);
430} 430}
431 431
432void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) 432void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int)
433{ 433{
434 if (button==1) {return;} 434 if (button==1) {return;}
435 if (!item) return; 435 if (!item) return;
436 AccountViewItem *view = static_cast<AccountViewItem *>(item); 436 AccountViewItem *view = static_cast<AccountViewItem *>(item);
@@ -594,33 +594,33 @@ void MBOXviewItem::contextMenuSelected(int which)
594 594
595MBOXfolderItem::~MBOXfolderItem() 595MBOXfolderItem::~MBOXfolderItem()
596{ 596{
597 delete folder; 597 delete folder;
598} 598}
599 599
600MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after ) 600MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after )
601 : AccountViewItem( parent,after ) 601 : AccountViewItem( parent,after )
602{ 602{
603 folder = folderInit; 603 folder = folderInit;
604 mbox = parent; 604 mbox = parent;
605 if (folder->getDisplayName().lower() == "outgoing") { 605 if (folder->getDisplayName().lower() == "outgoing") {
606 setPixmap( 0, PIXMAP_OUTBOXFOLDER ); 606 setPixmap( 0, PIXMAP_OUTBOXFOLDER );
607 } else if (folder->getDisplayName().lower() == "inbox") { 607 } else if (folder->getDisplayName().lower() == "inbox") {
608 setPixmap( 0, PIXMAP_INBOXFOLDER); 608 setPixmap( 0, PIXMAP_INBOXFOLDER);
609 } else { 609 } else {
610 setPixmap( 0, PIXMAP_MBOXFOLDER ); 610 setPixmap( 0, PIXMAP_MBOXFOLDER );
611 } 611 }
612 setText( 0, folder->getDisplayName() ); 612 setText( 0, folder->getDisplayName() );
613} 613}
614 614
615void MBOXfolderItem::refresh(QList<RecMail>&target) 615void MBOXfolderItem::refresh(QList<RecMail>&target)
616{ 616{
617 if (folder->may_select()) 617 if (folder->may_select())
618 mbox->getWrapper()->listMessages( folder->getName(),target ); 618 mbox->getWrapper()->listMessages( folder->getName(),target );
619} 619}
620 620
621RecBody MBOXfolderItem::fetchBody(const RecMail&aMail) 621RecBody MBOXfolderItem::fetchBody(const RecMail&aMail)
622{ 622{
623 return mbox->getWrapper()->fetchBody(aMail); 623 return mbox->getWrapper()->fetchBody(aMail);
624} 624}
625 625
626void MBOXfolderItem::deleteFolder() 626void MBOXfolderItem::deleteFolder()
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h
index 361dd86..1d2bf19 100644
--- a/noncore/net/mail/accountview.h
+++ b/noncore/net/mail/accountview.h
@@ -1,25 +1,25 @@
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#include <qlist.h> 5#include <qlist.h>
6 6
7#include "settings.h" 7#include <libmailwrapper/settings.h>
8#include "mailwrapper.h" 8#include <libmailwrapper/mailwrapper.h>
9#include "abstractmail.h" 9#include <libmailwrapper/abstractmail.h>
10 10
11class POP3wrapper; 11class POP3wrapper;
12class RecMail; 12class RecMail;
13class RecBody; 13class RecBody;
14class QPopupMenu; 14class QPopupMenu;
15 15
16class AccountViewItem : public QListViewItem 16class AccountViewItem : public QListViewItem
17{ 17{
18 18
19public: 19public:
20 AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} 20 AccountViewItem( QListView *parent ) : QListViewItem( parent ) {}
21 AccountViewItem( QListViewItem *parent) : QListViewItem( parent) {} 21 AccountViewItem( QListViewItem *parent) : QListViewItem( parent) {}
22 AccountViewItem( QListViewItem *parent , QListViewItem*after ) : QListViewItem( parent,after ) {} 22 AccountViewItem( QListViewItem *parent , QListViewItem*after ) : QListViewItem( parent,after ) {}
23 virtual void refresh(QList<RecMail>&)=0; 23 virtual void refresh(QList<RecMail>&)=0;
24 virtual RecBody fetchBody(const RecMail&)=0; 24 virtual RecBody fetchBody(const RecMail&)=0;
25 virtual QPopupMenu * getContextMenu(){return 0;}; 25 virtual QPopupMenu * getContextMenu(){return 0;};
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 13c7900..5e823e8 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -1,61 +1,62 @@
1#include <qt.h> 1#include <qt.h>
2 2
3#include <opie/ofiledialog.h> 3#include <opie/ofiledialog.h>
4#include <qpe/resource.h> 4#include <qpe/resource.h>
5#include <qpe/config.h> 5#include <qpe/config.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <qpe/contact.h> 7#include <qpe/contact.h>
8 8
9#include "composemail.h" 9#include "composemail.h"
10#include "smtpwrapper.h" 10
11#include <libmailwrapper/smtpwrapper.h>
11 12
12ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 13ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
13 : ComposeMailUI( parent, name, modal, flags ) 14 : ComposeMailUI( parent, name, modal, flags )
14{ 15{
15 settings = s; 16 settings = s;
16 17
17 QString vfilename = Global::applicationFileName("addressbook", 18 QString vfilename = Global::applicationFileName("addressbook",
18 "businesscard.vcf"); 19 "businesscard.vcf");
19 Contact c; 20 Contact c;
20 if (QFile::exists(vfilename)) { 21 if (QFile::exists(vfilename)) {
21 c = Contact::readVCard( vfilename )[0]; 22 c = Contact::readVCard( vfilename )[0];
22 } 23 }
23 24
24 QStringList mails = c.emailList(); 25 QStringList mails = c.emailList();
25 QString defmail = c.defaultEmail(); 26 QString defmail = c.defaultEmail();
26 27
27 if (defmail.length()!=0) { 28 if (defmail.length()!=0) {
28 fromBox->insertItem(defmail); 29 fromBox->insertItem(defmail);
29 } 30 }
30 QStringList::ConstIterator sit = mails.begin(); 31 QStringList::ConstIterator sit = mails.begin();
31 for (;sit!=mails.end();++sit) { 32 for (;sit!=mails.end();++sit) {
32 if ( (*sit)==defmail) 33 if ( (*sit)==defmail)
33 continue; 34 continue;
34 fromBox->insertItem((*sit)); 35 fromBox->insertItem((*sit));
35 } 36 }
36 senderNameEdit->setText(c.firstName()+" "+c.lastName()); 37 senderNameEdit->setText(c.firstName()+" "+c.lastName());
37 Config cfg( "mail" ); 38 Config cfg( "mail" );
38 cfg.setGroup( "Compose" ); 39 cfg.setGroup( "Compose" );
39 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 40 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
40 41
41 attList->addColumn( tr( "Name" ) ); 42 attList->addColumn( tr( "Name" ) );
42 attList->addColumn( tr( "Size" ) ); 43 attList->addColumn( tr( "Size" ) );
43 44
44 QList<Account> accounts = settings->getAccounts(); 45 QList<Account> accounts = settings->getAccounts();
45 46
46 Account *it; 47 Account *it;
47 for ( it = accounts.first(); it; it = accounts.next() ) { 48 for ( it = accounts.first(); it; it = accounts.next() ) {
48 if ( it->getType().compare( "SMTP" ) == 0 ) { 49 if ( it->getType().compare( "SMTP" ) == 0 ) {
49 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 50 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
50 smtpAccountBox->insertItem( smtp->getAccountName() ); 51 smtpAccountBox->insertItem( smtp->getAccountName() );
51 smtpAccounts.append( smtp ); 52 smtpAccounts.append( smtp );
52 } 53 }
53 } 54 }
54 55
55 if ( smtpAccounts.count() > 0 ) { 56 if ( smtpAccounts.count() > 0 ) {
56 fillValues( smtpAccountBox->currentItem() ); 57 fillValues( smtpAccountBox->currentItem() );
57 } else { 58 } else {
58 QMessageBox::information( this, tr( "Problem" ), 59 QMessageBox::information( this, tr( "Problem" ),
59 tr( "<p>Please create an SMTP account first.</p>" ), 60 tr( "<p>Please create an SMTP account first.</p>" ),
60 tr( "Ok" ) ); 61 tr( "Ok" ) );
61 return; 62 return;
@@ -178,62 +179,62 @@ void ComposeMail::removeAttachment()
178 } else { 179 } else {
179 attList->takeItem( attList->currentItem() ); 180 attList->takeItem( attList->currentItem() );
180 } 181 }
181} 182}
182 183
183void ComposeMail::accept() 184void ComposeMail::accept()
184{ 185{
185 if ( checkBoxLater->isChecked() ) { 186 if ( checkBoxLater->isChecked() ) {
186 qDebug( "Send later" ); 187 qDebug( "Send later" );
187 } 188 }
188 189
189#if 0 190#if 0
190 qDebug( "Sending Mail with " + 191 qDebug( "Sending Mail with " +
191 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 192 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
192#endif 193#endif
193 Mail *mail = new Mail(); 194 Mail *mail = new Mail();
194 195
195 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 196 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
196 mail->setMail(fromBox->currentText()); 197 mail->setMail(fromBox->currentText());
197 198
198 if ( !toLine->text().isEmpty() ) { 199 if ( !toLine->text().isEmpty() ) {
199 mail->setTo( toLine->text() ); 200 mail->setTo( toLine->text() );
200 } else { 201 } else {
201 qDebug( "No Reciever spezified -> returning" ); 202 qDebug( "No Reciever spezified -> returning" );
202 return; 203 return;
203 } 204 }
204 mail->setName(senderNameEdit->text()); 205 mail->setName(senderNameEdit->text());
205 mail->setCC( ccLine->text() ); 206 mail->setCC( ccLine->text() );
206 mail->setBCC( bccLine->text() ); 207 mail->setBCC( bccLine->text() );
207 mail->setReply( replyLine->text() ); 208 mail->setReply( replyLine->text() );
208 mail->setSubject( subjectLine->text() ); 209 mail->setSubject( subjectLine->text() );
209 QString txt = message->text(); 210 QString txt = message->text();
210 if ( !sigMultiLine->text().isEmpty() ) { 211 if ( !sigMultiLine->text().isEmpty() ) {
211 txt.append( "\n--\n" ); 212 txt.append( "\n--\n" );
212 txt.append( sigMultiLine->text() ); 213 txt.append( sigMultiLine->text() );
213 } 214 }
214 qDebug(txt); 215 qDebug(txt);
215 mail->setMessage( txt ); 216 mail->setMessage( txt );
216 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 217 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
217 while ( it != NULL ) { 218 while ( it != NULL ) {
218 mail->addAttachment( it->getAttachment() ); 219 mail->addAttachment( it->getAttachment() );
219 it = (AttachViewItem *) it->nextSibling(); 220 it = (AttachViewItem *) it->nextSibling();
220 } 221 }
221 222
222 SMTPwrapper wrapper( settings ); 223 SMTPwrapper wrapper( settings );
223 wrapper.sendMail( *mail,smtp,checkBoxLater->isChecked() ); 224 wrapper.sendMail( *mail,smtp,checkBoxLater->isChecked() );
224 225
225 QDialog::accept(); 226 QDialog::accept();
226} 227}
227 228
228AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) 229AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
229 : QListViewItem( parent ) 230 : QListViewItem( parent )
230{ 231{
231 attachment = att; 232 attachment = att;
232 qDebug( att->getMimeType() ); 233 qDebug( att->getMimeType() );
233 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ? 234 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ?
234 Resource::loadPixmap( "UnknownDocument-14" ) : 235 Resource::loadPixmap( "UnknownDocument-14" ) :
235 attachment->getDocLnk().pixmap() ); 236 attachment->getDocLnk().pixmap() );
236 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); 237 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() );
237 setText( 1, QString::number( att->getSize() ) ); 238 setText( 1, QString::number( att->getSize() ) );
238} 239}
239 240
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h
index 230e397..604c862 100644
--- a/noncore/net/mail/composemail.h
+++ b/noncore/net/mail/composemail.h
@@ -1,26 +1,27 @@
1#ifndef COMPOSEMAIL_H 1#ifndef COMPOSEMAIL_H
2#define COMPOSEMAIL_H 2#define COMPOSEMAIL_H
3 3
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qlistview.h> 5#include <qlistview.h>
6 6
7#include "composemailui.h" 7#include "composemailui.h"
8#include "addresspickerui.h" 8#include "addresspickerui.h"
9#include "settings.h" 9#include <libmailwrapper/settings.h>
10#include "mailwrapper.h" 10#include <libmailwrapper/mailwrapper.h>
11
11 12
12 13
13class AddressPicker : public AddressPickerUI 14class AddressPicker : public AddressPickerUI
14{ 15{
15 Q_OBJECT 16 Q_OBJECT
16 17
17public: 18public:
18 AddressPicker( QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); 19 AddressPicker( QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 );
19 static QString getNames(); 20 static QString getNames();
20 21
21protected: 22protected:
22 QString selectedNames; 23 QString selectedNames;
23 void accept(); 24 void accept();
24 25
25}; 26};
26 27
diff --git a/noncore/net/mail/editaccounts.h b/noncore/net/mail/editaccounts.h
index 10ed8b8..6022eef 100644
--- a/noncore/net/mail/editaccounts.h
+++ b/noncore/net/mail/editaccounts.h
@@ -1,29 +1,30 @@
1#ifndef EDITACCOUNTS_H 1#ifndef EDITACCOUNTS_H
2#define EDITACCOUNTS_H 2#define EDITACCOUNTS_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qlistview.h> 5#include <qlistview.h>
6 6
7#include "editaccountsui.h" 7#include "editaccountsui.h"
8#include "selectmailtypeui.h" 8#include "selectmailtypeui.h"
9#include "imapconfigui.h" 9#include "imapconfigui.h"
10#include "pop3configui.h" 10#include "pop3configui.h"
11#include "smtpconfigui.h" 11#include "smtpconfigui.h"
12#include "nntpconfigui.h" 12#include "nntpconfigui.h"
13#include "settings.h" 13#include <libmailwrapper/settings.h>
14
14 15
15class AccountListItem : public QListViewItem 16class AccountListItem : public QListViewItem
16{ 17{
17 18
18public: 19public:
19 AccountListItem( QListView *parent, Account *a); 20 AccountListItem( QListView *parent, Account *a);
20 Account *getAccount() { return account; } 21 Account *getAccount() { return account; }
21 22
22private: 23private:
23 Account *account; 24 Account *account;
24 25
25}; 26};
26 27
27class EditAccounts : public EditAccountsUI 28class EditAccounts : public EditAccountsUI
28{ 29{
29 Q_OBJECT 30 Q_OBJECT
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 69e1450..a96c88e 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -29,24 +29,24 @@ SOURCES = main.cpp \
29INTERFACES = editaccountsui.ui \ 29INTERFACES = editaccountsui.ui \
30 selectmailtypeui.ui \ 30 selectmailtypeui.ui \
31 imapconfigui.ui \ 31 imapconfigui.ui \
32 pop3configui.ui \ 32 pop3configui.ui \
33 nntpconfigui.ui \ 33 nntpconfigui.ui \
34 smtpconfigui.ui \ 34 smtpconfigui.ui \
35 addresspickerui.ui \ 35 addresspickerui.ui \
36 composemailui.ui \ 36 composemailui.ui \
37 settingsdialogui.ui \ 37 settingsdialogui.ui \
38 statuswidgetui.ui \ 38 statuswidgetui.ui \
39 newmaildirui.ui 39 newmaildirui.ui
40 40
41INCLUDEPATH += $(OPIEDIR)/include 41INCLUDEPATH += $(OPIEDIR)/include
42 42
43CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) 43CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
44contains( CONFTEST, y ){ 44contains( CONFTEST, y ){
45 LIBS += -lqpe -letpan -lssl -lcrypto -lopie -liconv 45 LIBS += -lqpe -lopie -lmailwrapper -liconv
46}else{ 46}else{
47 LIBS += -lqpe -lopie -llibmailwrapper 47 LIBS += -lqpe -lopie -lmailwrapper
48} 48}
49 49
50TARGET = opiemail 50TARGET = opiemail
51 51
52include ( $(OPIEDIR)/include.pro ) 52include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/mailistviewitem.h b/noncore/net/mail/mailistviewitem.h
index 60bfdda..271f616 100644
--- a/noncore/net/mail/mailistviewitem.h
+++ b/noncore/net/mail/mailistviewitem.h
@@ -1,21 +1,22 @@
1#ifndef __MAILLISTVIEWITEM_H 1#ifndef __MAILLISTVIEWITEM_H
2#define __MAILLISTVIEWITEM_H 2#define __MAILLISTVIEWITEM_H
3 3
4#include <qlistview.h> 4#include <qlistview.h>
5#include "mailtypes.h" 5#include <libmailwrapper/mailtypes.h>
6
6 7
7class MailListViewItem:public QListViewItem 8class MailListViewItem:public QListViewItem
8{ 9{
9public: 10public:
10 MailListViewItem(QListView * parent, MailListViewItem * after ); 11 MailListViewItem(QListView * parent, MailListViewItem * after );
11 virtual ~MailListViewItem(){} 12 virtual ~MailListViewItem(){}
12 13
13 void storeData(const RecMail&data); 14 void storeData(const RecMail&data);
14 const RecMail&data()const; 15 const RecMail&data()const;
15 void showEntry(); 16 void showEntry();
16 17
17protected: 18protected:
18 RecMail mail_data; 19 RecMail mail_data;
19}; 20};
20 21
21#endif 22#endif
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 6511b1f..43d02e7 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -1,31 +1,32 @@
1#include <qlabel.h> 1#include <qlabel.h>
2#include <qvbox.h> 2#include <qvbox.h>
3#include <qheader.h> 3#include <qheader.h>
4#include <qtimer.h> 4#include <qtimer.h>
5#include <qlayout.h> 5#include <qlayout.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qtextstream.h> 7#include <qtextstream.h>
8 8
9#include <qpe/qpeapplication.h> 9#include <qpe/qpeapplication.h>
10#include <qpe/resource.h> 10#include <qpe/resource.h>
11 11
12
12#include "defines.h" 13#include "defines.h"
13#include "mainwindow.h" 14#include "mainwindow.h"
14#include "viewmail.h" 15#include "viewmail.h"
15#include "mailtypes.h" 16#include <libmailwrapper/mailtypes.h>
16#include "mailistviewitem.h" 17#include "mailistviewitem.h"
17 18
18 19
19MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 20MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
20 : QMainWindow( parent, name, flags ) 21 : QMainWindow( parent, name, flags )
21{ 22{
22 23
23 setCaption( tr( "Mail" ) ); 24 setCaption( tr( "Mail" ) );
24 setToolBarsMovable( false ); 25 setToolBarsMovable( false );
25 26
26 toolBar = new QToolBar( this ); 27 toolBar = new QToolBar( this );
27 menuBar = new QMenuBar( toolBar ); 28 menuBar = new QMenuBar( toolBar );
28 mailMenu = new QPopupMenu( menuBar ); 29 mailMenu = new QPopupMenu( menuBar );
29 menuBar->insertItem( tr( "Mail" ), mailMenu ); 30 menuBar->insertItem( tr( "Mail" ), mailMenu );
30 settingsMenu = new QPopupMenu( menuBar ); 31 settingsMenu = new QPopupMenu( menuBar );
31 menuBar->insertItem( tr( "Settings" ), settingsMenu ); 32 menuBar->insertItem( tr( "Settings" ), settingsMenu );
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 54453b7..fcd48e2 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -1,22 +1,22 @@
1#include <qmessagebox.h> 1#include <qmessagebox.h>
2#include "settingsdialog.h" 2#include "settingsdialog.h"
3#include "opiemail.h" 3#include "opiemail.h"
4#include "editaccounts.h" 4#include "editaccounts.h"
5#include "composemail.h" 5#include "composemail.h"
6#include "smtpwrapper.h" 6#include <libmailwrapper/smtpwrapper.h>
7#include <qpe/qcopenvelope_qws.h> 7#include <qpe/qcopenvelope_qws.h>
8#include <qaction.h> 8#include <qaction.h>
9#include <qapplication.h> 9#include <qapplication.h>
10 10
11OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) 11OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
12 : MainWindow( parent, name, flags ) 12 : MainWindow( parent, name, flags )
13{ 13{
14 settings = new Settings(); 14 settings = new Settings();
15 15
16 folderView->populate( settings->getAccounts() ); 16 folderView->populate( settings->getAccounts() );
17 17
18 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 18 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
19 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 19 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
20// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 20// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
21 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 21 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
22 // Added by Stefan Eilers to allow starting by addressbook.. 22 // Added by Stefan Eilers to allow starting by addressbook..
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h
index 4e3c974..ebed5d8 100644
--- a/noncore/net/mail/opiemail.h
+++ b/noncore/net/mail/opiemail.h
@@ -1,21 +1,22 @@
1#ifndef OPIEMAIL_H 1#ifndef OPIEMAIL_H
2#define OPIEMAIL_H 2#define OPIEMAIL_H
3 3
4#include "mainwindow.h" 4#include "mainwindow.h"
5#include "settings.h" 5#include <libmailwrapper/settings.h>
6
6 7
7class OpieMail : public MainWindow 8class OpieMail : public MainWindow
8{ 9{
9 Q_OBJECT 10 Q_OBJECT
10 11
11public: 12public:
12 OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 13 OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
13 static QString appName() { return QString::fromLatin1("opiemail"); } 14 static QString appName() { return QString::fromLatin1("opiemail"); }
14 15
15public slots: 16public slots:
16 virtual void slotwriteMail(const QString&name,const QString&email); 17 virtual void slotwriteMail(const QString&name,const QString&email);
17 virtual void slotComposeMail(); 18 virtual void slotComposeMail();
18 virtual void appMessage(const QCString &msg, const QByteArray &data); 19 virtual void appMessage(const QCString &msg, const QByteArray &data);
19protected slots: 20protected slots:
20 virtual void slotSendQueued(); 21 virtual void slotSendQueued();
21 virtual void slotSearchMails(); 22 virtual void slotSearchMails();
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index ed77eb5..9ca6383 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -1,35 +1,35 @@
1#include <qtextbrowser.h> 1#include <qtextbrowser.h>
2#include <qmessagebox.h> 2#include <qmessagebox.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <qaction.h> 4#include <qaction.h>
5#include <qpopupmenu.h> 5#include <qpopupmenu.h>
6#include <qfile.h> 6#include <qfile.h>
7#include <qapplication.h> 7#include <qapplication.h>
8#include <qvaluelist.h> 8#include <qvaluelist.h>
9 9
10#include <qpe/config.h> 10#include <qpe/config.h>
11 11
12#include <opie/ofiledialog.h> 12#include <opie/ofiledialog.h>
13 13
14#include "settings.h" 14#include <libmailwrapper/settings.h>
15#include "composemail.h" 15#include "composemail.h"
16#include "viewmail.h" 16#include "viewmail.h"
17#include "abstractmail.h" 17#include <libmailwrapper/abstractmail.h>
18#include "accountview.h" 18#include "accountview.h"
19#include "mailtypes.h" 19#include <libmailwrapper/mailtypes.h>
20 20
21AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 21AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
22 const QString&fsize,int num,const QValueList<int>&path) 22 const QString&fsize,int num,const QValueList<int>&path)
23 : QListViewItem(parent,after),_partNum(num) 23 : QListViewItem(parent,after),_partNum(num)
24{ 24{
25 _path=path; 25 _path=path;
26 setText(0, mime); 26 setText(0, mime);
27 setText(1, desc); 27 setText(1, desc);
28 setText(2, file); 28 setText(2, file);
29 setText(3, fsize); 29 setText(3, fsize);
30} 30}
31 31
32AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 32AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
33 const QString&fsize,int num,const QValueList<int>&path) 33 const QString&fsize,int num,const QValueList<int>&path)
34 : QListViewItem(parent,after),_partNum(num) 34 : QListViewItem(parent,after),_partNum(num)
35{ 35{
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h
index 29681cc..2d0e024 100644
--- a/noncore/net/mail/viewmail.h
+++ b/noncore/net/mail/viewmail.h
@@ -1,26 +1,27 @@
1#ifndef VIEWMAIL_H 1#ifndef VIEWMAIL_H
2#define VIEWMAIL_H 2#define VIEWMAIL_H
3 3
4#include <qlistview.h> 4#include <qlistview.h>
5#include <qmap.h> 5#include <qmap.h>
6#include <qstringlist.h> 6#include <qstringlist.h>
7#include <qvaluelist.h> 7#include <qvaluelist.h>
8 8
9#include "viewmailbase.h" 9#include "viewmailbase.h"
10#include "mailtypes.h" 10#include <libmailwrapper/mailtypes.h>
11
11 12
12class AttachItem : public QListViewItem 13class AttachItem : public QListViewItem
13{ 14{
14public: 15public:
15 AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 16 AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
16 const QString&fsize,int num,const QValueList<int>&path); 17 const QString&fsize,int num,const QValueList<int>&path);
17 AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 18 AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
18 const QString&fsize,int num,const QValueList<int>&path); 19 const QString&fsize,int num,const QValueList<int>&path);
19 int Partnumber() { return _partNum; } 20 int Partnumber() { return _partNum; }
20 bool isParentof(const QValueList<int>&path); 21 bool isParentof(const QValueList<int>&path);
21 22
22private: 23private:
23 int _partNum; 24 int _partNum;
24 /* needed for a better display of attachments */ 25 /* needed for a better display of attachments */
25 QValueList<int> _path; 26 QValueList<int> _path;
26}; 27};