Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / libkopete / tasks / kopetecontacttaskbase.h
blob2f9b555d3953bdca7477b19e38f097ba7108f342
1 /*
2 kopetecontacttaskbase.h - Base task for all contact tasks
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 *************************************************************************
9 * *
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. *
14 * *
15 *************************************************************************
17 #ifndef KOPETE_CONTACTTASKBASE_H
18 #define KOPETE_CONTACTTASKBASE_H
20 #include <kopetetask.h>
21 #include <kopete_export.h>
23 namespace Kopete
26 class Contact;
27 /**
28 * @brief Base tasks for all contact related tasks
30 * This class contains all the common code and data
31 * for all contact tasks.
33 * Derived must implement tastType() to allow setContact()
34 * to automatically add the correct subtask from the protocol.
36 * @author Michaël Larouche <larouche@kde.org>
38 class KOPETE_EXPORT ContactTaskBase : public Kopete::Task
40 Q_OBJECT
41 public:
42 /**
43 * @brief Default constructor
45 / You must set the contact with setContact()
47 explicit ContactTaskBase(QObject *parent = 0);
48 /**
49 * destructor
51 virtual ~ContactTaskBase();
53 /**
54 * @brief Set the contact
56 * This method also add children tasks for
57 * the specific protocol. You don't need
58 * to do it yourself.
60 void setContact(Kopete::Contact *contact);
62 protected:
63 /**
64 * @brief Get access to Kopete::Contact
65 * @return a Kopete::Contact pointer.
67 Kopete::Contact *contact();
69 /**
70 * @brief Get the taskType
72 * This is the type of task from the devired class.
73 * Used by setContact()
75 virtual QString taskType() const = 0;
77 private:
78 class Private;
79 Private * const d;
83 #endif