make webinterface translatable. there are around 20 short strings, all with context...
[kdenetwork.git] / kopete / libkopete / kopeteidentity.h
blob64e23fd29c002cb893325e633991a1f869f7462c
1 /*
2 kopeteidentity.h - Kopete Identity
4 Copyright (c) 2007 by Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
5 (c) 2007 Will Stephenson <wstephenson@kde.org>
7 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
10 * *
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Lesser General Public *
13 * License as published by the Free Software Foundation; either *
14 * version 2 of the License, or (at your option) any later version. *
15 * *
16 *************************************************************************
19 #ifndef KOPETEIDENTITY_H
20 #define KOPETEIDENTITY_H
22 #include <kdemacros.h>
23 #include "kopeteglobal.h"
24 #include "kopetepropertycontainer.h"
25 #include "kopeteonlinestatus.h"
26 #include "kopete_export.h"
28 class KConfigGroup;
30 namespace Kopete
33 class Account;
34 class StatusMessage;
36 /**
37 * @author Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
39 * An identity that might contain one or more accounts associated to it
41 class KOPETE_EXPORT Identity : public PropertyContainer
43 Q_OBJECT
44 public:
45 typedef QList<Identity*> List;
46 /**
47 * @brief The main constructor for Kopete Identities
49 * This will create an empty identity with a random id
50 * @param label the label to use for this identity
52 Identity(const QString &label);
54 /**
55 * @brief Constructor for deserialising stored Identities
56 * @param id the stored Identity's id
57 * @param label the stored Identity's label
59 Identity(const QString &id, const QString &label);
61 ~Identity();
63 /**
64 * @brief Duplicates an existing identity
66 * This will create a new identity name @param id, that clones all properties
67 * @return duplicate Identity
69 Identity * clone() const;
70 /**
71 * The id is a unique internal handle and should not be exposed in the UI
72 * @return the identity's id
74 QString id() const;
76 /**
77 * The label is used to identify the identity in the UI
78 * @return the identity's label
80 QString label() const;
82 /**
83 * Sets the label
84 * @param newLabel a new label for the identity
86 void setLabel( const QString & label );
88 /**
89 * This identity should be connected when connect all is called?
91 bool excludeConnect() const;
93 /**
94 * @brief Get the online status of the identity
95 * @return the online status of the identity
97 OnlineStatus::StatusType onlineStatus() const;
99 /**
100 * @brief Get the current status message of the identity
102 Kopete::StatusMessage statusMessage() const;
105 * \brief Get the tooltip for this identity
106 * \return an RTF tooltip depending on Kopete::AppearanceSettings settings
108 QString toolTip() const;
111 * \brief Return the icon for this identity
113 QString customIcon() const;
116 * Returns the accounts assigned to this identity
118 QList<Account*> accounts() const;
121 * @brief Adds an account to the identity
123 * @param account the account to be added
125 void addAccount( Kopete::Account *account );
128 * Returns the @ref KConfigGroup that should be used to read/write settings
129 * of this identity
131 KConfigGroup *configGroup() const;
134 * Load the identity information
136 void load();
139 * Save the identity information
141 void save();
143 public slots:
145 * @brief Sets the online status for this identity
146 * Sets the online status for each account in this identity, except those which are set to
147 * 'Exclude from connect all' (Kopete::Account::excludeConnect()).
148 * @param category generic OnlineStatusManager::Categories identifying status to set
149 * @param statusMessage is the new status message to use in this onlinestatus
151 void setOnlineStatus( uint category, const Kopete::StatusMessage &statusMessage );
154 * @brief Sets the status message for this identity
155 * Sets the status message for each account in this identity, except those which are set to
156 * 'Exclude from connect all' (Kopete::Account::excludeConnect()).
157 * @param statusMessage is the new status message to use
159 void setStatusMessage( const Kopete::StatusMessage &statusMessage );
162 * @brief Removes an account from the identity
164 * @param account the account to be removed
166 void removeAccount( const Kopete::Account *account );
168 void updateOnlineStatus();
170 protected slots:
171 void slotSaveProperty( Kopete::PropertyContainer *container, const QString &key,
172 const QVariant &oldValue, const QVariant &newValue );
174 signals:
175 void onlineStatusChanged( Kopete::Identity* );
176 void toolTipChanged( Kopete::Identity* );
177 void identityDestroyed( const Kopete::Identity *identity );
178 void identityChanged(Kopete::Identity *identity);
180 private:
181 class Private;
182 Private *d;
186 } //END namespace Kopete
188 #endif