2
* Copyright (c) 2004 David Faure <faure@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 2 of the License
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
* In addition, as a special exception, the copyright holders give
18
* permission to link the code of this program with any edition of
19
* the Qt library by Trolltech AS, Norway (or with modified versions
20
* of Qt that use the same license as Qt), and distribute linked
21
* combinations including the two. You must obey the GNU General
22
* Public License in all respects for all of the code used other than
23
* Qt. If you modify this file, you may extend this exception to
24
* your version of the file, but you are not obligated to do so. If
25
* you do not wish to do so, delete this exception statement from
28
#ifndef MAILCOMMON_EXPIREJOB_H
29
#define MAILCOMMON_EXPIREJOB_H
31
#include "jobscheduler.h"
33
#include <akonadi/collection.h>
34
#include <akonadi/item.h>
40
namespace MailCommon {
44
class ExpireJob : public ScheduledJob
48
ExpireJob( const Akonadi::Collection& folder, bool immediate );
51
virtual void execute();
56
void slotMessagesMoved( KJob *job );
57
void itemFetchResult( KJob* job );
63
QList<Akonadi::Item> mRemovedMsgs;
68
Akonadi::Collection mMoveToFolder;
71
/// A scheduled "expire mails in this folder" task.
72
class ScheduledExpireTask : public ScheduledTask
75
/// If immediate is set, the job will execute synchronously. This is used when
76
/// the user requests explicitly that the operation should happen immediately.
77
ScheduledExpireTask( const Akonadi::Collection& folder, bool immediate )
78
: ScheduledTask( folder, immediate ) {}
79
virtual ~ScheduledExpireTask() {}
80
virtual ScheduledJob* run() {
81
return folder().isValid() ? new ExpireJob( folder(), isImmediate() ) : 0;
83
virtual int taskTypeId() const { return 1; }