2 kopetedeletecontacttask.h - Kopete Delete Contact Task
4 Copyright (c) 2007 by Michaël Larouche <larouche@kde.org>
6 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
10 * This library is free software; you can redistribute it and/or *
11 * modify it under the terms of the GNU Lesser General Public *
12 * License as published by the Free Software Foundation; either *
13 * version 2 of the License, or (at your option) any later version. *
15 *************************************************************************
17 #ifndef KOPETE_DELETECONTACTTASK_H
18 #define KOPETE_DELETECONTACTTASK_H
20 #include <kopete_export.h>
21 #include <kopetecontacttaskbase.h>
28 * @brief Delete a contact in Kopete
32 Kopete::DeleteContactTask *deleteTask = new Kopete::DeleteContactTask(aContact);
33 deleteTask->addSubTask( new JabberDeleteContactTask(aContact) );
34 connect(deleteTask, SIGNAL(result(KJob*)), receiver, SLOT(slotResult(KJob*)));
38 * @section protocol_delete Implementing protocol subtask for deleting
39 * It is a good idea to inherit from DeleteContactTask. In your implementation
40 * of start() method, please DO NOT call parent start() method from DeleteContactTask.
42 * DeleteContactTask will delete the contact after the subjob,
43 * so you don't need to explicit call deleteLater() on contact.
45 * Also, you don't need to check if the network(or account if you prefer)
46 * is available, DeleteContactTask do it for you.
48 * The name of this task is "DeleteContactTask".
50 * @author Michaël Larouche <larouche@kde.org>
52 class KOPETE_EXPORT DeleteContactTask
: public Kopete::ContactTaskBase
57 * @brief Default constructor
59 * You must set the contact to delete with setContact()
61 DeleteContactTask(QObject
*parent
= 0); //implicit
64 * @brief Delete the given contact
65 * @param contact Kopete contact to delete
67 explicit DeleteContactTask(Kopete::Contact
*contact
);
76 * @brief Begin the task.
77 * Inherited from Kopete::Task::start()
83 * @brief Execute the next sub job
85 * This slot is called when a subjob has finished.
86 * @param subJob sub job that has been finished.
88 virtual void slotResult(KJob
*subJob
);
92 * @brief Return Task Type
93 * @return DeleteContactTask
95 QString
taskType() const;