kmail

vacation.h
1 /*
2  vacation.cpp
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_VACATION_H__
16 #define __KMAIL_VACATION_H__
17 
18 #include <tqobject.h>
19 
20 #include <kurl.h>
21 
22 class TQString;
23 class TQStringList;
24 template <typename T> class TQValueList;
25 namespace KMail {
26  class SieveJob;
27  class VacationDialog;
28 }
29 namespace KMime {
30  namespace Types {
31  struct AddrSpec;
32  typedef TQValueList<AddrSpec> AddrSpecList;
33  }
34 }
35 
36 namespace KMail {
37 
38  class Vacation : public TQObject {
39  TQ_OBJECT
40 
41  public:
42  Vacation( TQObject * parent=0, bool checkOnly = false, const char * name=0 );
43  virtual ~Vacation();
44 
45  bool isUsable() const { return !mUrl.isEmpty(); }
46 
47  static TQString defaultMessageText();
48  static int defaultNotificationInterval();
49  static TQStringList defaultMailAliases();
50  static bool defaultSendForSpam();
51  static TQString defaultDomainName();
52 
53  protected:
54  static TQString composeScript( const TQString & messageText,
55  int notificationInterval,
56  const KMime::Types::AddrSpecList & aliases,
57  bool sendForSpam, const TQString & excludeDomain );
58  static bool parseScript( const TQString & script, TQString & messageText,
59  int & notificationInterval, TQStringList & aliases,
60  bool & sendForSpam, TQString & domainName );
61  KURL findURL() const;
62  void handlePutResult( KMail::SieveJob * job, bool success, bool );
63 
64 
65  signals:
66  void result( bool success );
67  // indicates if the vaction script is active or not
68  void scriptActive( bool active );
69 
70  protected slots:
71  void slotDialogDefaults();
72  void slotGetResult( KMail::SieveJob * job, bool success,
73  const TQString & script, bool active );
74  void slotDialogOk();
75  void slotDialogCancel();
76  void slotPutActiveResult( KMail::SieveJob *, bool );
77  void slotPutInactiveResult( KMail::SieveJob *, bool );
78  protected:
79  // IO:
80  KMail::SieveJob * mSieveJob;
81  KURL mUrl;
82  // GUI:
83  KMail::VacationDialog * mDialog;
84  bool mWasActive;
85  bool mCheckOnly;
86  };
87 
88 } // namespace KMail
89 
90 #endif // __KMAIL_VACATION_H__
folderdiaquotatab.h
Definition: aboutdata.cpp:40