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 
37 class KMMessage;
38 class KMFolder;
39 class KMFolderMgr;
40 class TDEConfig;
41 class TDEProcess;
42 class KMSendProc;
43 class KMSendSendmail;
44 class KMSendSMTP;
45 class TQStrList;
46 class KMTransportInfo;
47 class KMPrecommand;
48 
49 namespace KPIM {
50  class ProgressItem;
51 }
52 
53 class KMSender: public TQObject, public KMail::MessageSender
54 {
55  TQ_OBJECT
56 
57  friend class ::KMSendProc;
58  friend class ::KMSendSendmail;
59  friend class ::KMSendSMTP;
60 
61 public:
62  KMSender();
63  ~KMSender();
64 
65 protected:
73  bool doSend(KMMessage* msg, short sendNow);
74 
78  bool doSendQueued( const TQString& transport );
79 
80 private:
82  bool sending() const { return mSendInProgress; }
83 
84 public:
87  bool sendImmediate() const { return mSendImmediate; }
88  void setSendImmediate(bool);
89 
92  bool sendQuotedPrintable() const { return mSendQuotedPrintable; }
93  void setSendQuotedPrintable(bool);
94 
95 private:
97  KMTransportInfo * transportInfo() { return mTransportInfo; }
98 
99 public:
101  void readConfig();
102 
104  void writeConfig(bool withSync=true);
105 
106 private:
108  void setStatusMsg(const TQString&);
109 
111  void setStatusByLink(const KMMessage *aMsg);
112 
114  void emitProgressInfo( int currentFileProgress );
115 
116 private 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 
131 private:
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 
152 private:
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