kmail Library API Documentation

folderjob.h

00001 /*  -*- mode: C++; c-file-style: "gnu" -*-
00002  *
00003  *  This file is part of KMail, the KDE mail client.
00004  *  Copyright (c) 2003 Zack Rusin <zack@kde.org>
00005  *
00006  *  KMail is free software; you can redistribute it and/or modify it
00007  *  under the terms of the GNU General Public License, version 2, as
00008  *  published by the Free Software Foundation.
00009  *
00010  *  KMail is distributed in the hope that it will be useful, but
00011  *  WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  *  In addition, as a special exception, the copyright holders give
00020  *  permission to link the code of this program with any edition of
00021  *  the Qt library by Trolltech AS, Norway (or with modified versions
00022  *  of Qt that use the same license as Qt), and distribute linked
00023  *  combinations including the two.  You must obey the GNU General
00024  *  Public License in all respects for all of the code used other than
00025  *  Qt.  If you modify this file, you may extend this exception to
00026  *  your version of the file, but you are not obligated to do so.  If
00027  *  you do not wish to do so, delete this exception statement from
00028  *  your version.
00029  */
00030 
00031 #ifndef FOLDERJOB_H
00032 #define FOLDERJOB_H
00033 
00034 #include "kmmessage.h"
00035 
00036 #include <qobject.h>
00037 #include <qptrlist.h>
00038 #include <qstring.h>
00039 
00040 class KMFolder;
00041 
00042 namespace KMail {
00043 
00044 class FolderJob : public QObject
00045 {
00046   Q_OBJECT
00047 
00048 public:
00049   enum JobType { tListDirectory, tGetFolder, tCreateFolder, tExpungeFolder,
00050          tDeleteMessage, tGetMessage, tPutMessage, tAddSubfolders,
00051          tDeleteFolders, tCheckUidValidity, tRenameFolder,
00052                  tCopyMessage, tExpireMessages, tMoveMessage };
00057   FolderJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = 0,
00058         QString partSpecifier = QString::null );
00059 
00065   FolderJob( const QPtrList<KMMessage>& msgList, const QString& sets,
00066          JobType jt = tGetMessage, KMFolder *folder = 0 );
00072   FolderJob( JobType jt );
00073   virtual ~FolderJob();
00074 
00075   QPtrList<KMMessage> msgList() const;
00076   void start();
00077 
00078 signals:
00083   void messageRetrieved( KMMessage * );
00084 
00088   void messageUpdated( KMMessage *, QString ); 
00089 
00094   void messageStored( KMMessage * );
00095 
00101   void messageCopied( QPtrList<KMMessage> );
00102 
00108   void messageCopied( KMMessage * );
00109 
00113   void finished();
00114 
00120   void progress( unsigned long bytesDownloaded, unsigned long bytesTotal );
00121 
00122 protected:
00127   virtual void execute()=0;
00128 
00132   virtual void expireMessages()=0;
00133 
00134   QPtrList<KMMessage> mMsgList;
00135   JobType             mType;
00136   QString             mSets;
00137   KMFolder*           mSrcFolder;
00138   KMFolder*           mDestFolder;
00139   QString             mPartSpecifier;
00140 
00141   //finished() won't be emitted when this is set
00142   bool                mPassiveDestructor;
00143   bool                mStarted;
00144 };
00145 
00146 }
00147 
00148 #endif
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:18 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003