kmail Library API Documentation

KMail::ScheduledTask Class Reference

A scheduled task is some information about a folder job that should be run later. More...

#include <jobscheduler.h>

Inheritance diagram for KMail::ScheduledTask:

Inheritance graph
[legend]
Collaboration diagram for KMail::ScheduledTask:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ScheduledTask (KMFolder *folder, bool immediate)
virtual ScheduledJobrun ()=0
virtual int taskTypeId () const =0
KMFolderfolder () const
bool isImmediate () const

Detailed Description

A scheduled task is some information about a folder job that should be run later.

As long as it's not running, it's called a "task", i.e. something that needs to be done. Tasks are held in the JobScheduler.

Definition at line 54 of file jobscheduler.h.


Constructor & Destructor Documentation

KMail::ScheduledTask::ScheduledTask KMFolder folder,
bool  immediate
[inline]
 

Create a scheduled task for a given folder If immediate is true, the scheduler will run this task as soon as possible (but won't interrupt a currently running job for it).

Definition at line 59 of file jobscheduler.h.


Member Function Documentation

virtual ScheduledJob* KMail::ScheduledTask::run  )  [pure virtual]
 

Run this task, i.e.

create a job for it. Important: the job's execute() method must either call open() on the folder or storage immediately, or abort (deleting itself). Usually, that job should also be cancellable. Otherwise (if the open() is delayed) an unrelated open() could happen first and mess things up. If for some reason (e.g. folder deleted) nothing should be done, return 0.

Implemented in KMail::ScheduledCompactionTask, and KMail::ScheduledExpireTask.

virtual int KMail::ScheduledTask::taskTypeId  )  const [pure virtual]
 

An identifier for the type of task (a bit like QListViewItem::rtti) This allows to automatically prevent two identical tasks from being scheduled for the same folder.

To circumvent this feature and make every task unique, return 0 here.

Implemented in KMail::ScheduledCompactionTask, and KMail::ScheduledExpireTask.

Referenced by KMail::JobScheduler::registerTask().

KMFolder* KMail::ScheduledTask::folder  )  const [inline]
 

The folder which this task is about, 0 if it was deleted meanwhile.

Definition at line 79 of file jobscheduler.h.

Referenced by KMail::JobScheduler::notifyOpeningFolder(), KMail::JobScheduler::registerTask(), KMail::ScheduledExpireTask::run(), and KMail::ScheduledCompactionTask::run().


The documentation for this class was generated from the following file:
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 Thu Oct 4 14:42:55 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003