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

kopete/libkopete

  • Kopete
  • Task
Public Types | Public Member Functions | List of all members
Kopete::Task Class Reference

#include <kopetetask.h>

Inheritance diagram for Kopete::Task:
Inheritance graph
[legend]

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.

Author
Michaƫl Larouche larou.nosp@m.che@.nosp@m.kde.o.nosp@m.rg

Definition at line 49 of file kopetetask.h.

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
parentQObject 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
taska 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::DeleteContactTask.

Definition at line 46 of file kopetetask.cpp.


The documentation for this class was generated from the following files:
  • kopetetask.h
  • kopetetask.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

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

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal