summaryrefslogtreecommitdiffstats
path: root/korn/polldrop.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 /korn/polldrop.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 'korn/polldrop.h')
-rw-r--r--korn/polldrop.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/korn/polldrop.h b/korn/polldrop.h
new file mode 100644
index 000000000..b7ea69aba
--- /dev/null
+++ b/korn/polldrop.h
@@ -0,0 +1,69 @@
+/*
+* polldrop.h -- Declaration of class KPollableDrop.
+* Generated by newclass on Sun Nov 30 22:41:49 EST 1997.
+*/
+#ifndef SSK_POLLDROP_H
+#define SSK_POLLDROP_H
+
+#include"maildrop.h"
+
+class QTimerEvent;
+
+/**
+* Superclass for all pollable maildrop monitors.
+*
+* To implement a polling maildrop, reimplement recheck and emit
+* changed(int) in recheck if new messages have been received.
+*
+* @author Sirtaj Singh Kang (taj@kde.org)
+* @version $Id$
+*/
+class KPollableDrop : public KMailDrop
+{
+ Q_OBJECT
+public:
+ static const char *PollConfigKey;
+ static const int DefaultPoll;
+
+private:
+ int _freq;
+ int _timerId;
+ bool _timerRunning;
+
+public:
+ /**
+ * KPollableDrop Constructor
+ */
+ KPollableDrop();
+
+ virtual bool startMonitor();
+ virtual bool stopMonitor();
+ virtual bool startProcess() { return true; } //Start en stop-functions for progress; it is not pollable, but a member of kio
+ virtual bool stopProcess() { return true; }
+
+ virtual bool running() { return _timerRunning; };
+
+ int freq() const { return _freq; }
+ void setFreq( int freq );
+
+ virtual bool readConfigGroup ( const KConfigBase& cfg );
+ virtual bool writeConfigGroup ( KConfigBase& cfg ) const;
+
+ //virtual void addConfigPage( KDropCfgDialog * );
+
+protected:
+ void timerEvent( QTimerEvent * );
+};
+
+inline void KPollableDrop::setFreq( int freq )
+{
+ bool r = running();
+
+ if( r ) stopMonitor();
+
+ _freq = freq;
+
+ if( r ) startMonitor();
+}
+
+#endif // SSK_POLLDROP_H