make webinterface translatable. there are around 20 short strings, all with context...
[kdenetwork.git] / kopete / libkopete / kopetepasswordedaccount.h
blobd193cb1ab6516ae889f7770e5e30011cc7d3f48b
1 /*
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 *************************************************************************
8 * *
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. *
13 * *
14 *************************************************************************
17 #ifndef KOPETEPASSWORDEDACCOUNT_H
18 #define KOPETEPASSWORDEDACCOUNT_H
20 #include "kopeteaccount.h"
22 #include "kopete_export.h"
25 namespace Kopete
28 class Password;
30 /**
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
38 Q_OBJECT
40 public:
42 /**
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();
55 /**
56 * Returns a reference to the password object stored in this account.
58 Password &password();
60 void connect();
62 /**
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 );
70 /**
71 * \brief Get the initial status
73 OnlineStatus initialStatus();
75 /**
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.
81 * @return Always true
83 virtual bool removeAccount();
86 public slots:
87 /**
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;
94 protected:
95 /**
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();
102 protected slots:
104 * @internal
105 * Reimplemented to set the password wrong if the reason is BadPassword
107 virtual void disconnected( Kopete::Account::DisconnectReason reason );
110 private:
111 struct Private;
112 Private *d;
117 #endif
119 // vim: set noet ts=4 sts=4 sw=4: