make webinterface translatable. there are around 20 short strings, all with context...
[kdenetwork.git] / kopete / libkopete / managedconnectionaccount.h
blobd824f0994125093f04902889d96feb0995784737
1 /*
2 managedconnectionaccount.h - Kopete Account that uses a manager to
3 control its connection and respond to connection events
5 Copyright (c) 2005 by Will Stephenson <wstephenson@kde.org>
6 Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
9 * *
10 * This library is free software; you can redistribute it and/or *
11 * modify it under the terms of the GNU Lesser General Public *
12 * License as published by the Free Software Foundation; either *
13 * version 2 of the License, or (at your option) any later version. *
14 * *
15 *************************************************************************
18 #ifndef MANAGEDCONNECTIONACCOUNT_H
19 #define MANAGEDCONNECTIONACCOUNT_H
21 #include "networkstatuscommon.h"
23 #include "kopetepasswordedaccount.h"
25 namespace Kopete
27 class Protocol;
29 /**
30 * A ManagedConnectionAccount queries the NetworkStatus KDED Module before trying to connect using
31 * connectwithPassword, starting a network connection if needed. If the network is not available,
32 * it delays calling performConnectWithPassword until it receives notification from the daemon
33 * that the network is up. The account receiveds notifications from the daemon of network failures
34 * and calls disconnect to set the account offline in a timely manner.
36 class KOPETE_EXPORT ManagedConnectionAccount : public PasswordedAccount
38 Q_OBJECT
39 public:
40 /**
41 * @brief ManagedConnectionAccount constructor.
42 * @param parent The protocol this account connects via
43 * @param acctId The ID of this account - should be unique within this protocol
44 * @param maxPasswordLength The maximum length for passwords for this account, or 0 for no limit
46 ManagedConnectionAccount( Protocol *parent, const QString &acctId );
47 public slots:
48 /**
49 * @brief Begin the connection process, by checking if the connection is available with the ConnectionManager.
50 * This method is called by PasswordedAccount::connect()
51 * @param password the password to connect with.
53 void connectWithPassword( const QString &password );
54 protected:
55 /**
56 * @brief Connect to the server, once the network is available.
57 * This method is called by the ManagedConnectionAccount once the network is available. In this method you should set up your
58 * network connection and connect to the server.
60 virtual void performConnectWithPassword( const QString & password ) = 0;
61 protected slots:
62 /**
63 * @brief Handle a change in the network connection
64 * Called by the ConnectionManager when the network comes up or fails.
65 * The default implementation calls performConnectWithPassword when the network goes online and connectWithPassword() was
66 * previously called, and calls disconnect() when the connection goes down.
67 * @param host For future expansion.
68 * @param status the new status of the network
70 virtual void slotConnectionStatusChanged( const QString & host, NetworkStatus::EnumStatus status );
71 private:
72 QString m_password;
73 bool m_waitingForConnection;
78 #endif