kmail

sieveconfig.h
1/*
2 sieveconfig.h
3
4 KMail, the KDE mail client.
5 Copyright (c) 2002 Marc Mutz <mutz@kde.org>
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License,
9 version 2.0, as published by the Free Software Foundation.
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13*/
14
15#ifndef __KMAIL_SIEVECONFIG_H__
16#define __KMAIL_SIEVECONFIG_H__
17
18#include <tqwidget.h>
19
20#include <kurl.h>
21
22class TQCheckBox;
23class TQLineEdit;
24class KIntSpinBox;
25class TDEConfigBase;
26
27namespace KMail {
28
29 class SieveConfig {
30 public:
31 SieveConfig( bool managesieveSupported=false, bool reuseConfig=true,
32 unsigned int port=2000, const KURL & alternateURL=KURL(),
33 const TQString& vacationFileName = TQString() )
34 : mManagesieveSupported( managesieveSupported ),
35 mReuseConfig( reuseConfig ),
36 mPort( port ),
37 mAlternateURL( alternateURL ),
38 mVacationFileName( vacationFileName ) {}
39
40 SieveConfig( const SieveConfig & other )
41 : mManagesieveSupported( other.managesieveSupported() ),
42 mReuseConfig( other.reuseConfig() ),
43 mPort( other.port() ),
44 mAlternateURL( other.alternateURL() ),
45 mVacationFileName( other.vacationFileName() ) {}
46
47 bool managesieveSupported() const {
48 return mManagesieveSupported;
49 }
50 void setManagesieveSupported( bool enable ) {
51 mManagesieveSupported = enable;
52 }
53
54 bool reuseConfig() const {
55 return mReuseConfig;
56 }
57 void setReuseConfig( bool reuse ) {
58 mReuseConfig = reuse;
59 }
60
61 unsigned short port() const {
62 return mPort;
63 }
64 void setPort( unsigned short port ) {
65 mPort = port;
66 }
67
68 KURL alternateURL() const {
69 return mAlternateURL;
70 }
71 void setAlternateURL( const KURL & url ) {
72 mAlternateURL = url;
73 }
74
75 TQString vacationFileName() const { return mVacationFileName; }
76
77 void readConfig( const TDEConfigBase & config );
78 void writeConfig( TDEConfigBase & config ) const;
79
80 protected:
81 bool mManagesieveSupported;
82 bool mReuseConfig;
83 unsigned short mPort;
84 KURL mAlternateURL;
85 TQString mVacationFileName;
86 };
87
88 class SieveConfigEditor : public TQWidget {
89 TQ_OBJECT
90
91 public:
92 SieveConfigEditor( TQWidget * parent=0, const char * name=0 );
93
94 bool managesieveSupported() const;
95 virtual void setManagesieveSupported( bool enable );
96
97 bool reuseConfig() const;
98 virtual void setReuseConfig( bool reuse );
99
100 unsigned short port() const;
101 virtual void setPort( unsigned short port );
102
103 KURL alternateURL() const;
104 virtual void setAlternateURL( const KURL & url );
105
106 TQString vacationFileName() const;
107 virtual void setVacationFileName( const TQString & url );
108
109 SieveConfig config() const {
110 return SieveConfig( managesieveSupported(), reuseConfig(),
111 port(), alternateURL(), vacationFileName() );
112 }
113
114 virtual void setConfig( const SieveConfig & config );
115
116 protected slots:
117 void slotEnableWidgets();
118
119 protected:
120 TQCheckBox * mManagesieveCheck;
121 TQCheckBox * mSameConfigCheck;
122 KIntSpinBox * mPortSpin;
123 TQLineEdit * mAlternateURLEdit;
124 TQString mVacationFileName;
125 };
126
127} // namespace KMail
128
129#endif // __KMAIL_SIEVECONFIG_H__
folderdiaquotatab.h
Definition: aboutdata.cpp:40