Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / protocols / testbed / testbedaccount.h
blob3d70cc99854b6e3413c35affa74baf0fb0f49db7
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 const OnlineStatusOptions& options = None);
63 virtual void setStatusMessage(const Kopete::StatusMessage& statusMessage);
64 /**
65 * 'Connect' to the testbed server. Only sets myself() online.
67 virtual void connect( const Kopete::OnlineStatus& initialStatus = Kopete::OnlineStatus() );
68 /**
69 * Disconnect from the server. Only sets myself() offline.
71 virtual void disconnect();
72 /**
73 * Return a reference to the server stub
75 TestbedFakeServer* server();
76 public slots:
77 /**
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 );
83 protected:
84 /**
85 * This simulates contacts going on and offline in sync with the account's status changes
87 void updateContactStatus();
88 TestbedFakeServer* m_server;
90 protected slots:
91 /**
92 * Change the account's status. Called by KActions and internally.
94 void slotGoOnline();
95 /**
96 * Change the account's status. Called by KActions and internally.
98 void slotGoAway();
99 /**
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();
110 #endif