bump product version to 4.2.0.1
[LibreOffice.git] / include / tubes / conference.hxx
blob7dfd744d959a216085a8ffbf56c7b0034ab3f3d1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_TUBES_CONFERENCE_HXX
11 #define INCLUDED_TUBES_CONFERENCE_HXX
13 #include <sal/config.h>
14 #include <rtl/ustring.hxx>
16 class Collaboration;
17 class TeleConferenceImpl;
18 typedef struct _TpAccount TpAccount;
19 typedef struct _TpContact TpContact;
20 typedef struct _TpDBusTubeChannel TpDBusTubeChannel;
21 typedef struct _GDBusConnection GDBusConnection;
23 /** Conference setup by TeleManager */
24 class TeleConference
26 public:
28 TeleConference( TpAccount* pAccount,
29 TpDBusTubeChannel* pChannel,
30 const OString sUuid = OString(),
31 bool bMaster = false );
32 ~TeleConference();
34 /// Close channel and call finalize()
35 void close();
37 /// Unrefs, unregisters from manager and calls dtor if last reference!
38 void finalize();
40 bool sendPacket( const OString& rPacket );
42 void invite( TpContact *pContact );
44 typedef void (*FileSentCallback)( bool aSuccess, void* pUserData);
45 void sendFile( TpContact* pContact, const OUString& rURL, FileSentCallback pCallback, void* pUserData);
46 const OString& getUuid() const { return msUuid; }
48 Collaboration* getCollaboration() const;
49 void setCollaboration( Collaboration* pCollaboration );
51 // --- following only to be called only by manager's callbacks ---
52 // TODO: make friends instead
53 void setChannel( TpAccount* pAccount, TpDBusTubeChannel* pChannel );
54 bool offerTube();
55 bool acceptTube();
57 // Only for callbacks.
58 bool setTube( GDBusConnection* pTube );
59 void setTubeOfferedHandlerInvoked( bool b );
60 bool isTubeOfferedHandlerInvoked() const;
61 bool isMaster() const;
62 void setUuid( const OString& rUuid ) { msUuid = rUuid; }
64 private:
65 friend class TeleManager;
66 // Used only by TeleManager:
67 /// got tube accepted on other end as well?
68 bool isReady() const;
70 // Private:
71 bool spinUntilTubeEstablished();
73 Collaboration* mpCollaboration;
74 TpAccount* mpAccount;
75 TpDBusTubeChannel* mpChannel;
76 OString msUuid;
77 bool mbMaster;
78 TeleConferenceImpl* pImpl;
81 #endif // INCLUDED_TUBES_CONFERENCE_HXX
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */