diff --git a/src/conference/conference-interface.h b/src/conference/conference-interface.h new file mode 100644 index 000000000..016313cf8 --- /dev/null +++ b/src/conference/conference-interface.h @@ -0,0 +1,46 @@ +/* + * conference-interface.h + * Copyright (C) 2017 Belledonne Communications SARL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _CONFERENCE_INTERFACE_H_ +#define _CONFERENCE_INTERFACE_H_ + +#include +#include + +#include "address/address.h" +#include "conference/participant.h" +#include "conference/params/call-session-params.h" + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +class ConferenceInterface { +public: + virtual std::shared_ptr addParticipant (const Address &addr, const std::shared_ptr params, bool hasMedia) = 0; + virtual void addParticipants (const std::list &addresses, const std::shared_ptr params, bool hasMedia) = 0; + virtual const std::string& getId () const = 0; + virtual int getNbParticipants () const = 0; + virtual std::list> getParticipants () const = 0; + virtual void removeParticipant (const std::shared_ptr participant) = 0; + virtual void removeParticipants (const std::list> participants) = 0; +}; + +LINPHONE_END_NAMESPACE + +#endif // ifndef _CONFERENCE_INTERFACE_H_ diff --git a/src/conference/conference-p.h b/src/conference/conference-p.h index 6de840e21..52036702b 100644 --- a/src/conference/conference-p.h +++ b/src/conference/conference-p.h @@ -61,8 +61,10 @@ private: LinphoneCore *core = nullptr; CallListener *callListener = nullptr; - std::shared_ptr me = nullptr; std::shared_ptr activeParticipant = nullptr; + std::string id; + std::shared_ptr me = nullptr; + std::list> participants; L_DECLARE_PUBLIC(Conference); }; diff --git a/src/conference/conference.cpp b/src/conference/conference.cpp index 84409427d..f6abff333 100644 --- a/src/conference/conference.cpp +++ b/src/conference/conference.cpp @@ -52,7 +52,7 @@ void ConferencePrivate::callSessionSetTerminated (const CallSession &session) { callListener->callSetTerminated(); } -void ConferencePrivate::callSessionStateChanged (const CallSession &session, LinphoneCallState state, const std::string &message) { +void ConferencePrivate::callSessionStateChanged (const CallSession &session, LinphoneCallState state, const string &message) { if (callListener) callListener->callStateChanged(state, message); } @@ -62,7 +62,7 @@ void ConferencePrivate::incomingCallSessionStarted (const CallSession &session) callListener->incomingCallStarted(); } -void ConferencePrivate::encryptionChanged (const CallSession &session, bool activated, const std::string &authToken) { +void ConferencePrivate::encryptionChanged (const CallSession &session, bool activated, const string &authToken) { if (callListener) callListener->encryptionChanged(activated, authToken); } @@ -109,6 +109,33 @@ shared_ptr Conference::addParticipant (const Address &addr, const s return d->activeParticipant; } +void Conference::addParticipants (const list &addresses, const shared_ptr params, bool hasMedia) { + // TODO +} + +const string& Conference::getId () const { + L_D(const Conference); + return d->id; +} + +int Conference::getNbParticipants () const { + // TODO + return 1; +} + +list> Conference::getParticipants () const { + L_D(const Conference); + return d->participants; +} + +void Conference::removeParticipant (const shared_ptr participant) { + // TODO +} + +void Conference::removeParticipants (const list> participants) { + // TODO +} + shared_ptr Conference::getActiveParticipant () const { L_D(const Conference); return d->activeParticipant; diff --git a/src/conference/conference.h b/src/conference/conference.h index a65535954..3b1a85920 100644 --- a/src/conference/conference.h +++ b/src/conference/conference.h @@ -24,6 +24,7 @@ #include "object/object.h" #include "address/address.h" #include "call/call-listener.h" +#include "conference/conference-interface.h" #include "conference/params/call-session-params.h" #include "conference/participant.h" @@ -36,16 +37,22 @@ LINPHONE_BEGIN_NAMESPACE class ConferencePrivate; class CallSessionPrivate; -class Conference : public Object { +class Conference : public Object, public ConferenceInterface { friend class CallSessionPrivate; public: - //Conference (CallListener *listener = nullptr); - - std::shared_ptr addParticipant (const Address &addr, const std::shared_ptr params, bool hasMedia); std::shared_ptr getActiveParticipant () const; std::shared_ptr getMe () const; + /* ConferenceInterface */ + virtual std::shared_ptr addParticipant (const Address &addr, const std::shared_ptr params, bool hasMedia); + virtual void addParticipants (const std::list &addresses, const std::shared_ptr params, bool hasMedia); + virtual const std::string& getId () const; + virtual int getNbParticipants () const; + virtual std::list> getParticipants () const; + virtual void removeParticipant (const std::shared_ptr participant); + virtual void removeParticipants (const std::list> participants); + protected: explicit Conference (ConferencePrivate &p, LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);