kmail

kmsender.h
1/*
2 * kmail: KDE mail client
3 * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef kmsender_h
21#define kmsender_h
22#include "messagesender.h"
23
24#ifndef KDE_USE_FINAL
25# ifndef REALLY_WANT_KMSENDER
26# error Do not include kmsender.h, but messagesender.h.
27# endif
28#endif
29
30#include <tqcstring.h>
31#include <tqstring.h>
32#include <tqstringlist.h>
33#include <tqmap.h>
34#include <tqobject.h>
35
36class KMMessage;
37class KMFolder;
38class KMFolderMgr;
39class TDEConfig;
40class TDEProcess;
41class KMSendProc;
42class KMSendSendmail;
43class KMSendSMTP;
44class TQStrList;
45class KMTransportInfo;
46class KMPrecommand;
47
48namespace KPIM {
49 class ProgressItem;
50}
51
52class KMSender: public TQObject, public KMail::MessageSender
53{
54 TQ_OBJECT
55
56 friend class ::KMSendProc;
57 friend class ::KMSendSendmail;
58 friend class ::KMSendSMTP;
59
60public:
61 KMSender();
62 ~KMSender();
63
64protected:
72 bool doSend(KMMessage* msg, short sendNow);
73
77 bool doSendQueued( const TQString& transport );
78
79private:
81 bool sending() const { return mSendInProgress; }
82
83public:
86 bool sendImmediate() const { return mSendImmediate; }
87 void setSendImmediate(bool);
88
91 bool sendQuotedPrintable() const { return mSendQuotedPrintable; }
92 void setSendQuotedPrintable(bool);
93
94private:
96 KMTransportInfo * transportInfo() { return mTransportInfo; }
97
98public:
100 void readConfig();
101
103 void writeConfig(bool withSync=true);
104
105private:
107 void setStatusMsg(const TQString&);
108
110 void setStatusByLink(const KMMessage *aMsg);
111
113 void emitProgressInfo( int currentFileProgress );
114
115private slots:
117 void slotPrecommandFinished(bool);
118
119 void slotIdle();
120
122 void slotAbortSend();
123
125 void sendProcStarted(bool success);
126
128 void outboxMsgAdded(int idx);
129
130private:
132 void doSendMsg();
133
135 void doSendMsgAux();
136
138 void cleanup();
139
143 bool settingsOk() const;
144
147 KMSendProc* createSendProcFromString( const TQString & transport );
148
149 bool runPrecommand( const TQString & cmd );
150
151private:
152 bool mSendImmediate;
153 bool mSendQuotedPrintable;
154 KMTransportInfo *mTransportInfo;
155 KMPrecommand *mPrecommand;
156
157 TQString mCustomTransport;
158 bool mSentOk, mSendAborted;
159 TQString mErrorMsg;
160 KMSendProc *mSendProc;
161 TQString mMethodStr;
162 bool mSendProcStarted;
163 bool mSendInProgress;
164 KMFolder *mOutboxFolder;
165 KMFolder *mSentFolder;
166 KMMessage * mCurrentMsg;
167 KPIM::ProgressItem* mProgressItem;
168 int mSentMessages, mTotalMessages;
169 int mSentBytes, mTotalBytes;
170 int mFailedMessages;
171 TQMap<TQString,TQString> mPasswdCache;
172};
173
174#endif /*kmsender_h*/
Mail folder.
Definition: kmfolder.h:69
This is a Mime Message.
Definition: kmmessage.h:68