From 34c6421bddddb2128dd59acc867f73739ac1ca62 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Mon, 6 Aug 2012 15:29:17 +0200 Subject: tubes: handle TeleConference internally in Collaboration Hopefully, this simplifies the tubes <-> app interface Change-Id: I8933fde490941b259d5d133972db26a09ab380d5 --- tubes/inc/tubes/collaboration.hxx | 28 +++++++++++++++++----------- tubes/inc/tubes/conference.hxx | 9 ++++----- 2 files changed, 21 insertions(+), 16 deletions(-) (limited to 'tubes/inc') diff --git a/tubes/inc/tubes/collaboration.hxx b/tubes/inc/tubes/collaboration.hxx index 65595cde1143..15d59d4abf66 100644 --- a/tubes/inc/tubes/collaboration.hxx +++ b/tubes/inc/tubes/collaboration.hxx @@ -13,23 +13,29 @@ #include #include +#include class TeleConference; typedef struct _TpContact TpContact; -class Collaboration +class TUBES_DLLPUBLIC Collaboration { + TeleConference* mpConference; public: - Collaboration() {} - virtual ~Collaboration() {} - - virtual void ContactLeft() = 0; - virtual TeleConference* GetConference() = 0; - virtual sal_uInt64 GetId() = 0; - virtual void PacketReceived( const OString& rPacket ) = 0; - virtual void SetCollaboration( TeleConference* pConference ) = 0; - // TODO: I think this could be moved to TeleManager later. - virtual void SendFile( TpContact* pContact, const OUString& rURL ) = 0; + Collaboration(); + virtual ~Collaboration(); + + virtual void ContactLeft() const = 0; + virtual void PacketReceived( const OString& rPacket ) const = 0; + virtual void SaveAndSendFile( TpContact* pContact, const OUString& rURL ) const = 0; + virtual void StartCollaboration( TeleConference* pConference ) = 0; + + TUBES_DLLPRIVATE TeleConference* GetConference() const; + TUBES_DLLPRIVATE sal_uInt64 GetId() const; + + void SendFile( TpContact* pContact, const OUString& rURL ) const; + void SendPacket( const OString& rPacket ) const; + void SetConference( TeleConference* pConference ); }; #endif // INCLUDED_TUBES_COLLABORATION_HXX diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx index 3f600e06a650..1514b141cd0b 100644 --- a/tubes/inc/tubes/conference.hxx +++ b/tubes/inc/tubes/conference.hxx @@ -30,7 +30,6 @@ #define INCLUDED_TUBES_CONFERENCE_HXX #include -#include "tubes/tubesdllapi.h" #include class Collaboration; @@ -52,21 +51,21 @@ public: ~TeleConference(); /// Close channel and call finalize() - TUBES_DLLPUBLIC void close(); + void close(); /// Unrefs, unregisters from manager and calls dtor if last reference! void finalize(); - TUBES_DLLPUBLIC bool sendPacket( const OString& rPacket ); + bool sendPacket( const OString& rPacket ); void invite( TpContact *pContact ); typedef void (*FileSentCallback)( bool aSuccess, void* pUserData); - TUBES_DLLPUBLIC void sendFile( TpContact* pContact, rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData); + void sendFile( TpContact* pContact, const OUString& rURL, FileSentCallback pCallback, void* pUserData); const OString& getUuid() const { return msUuid; } Collaboration* getCollaboration() const; - TUBES_DLLPUBLIC void setCollaboration( Collaboration* pCollaboration ); + void setCollaboration( Collaboration* pCollaboration ); // --- following only to be called only by manager's callbacks --- // TODO: make friends instead -- cgit v1.2.3