• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kopete/libkopete

Kopete::Task

Kopete::Task Class Reference

#include <kopetetask.h>

Inheritance diagram for Kopete::Task:

Inheritance graph
[legend]

List of all members.


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.

Author:
Michaƫl Larouche <larouche@kde.org>

Definition at line 49 of file 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 ()

Member Enumeration Documentation

enum Kopete::Task::KopeteTaskError

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  ) 

Create a new task.

Parameters:
parent QObject parent

Definition at line 31 of file kopetetask.cpp.

Kopete::Task::~Task (  )  [virtual]

Destructor.

Definition at line 36 of file kopetetask.cpp.


Member Function Documentation

void Kopete::Task::addSubTask ( KJob *  task  ) 

Add a new sub task.

Parameters:
task a new task

Definition at line 41 of file kopetetask.cpp.

void Kopete::Task::start (  )  [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::ProcessMessageTask, and Kopete::DeleteContactTask.

Definition at line 46 of file kopetetask.cpp.


The documentation for this class was generated from the following files:
  • kopetetask.h
  • kopetetask.cpp

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal