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     Copyright (c) 2005 Klarälvdalens Datakonsult AB
00007 
00008     KMail is free software; you can redistribute it and/or modify it
00009     under the terms of the GNU General Public License, version 2, as
00010     published by the Free Software Foundation.
00011 
00012     KMail is distributed in the hope that it will be useful, but
00013     WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 
00033 #ifndef __KMAIL_VACATION_H__
00034 #define __KMAIL_VACATION_H__
00035 
00036 #include <qobject.h>
00037 
00038 #include <kurl.h>
00039 
00040 class QString;
00041 class QStringList;
00042 template <typename T> class QValueList;
00043 namespace KMail {
00044   class SieveJob;
00045   class VacationDialog;
00046 }
00047 namespace KMime {
00048   namespace Types {
00049     struct AddrSpec;
00050     typedef QValueList<AddrSpec> AddrSpecList;
00051   }
00052 }
00053 
00054 namespace KMail {
00055 
00056   class Vacation : public QObject {
00057     Q_OBJECT
00058   public:
00059     Vacation( QObject * parent=0, const char * name=0 );
00060     virtual ~Vacation();
00061 
00062     bool isUsable() const { return !mUrl.isEmpty(); }
00063 
00064     static QString defaultMessageText();
00065     static int defaultNotificationInterval();
00066     static QStringList defaultMailAliases();
00067     static bool defaultSendForSpam();
00068     static QString defaultDomainName();
00069 
00070   protected:
00071     static QString composeScript( const QString & messageText,
00072                   int notificationInterval,
00073                   const KMime::Types::AddrSpecList & aliases,
00074                                   bool sendForSpam, const QString & excludeDomain );
00075     static bool parseScript( const QString & script, QString & messageText,
00076                  int & notificationInterval, QStringList & aliases,
00077                              bool & sendForSpam, QString & domainName );
00078     KURL findURL() const;
00079     void handlePutResult( KMail::SieveJob * job, bool success, bool );
00080 
00081 
00082   signals:
00083     void result( bool success );
00084 
00085   protected slots:
00086     void slotDialogDefaults();
00087     void slotGetResult( KMail::SieveJob * job, bool success,
00088             const QString & script, bool active );
00089     void slotDialogOk();
00090     void slotDialogCancel();
00091     void slotPutActiveResult( KMail::SieveJob *, bool );
00092     void slotPutInactiveResult( KMail::SieveJob *, bool );
00093   protected:
00094     // IO:
00095     KMail::SieveJob * mSieveJob;
00096     KURL mUrl;
00097     // GUI:
00098     KMail::VacationDialog * mDialog;
00099     bool mWasActive;
00100   };
00101 
00102 } // namespace KMail
00103 
00104 #endif // __KMAIL_VACATION_H__
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 17 09:55:45 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003