implement update interval of list; can be disabled / changed by user
[kdenetwork.git] / kopete / protocols / testbed / testbedaccount.h
blob292f7946e6f446a8e9bd4d65d9196a580efbd5e9
1 /*
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 *************************************************************************
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 TESTBEDACCOUNT_H
18 #define TESTBEDACCOUNT_H
20 #include <kopeteaccount.h>
21 #include "testbedwebcamdialog.h"
23 class KActionMenu;
24 namespace Kopete
26 class Contact;
27 class MetaContact;
28 class StatusMessage;
31 class TestbedProtocol;
32 class TestbedFakeServer;
34 /**
35 * This represents an account connected to the testbed
36 * @author Will Stephenson
38 class TestbedAccount : public Kopete::Account
40 Q_OBJECT
41 public:
42 TestbedAccount( TestbedProtocol *parent, const QString& accountID );
43 ~TestbedAccount();
44 /**
45 * Construct the context menu used for the status bar icon
47 virtual void fillActionMenu( KActionMenu *actionMenu );
49 /**
50 * Creates a protocol specific Kopete::Contact subclass and adds it to the supplie
51 * Kopete::MetaContact
53 virtual bool createContact(const QString& contactId, Kopete::MetaContact* parentContact);
54 /**
55 * Called when Kopete is set globally away
57 virtual void setAway(bool away, const QString& reason);
58 /**
59 * Called when Kopete status is changed globally
61 virtual void setOnlineStatus(const Kopete::OnlineStatus& status , const Kopete::StatusMessage &reason = Kopete::StatusMessage() );
62 virtual void setStatusMessage(const Kopete::StatusMessage& statusMessage);
63 /**
64 * 'Connect' to the testbed server. Only sets myself() online.
66 virtual void connect( const Kopete::OnlineStatus& initialStatus = Kopete::OnlineStatus::OnlineStatus() );
67 /**
68 * Disconnect from the server. Only sets myself() offline.
70 virtual void disconnect();
71 /**
72 * Return a reference to the server stub
74 TestbedFakeServer* server();
75 public slots:
76 /**
77 * Called by the server when it has a message for us.
78 * This identifies the sending Kopete::Contact and passes it a Kopete::Message
80 void receivedMessage( const QString &message );
82 protected:
83 /**
84 * This simulates contacts going on and offline in sync with the account's status changes
86 void updateContactStatus();
87 TestbedFakeServer* m_server;
89 protected slots:
90 /**
91 * Change the account's status. Called by KActions and internally.
93 void slotGoOnline();
94 /**
95 * Change the account's status. Called by KActions and internally.
97 void slotGoAway();
98 /**
99 * Change the account's status. Called by KActions and internally.
101 void slotGoOffline();
103 * Show webcam. Called by KActions and internally.
105 void slotShowVideo();
109 #endif