summaryrefslogtreecommitdiffstats
path: root/kmail/kmacctimap.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmail/kmacctimap.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmacctimap.h')
-rw-r--r--kmail/kmacctimap.h152
1 files changed, 152 insertions, 0 deletions
diff --git a/kmail/kmacctimap.h b/kmail/kmacctimap.h
new file mode 100644
index 000000000..03aa0aa92
--- /dev/null
+++ b/kmail/kmacctimap.h
@@ -0,0 +1,152 @@
+/* -*- mode: C++ -*-
+ * kmacctimap.h
+ *
+ * Copyright (c) 2000-2002 Michael Haeckel <[email protected]>
+ *
+ * This file is based on popaccount.h by Don Sanders
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KMAcctImap_h
+#define KMAcctImap_h
+
+#include "imapaccountbase.h"
+#include <qdict.h>
+
+class KMFolderImap;
+class KMFolderTreeItem;
+namespace KMail {
+ class ImapJob;
+ class ActionScheduler;
+}
+namespace KIO {
+ class Job;
+}
+class FolderStorage;
+
+//-----------------------------------------------------------------------------
+class KMAcctImap: public KMail::ImapAccountBase
+{
+ Q_OBJECT
+ friend class KMail::ImapJob;
+
+public:
+ virtual ~KMAcctImap();
+
+ /** A weak assignment operator */
+ virtual void pseudoAssign( const KMAccount * a );
+
+ /**
+ * Inherited methods.
+ */
+ virtual QString type(void) const;
+ virtual void processNewMail(bool);
+ ConnectionState makeConnection();
+
+ /**
+ * Kill all jobs related the the specified folder/msg
+ */
+ virtual void ignoreJobsForMessage( KMMessage * msg );
+ virtual void ignoreJobsForFolder( KMFolder * folder );
+ virtual void removeSlaveJobsForFolder( KMFolder * folder );
+
+ /**
+ * Kill the slave if any jobs are active
+ */
+ virtual void killAllJobs( bool disconnectSlave=false );
+
+ /**
+ * Set the top level pseudo folder
+ */
+ virtual void setImapFolder(KMFolderImap *);
+
+ /**
+ * Starts the folderlisting for the root folder
+ */
+ virtual void listDirectory();
+
+ /**
+ * Read config file entries. This method is called by the account
+ * manager when a new account is created. The config group is
+ * already properly set by the caller.
+ */
+ virtual void readConfig(KConfig& config);
+
+ /**
+ * Returns the root folder of this account
+ */
+ virtual FolderStorage* const rootFolder() const;
+
+ /**
+ * Queues a message for automatic filtering
+ */
+ void execFilters(Q_UINT32 serNum);
+
+public slots:
+ /**
+ * updates the new-mail-check folderlist
+ */
+ void slotFiltered(Q_UINT32 serNum);
+ void slotUpdateFolderList();
+
+protected:
+ friend class ::AccountManager;
+ KMAcctImap(AccountManager* owner, const QString& accountName, uint id);
+ /**
+ * Handle an error coming from a KIO job
+ * See ImapAccountBase::handleJobError for details.
+ */
+ virtual bool handleError( int error, const QString &errorMsg, KIO::Job* job, const QString& context, bool abortSync = false );
+ virtual void cancelMailCheck();
+
+ QPtrList<KMail::ImapJob> mJobList;
+ QGuardedPtr<KMFolderImap> mFolder;
+
+protected slots:
+ /** new-mail-notification for the current folder (is called via folderComplete) */
+ void postProcessNewMail(KMFolderImap*, bool);
+ /**
+ * new-mail-notification for not-selected folders (is called via
+ * numUnreadMsgsChanged)
+ */
+ void postProcessNewMail( KMFolder * f );
+
+ /**
+ * hooked up to the progress item signaling cancellation.
+ * Cleanup and reset state.
+ */
+ void slotMailCheckCanceled();
+
+ /**
+ * called to reset the connection error status
+ */
+ void slotResetConnectionError();
+
+ /**
+ * Slots for automatic filtering
+ */
+ void slotFolderSelected( KMFolderImap*, bool );
+ int slotFilterMsg( KMMessage* );
+
+private:
+ int mCountRemainChecks;
+ /** used to reset connection errors */
+ QTimer mErrorTimer;
+ QValueList<Q_UINT32> mFilterSerNums;
+ QDict<int> mFilterSerNumsToSave;
+ KMail::ActionScheduler *mScheduler;
+};
+
+#endif /*KMAcctImap_h*/