kmail
renamejob.h
00001 /* 00002 * Copyright (c) 2004 Carsten Burghardt <burghardt@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; version 2 of the License 00007 * 00008 * This program is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with this program; if not, write to the Free Software 00015 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00016 * 00017 * In addition, as a special exception, the copyright holders give 00018 * permission to link the code of this program with any edition of 00019 * the Qt library by Trolltech AS, Norway (or with modified versions 00020 * of Qt that use the same license as Qt), and distribute linked 00021 * combinations including the two. You must obey the GNU General 00022 * Public License in all respects for all of the code used other than 00023 * Qt. If you modify this file, you may extend this exception to 00024 * your version of the file, but you are not obligated to do so. If 00025 * you do not wish to do so, delete this exception statement from 00026 * your version. 00027 */ 00028 #ifndef RENAMEJOB_H 00029 #define RENAMEJOB_H 00030 00031 #include "folderjob.h" 00032 00033 class FolderStorage; 00034 class KMFolderDir; 00035 class KMFolder; 00036 class KMCommand; 00037 00038 namespace KIO { 00039 class Job; 00040 } 00041 00042 namespace KMail { 00043 00049 class RenameJob : public FolderJob 00050 { 00051 Q_OBJECT 00052 public: 00059 RenameJob( FolderStorage* storage, const QString& newName, 00060 KMFolderDir* newParent = 0 ); 00061 00062 virtual ~RenameJob(); 00063 00064 virtual void execute(); 00065 00066 protected slots: 00068 void slotRenameResult( KIO::Job* job ); 00069 00071 void slotMoveMessages(); 00072 00074 void slotMoveCompleted( KMCommand *command ); 00075 00076 void slotMoveSubFolders( QString newName, bool success ); 00077 00078 signals: 00080 void renameDone( QString newName, bool success ); 00081 00082 protected: 00083 void moveSubFoldersBeforeMessages(); 00084 00085 FolderStorage* mStorage; 00086 FolderStorage* mStorageTempOpened; 00087 KMFolderDir* mNewParent; 00088 QString mNewName; 00089 QString mNewImapPath; 00090 QString mOldName; 00091 QString mOldImapPath; 00092 KMFolder* mNewFolder; 00093 }; 00094 00095 } // namespace KMail 00096 00097 #endif /* RENAMEJOB_H */ 00098