2 kopetepasswordedaccount.h - Kopete Account with a password
4 Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk>
5 Kopete (c) 2002-2004 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 Lesser 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 KOPETEPASSWORDEDACCOUNT_H
18 #define KOPETEPASSWORDEDACCOUNT_H
20 #include "kopeteaccount.h"
22 #include "kopete_export.h"
31 * An account requiring a password to connect. Instead of reimplementing connect()
32 * in your subclass, reimplement connectWithPassword.
34 * @author Richard Smith <kde@metafoo.co.uk>
36 class KOPETE_EXPORT PasswordedAccount
: public Account
43 * KopetePasswordedAccount constructor
44 * @param parent The protocol this account connects via
45 * @param acctId The ID of this account - should be unique within this protocol
46 * @param maxPasswordLength The maximum length for passwords for this account, or 0 for no limit
47 * @param allowBlankPassword If this protocol allows blank passwords. Note that this will mean that
49 * @param name The name for this QObject
51 PasswordedAccount( Protocol
*parent
, const QString
&acctId
, bool allowBlankPassword
= false );
53 virtual ~PasswordedAccount();
56 * Returns a reference to the password object stored in this account.
63 * @brief Go online for this service.
65 * @param initialStatus is the status to connect with. If it is an invalid status for this
66 * account, the default online for the account should be used.
68 void connect( const OnlineStatus
& initialStatus
);
71 * \brief Get the initial status
73 OnlineStatus
initialStatus();
76 * @brief Remove the account from the server.
78 * Reimplementation of Account::removeAccount() to remove the password from the wallet.
79 * if your protocol reimplements this function, this function should still be called.
83 virtual bool removeAccount();
88 * Called when your account should attempt to connect.
89 * @param password The password to connect with, or QString()
90 * if the user wished to cancel the connection attempt.
92 virtual void connectWithPassword( const QString
&password
) = 0;
96 * Returns the prompt shown to the user when requesting their password.
97 * The default implementation should be adequate in most cases; override
98 * if you have a custom message to show the user.
100 virtual QString
passwordPrompt();
105 * Reimplemented to set the password wrong if the reason is BadPassword
107 virtual void disconnected( Kopete::Account::DisconnectReason reason
);
119 // vim: set noet ts=4 sts=4 sw=4: