kmail Library API Documentation

vacation.h

00001 /*  -*- c++ -*-
00002     vacation.cpp
00003 
00004     KMail, the KDE mail client.
00005     Copyright (c) 2002 Marc Mutz <mutz@kde.org>
00006 
00007     This program is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License,
00009     version 2.0, as published by the Free Software Foundation.
00010     You should have received a copy of the GNU General Public License
00011     along with this program; if not, write to the Free Software Foundation,
00012     Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
00013 */
00014 
00015 #ifndef __KMAIL_VACATION_H__
00016 #define __KMAIL_VACATION_H__
00017 
00018 #include <qobject.h>
00019 
00020 #include <kurl.h>
00021 
00022 class QString;
00023 class QStringList;
00024 template <typename T> class QValueList;
00025 namespace KMail {
00026   class SieveJob;
00027   class VacationDialog;
00028 }
00029 namespace KMime {
00030   namespace Types {
00031     struct AddrSpec;
00032     typedef QValueList<AddrSpec> AddrSpecList;
00033   }
00034 }
00035 
00036 namespace KMail {
00037 
00038   class Vacation : public QObject {
00039     Q_OBJECT
00040   public:
00041     Vacation( QObject * parent=0, const char * name=0 );
00042     virtual ~Vacation();
00043 
00044     bool isUsable() const { return !mUrl.isEmpty(); }
00045 
00046     static QString defaultMessageText();
00047     static int defaultNotificationInterval();
00048     static QStringList defaultMailAliases();
00049 
00050   protected:
00051     static QString composeScript( const QString & messageText,
00052                   int notificationInterval,
00053                   const KMime::Types::AddrSpecList & aliases);
00054     static bool parseScript( const QString & script, QString & messageText,
00055                  int & notificationInterval, QStringList & aliases );
00056     KURL findURL() const;
00057 
00058   signals:
00059     void result( bool success );
00060 
00061   protected slots:
00062     void slotDialogDefaults();
00063     void slotGetResult( KMail::SieveJob * job, bool success,
00064             const QString & script, bool active );
00065     void slotDialogOk();
00066     void slotDialogCancel();
00067     void slotPutResult( KMail::SieveJob * job, bool success,
00068             const QString &, bool );
00069 
00070   protected:
00071     // IO:
00072     KMail::SieveJob * mSieveJob;
00073     KURL mUrl;
00074     // GUI:
00075     KMail::VacationDialog * mDialog;
00076     bool mWasActive;
00077   };
00078 
00079 } // namespace KMail
00080 
00081 #endif // __KMAIL_VACATION_H__
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:35 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003