Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __TELEPATHY_ACCOUNT_HANDLER__
00022 #define __TELEPATHY_ACCOUNT_HANDLER__
00023
00024 #include <vector>
00025
00026 #include <dbus/dbus.h>
00027 #include <dbus/dbus-glib.h>
00028 #include <dbus/dbus-glib-lowlevel.h>
00029
00030 #include <telepathy-glib/telepathy-glib.h>
00031
00032 #include <account/xp/AccountHandler.h>
00033 #include "DTubeBuddy.h"
00034 #include "TelepathyBuddy.h"
00035
00036 #define DEFAULT_CONFERENCE_SERVER "conference.telepathy.im"
00037 #define INTERFACE "org.freedesktop.Telepathy.Client.AbiCollab"
00038 #define SEND_ONE_METHOD "SendOne"
00039
00040 extern AccountHandlerConstructor TelepathyAccountHandlerConstructor;
00041
00042 class Session;
00043 class FV_View;
00044
00045 class TelepathyAccountHandler : public AccountHandler
00046 {
00047 public:
00048 static TelepathyAccountHandler* getHandler();
00049 TelepathyAccountHandler();
00050 virtual ~TelepathyAccountHandler();
00051
00052
00053 virtual UT_UTF8String getDescription();
00054 virtual UT_UTF8String getDisplayType();
00055 virtual UT_UTF8String getStorageType();
00056
00057
00058 virtual void embedDialogWidgets(void* pEmbeddingParent);
00059 virtual void removeDialogWidgets(void* pEmbeddingParent);
00060 virtual bool canDelete()
00061 { return false; }
00062 virtual void loadProperties();
00063 virtual void storeProperties();
00064
00065
00066 virtual ConnectResult connect();
00067 virtual bool disconnect();
00068 virtual bool isOnline();
00069 void acceptTube(TpChannel *tubes_chan, const char* address);
00070 void finalizeOfferTube(TelepathyChatroomPtr pChatroom);
00071
00072
00073 virtual void getBuddiesAsync();
00074 virtual BuddyPtr constructBuddy(const PropertyMap& props);
00075 virtual BuddyPtr constructBuddy(const std::string& descriptor, BuddyPtr pBuddy);
00076 virtual bool recognizeBuddyIdentifier(const std::string& identifier);
00077 virtual bool allowsManualBuddies()
00078 { return false; }
00079 virtual void forceDisconnectBuddy(BuddyPtr pBuddy);
00080 virtual bool hasAccess(const std::vector<std::string>& , BuddyPtr pBuddy);
00081 virtual bool hasPersistentAccessControl()
00082 { return true; }
00083 void addContact(TpContact* contact);
00084 void buddyDisconnected(TelepathyChatroomPtr pChatroom, TpHandle disconnected);
00085
00086
00087 virtual bool startSession(PD_Document* pDoc, const std::vector<std::string>& acl, AbiCollab** pSession);
00088 virtual bool setAcl(AbiCollab* , const std::vector<std::string>& );
00089 virtual bool allowsSessionTakeover()
00090 { return false; }
00091 void unregisterChatroom(TelepathyChatroomPtr pChatroom);
00092
00093
00094 virtual void signal(const Event& event, BuddyPtr pSource);
00095
00096
00097 virtual bool send(const Packet* pPacket);
00098 virtual bool send(const Packet* pPacket, BuddyPtr buddy);
00099 void handleMessage(DTubeBuddyPtr pBuddy, const std::string& packet_str);
00100
00101 private:
00102 void _inviteBuddies(TelepathyChatroomPtr pChatroom, const std::vector<std::string>& );
00103 std::vector<TelepathyBuddyPtr> _getBuddies(const std::vector<std::string>& vAcl);
00104 TelepathyBuddyPtr _getBuddy(TelepathyBuddyPtr pBuddy);
00105 TelepathyChatroomPtr _getChatroom(const std::string& sSessionId);
00106
00107 GtkWidget* table;
00108 GtkWidget* conference_entry;
00109 GtkWidget* autoconnect_button;
00110
00111 TpBaseClient* m_pTpClient;
00112 std::vector<TelepathyChatroomPtr> m_chatrooms;
00113 };
00114
00115 #endif