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_Contact_H_ 00024 #define TelepathyQt4_Prototype_Contact_H_ 00025 00026 #include <QObject> 00027 #include <QPointer> 00028 #include <QVariantMap> 00029 00030 #include <TelepathyQt4/Client/Channel> 00031 00032 #include <TelepathyQt4/Prototype/AvatarManager.h> 00033 00034 #ifdef DEPRECATED_ENABLED__ 00035 #define ATTRIBUTE_DEPRECATED __attribute__((deprecated)) 00036 #else 00037 #define ATTRIBUTE_DEPRECATED 00038 #endif 00039 00040 namespace Telepathy 00041 { 00042 namespace Client 00043 { 00044 class ConnectionInterface; 00045 } 00046 } 00047 00048 namespace TpPrototype { 00049 00050 class ContactPrivate; 00051 class ContactManager; 00052 class ChatChannel; 00053 class StreamedMediaChannel; 00054 00066 class Contact : public QObject 00067 { 00068 Q_OBJECT 00069 public: 00070 enum ContactTypes 00071 { 00072 CT_Subscribed = 0, 00073 CT_LocalPending, 00074 CT_RemotePending, 00075 CT_Removed, 00076 CT_Known, 00077 CT_Blocked 00078 }; 00079 00084 bool isValid() const; 00085 00090 ContactTypes type() const; 00091 00097 void setType( ContactTypes type ); 00098 00103 uint telepathyHandle() const; 00104 00109 uint telepathyHandleType() const; 00110 00118 QString name() const; 00119 00127 Telepathy::SimplePresence presence() { return Telepathy::SimplePresence(); /* TODO: Implement me ! */ }; 00128 00134 uint presenceType() ATTRIBUTE_DEPRECATED; 00135 00141 QString presenceStatus() ATTRIBUTE_DEPRECATED; 00142 00148 bool isPresenceStateAvailable(); 00149 00155 QString presenceMessage() ATTRIBUTE_DEPRECATED; 00156 00161 Telepathy::ContactCapabilityList capabilities() const; 00162 00163 00169 TpPrototype::AvatarManager::Avatar avatar() const; 00170 00176 TpPrototype::ChatChannel* chatChannel(); 00177 00182 TpPrototype::StreamedMediaChannel* streamedMediaChannel(); 00183 00188 TpPrototype::ContactManager* contactManager(); 00189 00190 protected: 00196 Contact( const uint & handle, const QString & name, ContactTypes type, Telepathy::Client::ConnectionInterface* connectionInterface, TpPrototype::ContactManager* contactManager ); 00197 00198 ~Contact(); 00199 00203 void setPresenceType( uint _presenceType); 00204 00208 void setPresenceStatus( QString _presenceStatus); 00209 00213 void setPresenceMessage( QString _presenceMessage); 00214 00218 void setCapabilities( const Telepathy::ContactCapabilityList& capabilityList ); 00219 00225 void setAvatar( const TpPrototype::AvatarManager::Avatar& avatar ); 00226 00231 Telepathy::Client::ConnectionInterface* interface(); 00232 00233 00234 private: 00235 ContactPrivate * const d; 00236 00237 friend class ContactManager; 00238 friend class AvatarManager; 00239 friend class PresenceManager; 00240 friend class CapabilitiesManager; 00241 }; 00242 00243 } // namespace 00244 00245 // Q_DECLARE_METATYPE( TpPrototype::Contact ) 00246 00247 #endif // Header guard