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 #ifndef ConnectionFacade_H_ 00023 #define ConnectionFacade_H_ 00024 00025 #include <QObject> 00026 #include <QStringList> 00027 #include <QVariantMap> 00028 00029 #include <TelepathyQt4/Types> 00030 00031 #ifdef DEPRECATED_ENABLED__ 00032 #define ATTRIBUTE_DEPRECATED __attribute__((deprecated)) 00033 #else 00034 #define ATTRIBUTE_DEPRECATED 00035 #endif 00036 00037 namespace Telepathy 00038 { 00039 namespace Client 00040 { 00041 class ConnectionInterface; 00042 } 00043 } 00044 00045 namespace TpPrototype 00046 { 00047 00066 class ConnectionFacadePrivate; 00067 class Connection; 00068 class Account; 00069 00077 class ConnectionFacade: public QObject 00078 { 00079 Q_OBJECT 00080 public: 00081 static ConnectionFacade* instance(); 00086 QStringList listOfConnectionManagers(); 00087 00092 QStringList listOfProtocolsForConnectionManager( const QString& connectionManager ); 00093 00100 Telepathy::ParamSpecList paramSpecListForConnectionManagerAndProtocol( const QString& connectionManager, const QString& protocol ); 00101 00108 QVariantMap parameterListForConnectionManagerAndProtocol( const QString& connectionManager, const QString& protocol ); 00109 00116 QVariantMap parameterListForProtocol( const QString& protocol, int account_number=1 ) ATTRIBUTE_DEPRECATED; 00117 00124 TpPrototype::Connection* connectionWithAccount( Account* account, int account_number=1 ) ATTRIBUTE_DEPRECATED; 00125 00131 int selfHandleForConnectionInterface( Telepathy::Client::ConnectionInterface* connectionInterface ); 00132 00133 private: 00134 ConnectionFacade( QObject* parent ); 00135 ~ConnectionFacade(); 00136 00137 ConnectionFacadePrivate * const d; 00138 static ConnectionFacade* m_instance; 00139 }; 00140 00141 } 00142 #endif // ConnectionFacade_H_ 00143