summaryrefslogtreecommitdiffstats
path: root/kmail/sieveconfig.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/sieveconfig.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/sieveconfig.h')
-rw-r--r--kmail/sieveconfig.h128
1 files changed, 128 insertions, 0 deletions
diff --git a/kmail/sieveconfig.h b/kmail/sieveconfig.h
new file mode 100644
index 00000000..55c63cc5
--- /dev/null
+++ b/kmail/sieveconfig.h
@@ -0,0 +1,128 @@
+/* -*- c++ -*-
+ sieveconfig.h
+
+ KMail, the KDE mail client.
+ Copyright (c) 2002 Marc Mutz <mutz@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License,
+ version 2.0, as published by the Free Software Foundation.
+ 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, US
+*/
+
+#ifndef __KMAIL_SIEVECONFIG_H__
+#define __KMAIL_SIEVECONFIG_H__
+
+#include <qwidget.h>
+
+#include <kurl.h>
+
+class QCheckBox;
+class QLineEdit;
+class KIntSpinBox;
+class KConfigBase;
+
+namespace KMail {
+
+ class SieveConfig {
+ public:
+ SieveConfig( bool managesieveSupported=false, bool reuseConfig=true,
+ unsigned int port=2000, const KURL & alternateURL=KURL(),
+ const QString& vacationFileName = QString::null )
+ : mManagesieveSupported( managesieveSupported ),
+ mReuseConfig( reuseConfig ),
+ mPort( port ),
+ mAlternateURL( alternateURL ),
+ mVacationFileName( vacationFileName ) {}
+
+ SieveConfig( const SieveConfig & other )
+ : mManagesieveSupported( other.managesieveSupported() ),
+ mReuseConfig( other.reuseConfig() ),
+ mPort( other.port() ),
+ mAlternateURL( other.alternateURL() ),
+ mVacationFileName( other.vacationFileName() ) {}
+
+ bool managesieveSupported() const {
+ return mManagesieveSupported;
+ }
+ void setManagesieveSupported( bool enable ) {
+ mManagesieveSupported = enable;
+ }
+
+ bool reuseConfig() const {
+ return mReuseConfig;
+ }
+ void setReuseConfig( bool reuse ) {
+ mReuseConfig = reuse;
+ }
+
+ unsigned short port() const {
+ return mPort;
+ }
+ void setPort( unsigned short port ) {
+ mPort = port;
+ }
+
+ KURL alternateURL() const {
+ return mAlternateURL;
+ }
+ void setAlternateURL( const KURL & url ) {
+ mAlternateURL = url;
+ }
+
+ QString vacationFileName() const { return mVacationFileName; }
+
+ void readConfig( const KConfigBase & config );
+ void writeConfig( KConfigBase & config ) const;
+
+ protected:
+ bool mManagesieveSupported;
+ bool mReuseConfig;
+ unsigned short mPort;
+ KURL mAlternateURL;
+ QString mVacationFileName;
+ };
+
+ class SieveConfigEditor : public QWidget {
+ Q_OBJECT
+ public:
+ SieveConfigEditor( QWidget * parent=0, const char * name=0 );
+
+ bool managesieveSupported() const;
+ virtual void setManagesieveSupported( bool enable );
+
+ bool reuseConfig() const;
+ virtual void setReuseConfig( bool reuse );
+
+ unsigned short port() const;
+ virtual void setPort( unsigned short port );
+
+ KURL alternateURL() const;
+ virtual void setAlternateURL( const KURL & url );
+
+ QString vacationFileName() const;
+ virtual void setVacationFileName( const QString & url );
+
+ SieveConfig config() const {
+ return SieveConfig( managesieveSupported(), reuseConfig(),
+ port(), alternateURL(), vacationFileName() );
+ }
+
+ virtual void setConfig( const SieveConfig & config );
+
+ protected slots:
+ void slotEnableWidgets();
+
+ protected:
+ QCheckBox * mManagesieveCheck;
+ QCheckBox * mSameConfigCheck;
+ KIntSpinBox * mPortSpin;
+ QLineEdit * mAlternateURLEdit;
+ QString mVacationFileName;
+ };
+
+} // namespace KMail
+
+#endif // __KMAIL_SIEVECONFIG_H__