2 testbedaccount.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 TESTBEDACCOUNT_H
18 #define TESTBEDACCOUNT_H
20 #include <kopeteaccount.h>
21 #include "testbedwebcamdialog.h"
31 class TestbedProtocol
;
32 class TestbedFakeServer
;
35 * This represents an account connected to the testbed
36 * @author Will Stephenson
38 class TestbedAccount
: public Kopete::Account
42 TestbedAccount( TestbedProtocol
*parent
, const QString
& accountID
);
45 * Construct the context menu used for the status bar icon
47 virtual void fillActionMenu( KActionMenu
*actionMenu
);
50 * Creates a protocol specific Kopete::Contact subclass and adds it to the supplie
53 virtual bool createContact(const QString
& contactId
, Kopete::MetaContact
* parentContact
);
55 * Called when Kopete is set globally away
57 virtual void setAway(bool away
, const QString
& reason
);
59 * Called when Kopete status is changed globally
61 virtual void setOnlineStatus(const Kopete::OnlineStatus
& status
, const Kopete::StatusMessage
&reason
= Kopete::StatusMessage(),
62 const OnlineStatusOptions
& options
= None
);
63 virtual void setStatusMessage(const Kopete::StatusMessage
& statusMessage
);
65 * 'Connect' to the testbed server. Only sets myself() online.
67 virtual void connect( const Kopete::OnlineStatus
& initialStatus
= Kopete::OnlineStatus() );
69 * Disconnect from the server. Only sets myself() offline.
71 virtual void disconnect();
73 * Return a reference to the server stub
75 TestbedFakeServer
* server();
78 * Called by the server when it has a message for us.
79 * This identifies the sending Kopete::Contact and passes it a Kopete::Message
81 void receivedMessage( const QString
&message
);
85 * This simulates contacts going on and offline in sync with the account's status changes
87 void updateContactStatus();
88 TestbedFakeServer
* m_server
;
92 * Change the account's status. Called by KActions and internally.
96 * Change the account's status. Called by KActions and internally.
100 * Change the account's status. Called by KActions and internally.
102 void slotGoOffline();
104 * Show webcam. Called by KActions and internally.
106 void slotShowVideo();