kopete/libkopete
#include <kopetetask.h>
Public Types | |
enum | KopeteTaskError { NoProtocolSubTaskError = KJob::UserDefinedError+1, NetworkUnavailableError } |
Public Member Functions | |
Task (QObject *parent=0) | |
virtual | ~Task () |
void | addSubTask (KJob *task) |
virtual void | start () |
Detailed Description
Base class for all Kopete task.
A Task is an encapsulation of a set of commands and data that perform a given task. In our case, a task can contain one or many sub tasks that will help the parent task to do its job.
For implementers, you should let the sub tasks do their job before doing something in the parent task. Like for example a sub task will modify the server list contact list or other things.
It is a really good idea to always call base start() method because it execute all sub tasks.
Some sub tasks are specific to a protocol and they are created using the factory method Kopete::Protocol::createProtocolTask(). See the documentation of this method for more information.
Definition at line 49 of file kopetetask.h.
Member Enumeration Documentation
Common error code for Kopete tasks.
Enumerator | |
---|---|
NoProtocolSubTaskError |
Forgot to add the protocol subtask for deleting the contact. |
NetworkUnavailableError |
The network is unavailable and thus cannot delete the contact. |
Definition at line 56 of file kopetetask.h.
Constructor & Destructor Documentation
Kopete::Task::Task | ( | QObject * | parent = 0 | ) |
|
virtual |
Destructor.
Definition at line 36 of file kopetetask.cpp.
Member Function Documentation
void Kopete::Task::addSubTask | ( | KJob * | task | ) |
|
virtual |
Execute the task.
The default behavior for the start() here is to execute all subjobs if they are available.
For definition of classes in libkopete, start() should implement the default behavior for the kind of task.
For example, for DeleteContactTask, the default behavior should call deleteLater() on contact instance.
Reimplemented in Kopete::DeleteContactTask.
Definition at line 46 of file kopetetask.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.