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
*************************************************************************
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. *
14
*************************************************************************
17
#ifndef TESTBEDCONTACT_H
18
#define TESTBEDCONTACT_H
23
#include "kopetecontact.h"
24
#include "kopetemessage.h"
27
class KActionCollection;
28
namespace Kopete { class Account; }
29
namespace Kopete { class ChatSession; }
30
namespace Kopete { class MetaContact; }
33
@author Will Stephenson
35
class TestbedContact : public Kopete::Contact
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 );
50
virtual bool isReachable();
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);
58
* Return the actions for this contact
60
virtual QList<KAction *> *customContextMenuActions();
62
* Returns a Kopete::ChatSession associated with this contact
64
virtual Kopete::ChatSession *manager( CanCreateFlags canCreate = CannotCreate );
67
* Set the Type of this contact
69
void setType( Type type );
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 );
78
* Called when an incoming message arrived
79
* This displays it in the chatwindow
81
void receivedMessage( const QString &message );
85
* Show the settings dialog
87
void showContactSettings();
89
* Notify the contact that its current Kopete::ChatSession was
90
* destroyed - probably by the chatwindow being closed
92
void slotChatSessionDestroyed();
95
Kopete::ChatSession* m_msgManager;
96
KActionCollection* m_actionCollection;
98
KAction* m_actionPrefs;