23 #include <tdeprocess.h>
27 #include <tqguardedptr.h>
28 #include <tqvaluelist.h>
31 #include "kmmessage.h"
38 class KMFolderCachedImap;
39 class AccountsPageReceivingTab;
45 namespace KPIM {
class ProgressItem; }
46 using KMail::FolderJob;
47 using KPIM::ProgressItem;
50 typedef TQValueList< ::KMAccount* > AccountList;
52 class KMPrecommand :
public TQObject
58 KMPrecommand(
const TQString &precommand, TQObject *parent = 0);
59 virtual ~KMPrecommand();
63 void precommandExited(TDEProcess *);
69 TDEProcess mPrecommandProcess;
74 class KMAccount:
public TQObject,
public KAccount
79 friend class ::KMail::FolderJob;
80 friend class ::AccountsPageReceivingTab;
81 friend class ::KMFolderCachedImap;
86 enum CheckStatus { CheckOK, CheckIgnored, CheckCanceled, CheckAborted,
90 static const int DefaultCheckInterval = 5;
95 virtual TQString type()
const {
return TQString(); }
100 virtual void setName(
const TQString&);
105 virtual TQString name()
const {
return KAccount::name(); }
110 virtual void clearPasswd();
120 virtual void pseudoAssign(
const KMAccount * a );
126 virtual void setFolder(
KMFolder*,
bool addAccount =
false);
131 TQString trash()
const {
return mTrash; }
132 virtual void setTrash(
const TQString& aTrash) { mTrash = aTrash; }
139 virtual void processNewMail(
bool interactive) = 0;
147 void readTimerConfig();
159 virtual void setCheckInterval(
int aInterval);
160 int checkInterval()
const;
165 inline int defaultCheckInterval(
void)
const {
return DefaultCheckInterval; }
170 void deleteFolderJobs();
175 virtual void ignoreJobsForMessage(
KMMessage* );
180 virtual void setCheckExclude(
bool aExclude);
181 bool checkExclude(
void)
const {
return mExclude; }
186 const TQString& precommand(
void)
const {
return mPrecommand; }
187 virtual void setPrecommand(
const TQString &cmd) { mPrecommand = cmd; }
195 bool runPrecommand(
const TQString &precommand);
201 static TQString encryptStr(
const TQString& inStr);
202 static TQString decryptStr(
const TQString& inStr) {
return encryptStr(inStr); }
204 static TQString importPassword(
const TQString &);
207 bool hasInbox()
const {
return mHasInbox; }
208 virtual void setHasInbox(
bool has ) { mHasInbox = has; }
221 virtual bool mailCheckCanProceed()
const {
return true; }
226 bool checkingMail() {
return mCheckingMail; }
227 virtual void setCheckingMail(
bool checking ) { mCheckingMail = checking; }
234 void checkDone(
bool newMail, CheckStatus status );
247 ProgressItem *mailCheckProgressItem()
const {
248 return mMailCheckProgressItem;
254 void setIdentityId(uint identityId ) { mIdentityId = identityId; }
255 uint identityId()
const{
return mIdentityId; }
263 virtual void finishedCheck(
bool newMail, CheckStatus status );
269 virtual void newMailsProcessed(
const TQMap<TQString, int> & newInFolder );
272 virtual void mailCheck();
273 virtual void sendReceipts();
274 virtual void precommandExited(
bool);
277 KMAccount(
AccountManager* owner,
const TQString& accountName, uint
id);
284 virtual bool processNewMsg(
KMMessage* msg);
292 virtual void sendReceipt(
KMMessage* msg);
297 virtual void installTimer();
298 virtual void deinstallTimer();
306 void addToNewInFolder( TQString folderId,
int num );
309 TQString mPrecommand;
312 TQGuardedPtr<KMAcctFolder> mFolder;
320 bool mCheckingMail : 1;
321 bool mPrecommandSuccess;
322 TQValueList<KMMessage*> mReceipts;
323 TQPtrList<FolderJob> mJobList;
325 TQGuardedPtr<ProgressItem> mMailCheckProgressItem;
331 virtual void setName(
const char *name ) { TQObject::setName( name ); }
335 TQMap<TQString, int> mNewInFolder;
Simple wrapper class that contains the kmail account handling stuff that is usually not required outs...
The account manager is responsible for creating accounts of various types via the factory method crea...
void readConfig(void)
Completely reload accounts from config.
void writeConfig(bool withSync=true)
Write accounts to config.
void cancelMailCheck()
Called on exit (KMMainWin::queryExit)
void invalidateIMAPFolders()
Delete all IMAP folders and resync them.