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_CapabilitiesManager_H_ 00024 #define TelepathyQt4_Prototype_CapabilitiesManager_H_ 00025 00026 #include <QDBusObjectPath> 00027 #include <QObject> 00028 #include <QPointer> 00029 00030 #include <TelepathyQt4/Types> 00031 00032 namespace Telepathy 00033 { 00034 namespace Client 00035 { 00036 class ConnectionInterface; 00037 } 00038 } 00039 00040 namespace TpPrototype { 00041 00042 class CapabilitiesManagerPrivate; 00043 class Connection; 00044 class Contact; 00045 class Account; 00046 00059 class CapabilitiesManager : public QObject 00060 { 00061 Q_OBJECT 00062 public: 00067 bool isValid(); 00068 00073 TpPrototype::Connection* connection(); 00074 00082 bool setCapabilities( const Telepathy::CapabilityPairList& capabilities, const QStringList& removedChannels = QStringList() ); 00083 00089 Telepathy::ContactCapabilityList capabilities(); 00090 00095 void capabilitiesForContactList( const QList<QPointer<Contact> >& contacts ); 00096 00097 signals: 00101 void signalCapabilitiesChanged( TpPrototype::Contact* contact, const Telepathy::CapabilityChange& changedCapability ); 00102 00106 void signalOwnCapabilityChanged( const Telepathy::CapabilityChange& changedCapability ); 00107 00108 protected: 00112 CapabilitiesManager( TpPrototype::Connection* connection, 00113 Telepathy::Client::ConnectionInterface* interface, 00114 QObject* parent = NULL ); 00115 ~CapabilitiesManager(); 00116 00117 protected slots: 00118 void slotCapabilitiesChanged( const Telepathy::CapabilityChangeList& capabilities ); 00119 00120 private: 00121 void init( TpPrototype::Connection* connection, Telepathy::Client::ConnectionInterface* interface ); 00122 00123 TpPrototype::CapabilitiesManagerPrivate * const d; 00124 friend class Connection; 00125 friend class ConnectionPrivate; 00126 }; 00127 } 00128 00129 #endif