sieveconfig.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __KMAIL_SIEVECONFIG_H__
00016 #define __KMAIL_SIEVECONFIG_H__
00017
00018 #include <qwidget.h>
00019
00020 #include <kurl.h>
00021
00022 class QCheckBox;
00023 class QLineEdit;
00024 class KIntSpinBox;
00025 class KConfigBase;
00026
00027 namespace KMail {
00028
00029 class SieveConfig {
00030 public:
00031 SieveConfig( bool managesieveSupported=false, bool reuseConfig=true,
00032 unsigned int port=2000, const KURL & alternateURL=KURL() )
00033 : mManagesieveSupported( managesieveSupported ),
00034 mReuseConfig( reuseConfig ),
00035 mPort( port ),
00036 mAlternateURL( alternateURL ) {}
00037
00038 SieveConfig( const SieveConfig & other )
00039 : mManagesieveSupported( other.managesieveSupported() ),
00040 mReuseConfig( other.reuseConfig() ),
00041 mPort( other.port() ),
00042 mAlternateURL( other.alternateURL() ) {}
00043
00044 bool managesieveSupported() const {
00045 return mManagesieveSupported;
00046 }
00047 void setManagesieveSupported( bool enable ) {
00048 mManagesieveSupported = enable;
00049 }
00050
00051 bool reuseConfig() const {
00052 return mReuseConfig;
00053 }
00054 void setReuseConfig( bool reuse ) {
00055 mReuseConfig = reuse;
00056 }
00057
00058 unsigned short port() const {
00059 return mPort;
00060 }
00061 void setPort( unsigned short port ) {
00062 mPort = port;
00063 }
00064
00065 KURL alternateURL() const {
00066 return mAlternateURL;
00067 }
00068 void setAlternateURL( const KURL & url ) {
00069 mAlternateURL = url;
00070 }
00071
00072 void readConfig( const KConfigBase & config );
00073 void writeConfig( KConfigBase & config ) const;
00074
00075 protected:
00076 bool mManagesieveSupported;
00077 bool mReuseConfig;
00078 unsigned short mPort;
00079 KURL mAlternateURL;
00080 };
00081
00082 class SieveConfigEditor : public QWidget {
00083 Q_OBJECT
00084 public:
00085 SieveConfigEditor( QWidget * parent=0, const char * name=0 );
00086
00087 bool managesieveSupported() const;
00088 virtual void setManagesieveSupported( bool enable );
00089
00090 bool reuseConfig() const;
00091 virtual void setReuseConfig( bool reuse );
00092
00093 unsigned short port() const;
00094 virtual void setPort( unsigned short port );
00095
00096 KURL alternateURL() const;
00097 virtual void setAlternateURL( const KURL & url );
00098
00099 SieveConfig config() const {
00100 return SieveConfig( managesieveSupported(), reuseConfig(),
00101 port(), alternateURL() );
00102 }
00103
00104 virtual void setConfig( const SieveConfig & config );
00105
00106 protected slots:
00107 void slotEnableWidgets();
00108
00109 protected:
00110 QCheckBox * mManagesieveCheck;
00111 QCheckBox * mSameConfigCheck;
00112 KIntSpinBox * mPortSpin;
00113 QLineEdit * mAlternateURLEdit;
00114 };
00115
00116 }
00117
00118 #endif // __KMAIL_SIEVECONFIG_H__
This file is part of the documentation for kmail Library Version 3.2.2.