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#include <tdeversion.h>
36
37class KMMessage;
38class KMFolder;
39class KMFolderMgr;
40class TDEConfig;
41class TDEProcess;
42class KMSendProc;
43class KMSendSendmail;
44class KMSendSMTP;
45class TQStrList;
46class KMTransportInfo;
47class KMPrecommand;
48
49namespace KPIM {
50 class ProgressItem;
51}
52
53class KMSender: public TQObject, public KMail::MessageSender
54{
55 TQ_OBJECT
56
57 friend class ::KMSendProc;
58 friend class ::KMSendSendmail;
59 friend class ::KMSendSMTP;
60
61public:
62 KMSender();
63 ~KMSender();
64
65protected:
73 bool doSend(KMMessage* msg, short sendNow);
74
78 bool doSendQueued( const TQString& transport );
79
80private:
82 bool sending() const { return mSendInProgress; }
83
84public:
87 bool sendImmediate() const { return mSendImmediate; }
88 void setSendImmediate(bool);
89
92 bool sendQuotedPrintable() const { return mSendQuotedPrintable; }
93 void setSendQuotedPrintable(bool);
94
95private:
97 KMTransportInfo * transportInfo() { return mTransportInfo; }
98
99public:
101 void readConfig();
102
104 void writeConfig(bool withSync=true);
105
106private:
108 void setStatusMsg(const TQString&);
109
111 void setStatusByLink(const KMMessage *aMsg);
112
114 void emitProgressInfo( int currentFileProgress );
115
116private slots:
118 void slotPrecommandFinished(bool);
119
120 void slotIdle();
121
123 void slotAbortSend();
124
126 void sendProcStarted(bool success);
127
129 void outboxMsgAdded(int idx);
130
131private:
133 void doSendMsg();
134
136 void doSendMsgAux();
137
139 void cleanup();
140
144 bool settingsOk() const;
145
148 KMSendProc* createSendProcFromString( const TQString & transport );
149
150 bool runPrecommand( const TQString & cmd );
151
152private:
153 bool mSendImmediate;
154 bool mSendQuotedPrintable;
155 KMTransportInfo *mTransportInfo;
156 KMPrecommand *mPrecommand;
157
158 TQString mCustomTransport;
159 bool mSentOk, mSendAborted;
160 TQString mErrorMsg;
161 KMSendProc *mSendProc;
162 TQString mMethodStr;
163 bool mSendProcStarted;
164 bool mSendInProgress;
165 KMFolder *mOutboxFolder;
166 KMFolder *mSentFolder;
167 KMMessage * mCurrentMsg;
168 KPIM::ProgressItem* mProgressItem;
169 int mSentMessages, mTotalMessages;
170 int mSentBytes, mTotalBytes;
171 int mFailedMessages;
172 TQMap<TQString,TQString> mPasswdCache;
173};
174
175#endif /*kmsender_h*/
Mail folder.
Definition: kmfolder.h:69
This is a Mime Message.
Definition: kmmessage.h:68