Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / protocols / testbed / testbedcontact.h
blob163408bbfc774bcdc0b0c9bed8e8cdc81d3dec54
1 /*
2 testbedcontact.h - Kopete Testbed Protocol
4 Copyright (c) 2003 by Will Stephenson <will@stevello.free-online.co.uk>
5 Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
8 * *
9 * This library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU General Public *
11 * License as published by the Free Software Foundation; either *
12 * version 2 of the License, or (at your option) any later version. *
13 * *
14 *************************************************************************
17 #ifndef TESTBEDCONTACT_H
18 #define TESTBEDCONTACT_H
20 #include <qmap.h>
21 //Added by qt3to4:
22 #include <QList>
23 #include "kopetecontact.h"
24 #include "kopetemessage.h"
26 class KAction;
27 class KActionCollection;
28 namespace Kopete { class Account; }
29 namespace Kopete { class ChatSession; }
30 namespace Kopete { class MetaContact; }
32 /**
33 @author Will Stephenson
35 class TestbedContact : public Kopete::Contact
37 Q_OBJECT
38 public:
39 /**
40 * The range of possible contact types
42 enum Type { Null, Echo, Group };
44 TestbedContact( Kopete::Account* _account, const QString &uniqueName,
45 const QString &displayName,
46 Kopete::MetaContact *parent );
48 ~TestbedContact();
50 virtual bool isReachable();
51 /**
52 * Serialize the contact's data into a key-value map
53 * suitable for writing to a file
55 virtual void serialize(QMap< QString, QString >& serializedData,
56 QMap< QString, QString >& addressBookData);
57 /**
58 * Return the actions for this contact
60 virtual QList<KAction *> *customContextMenuActions();
61 /**
62 * Returns a Kopete::ChatSession associated with this contact
64 virtual Kopete::ChatSession *manager( CanCreateFlags canCreate = CannotCreate );
66 /**
67 * Set the Type of this contact
69 void setType( Type type );
70 public slots:
71 /**
72 * Transmits an outgoing message to the server
73 * Called when the chat window send button has been pressed
74 * (in response to the relevant Kopete::ChatSession signal)
76 void sendMessage( Kopete::Message &message );
77 /**
78 * Called when an incoming message arrived
79 * This displays it in the chatwindow
81 void receivedMessage( const QString &message );
83 protected slots:
84 /**
85 * Show the settings dialog
87 void showContactSettings();
88 /**
89 * Notify the contact that its current Kopete::ChatSession was
90 * destroyed - probably by the chatwindow being closed
92 void slotChatSessionDestroyed();
94 protected:
95 Kopete::ChatSession* m_msgManager;
96 KActionCollection* m_actionCollection;
97 Type m_type;
98 KAction* m_actionPrefs;
101 #endif