00001 /* 00002 * This file is part of TelepathyQt4 00003 * 00004 * Copyright (C) 2008 basysKom GmbH 00005 * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/> 00006 * Copyright (C) 2008 Nokia Corporation 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 #ifndef TelepathyQt4_Prototype_Account_H_ 00024 #define TelepathyQt4_Prototype_Account_H_ 00025 00026 #include <QObject> 00027 #include <QPointer> 00028 #include <QVariantMap> 00029 00030 namespace Telepathy { 00031 namespace Client { 00032 class AccountInterface; 00033 } 00034 } 00035 00036 namespace TpPrototype { 00037 00038 class Connection; 00039 class AccountPrivate; 00040 00047 class Account : public QObject 00048 { 00049 Q_OBJECT 00050 public: 00056 QVariantMap parameters(); 00057 00061 QVariantMap properties(); 00062 00067 void setProperties( const QVariantMap& properties ); 00068 00074 bool setParameters( const QVariantMap& parameters ); 00075 00083 TpPrototype::Connection* connection( QObject* parent = NULL ); 00084 00092 bool remove(); 00093 00098 bool isValid(); 00099 00105 QString connectionManagerName(); 00106 00112 QString protocolName(); 00113 00120 QString currentPresence(); 00121 00122 signals: 00124 void signalPropertiesChanged( const QVariantMap& properties ); 00125 00127 void signalAboutToRemove(); 00128 00130 void signalRemoved(); 00131 00135 void signalPresenceChanged(); 00136 00137 00138 protected slots: 00139 void slotPropertiesChanged( const QVariantMap& properties ); 00140 void slotRemoved(); 00141 00142 protected: 00146 Account( const QString& handle, QObject* parent ); 00147 ~Account(); 00148 00153 Telepathy::Client::AccountInterface* interface(); 00154 00160 QString handle() const; 00161 00162 private: 00163 void init( const QString handle ); 00164 00165 AccountPrivate * const d; 00166 friend class AccountManager; // TODO: Remove this friend class 00167 friend class AccountManagerPrivate; 00168 }; 00169 00170 } 00171 00172 00173 #endif