client-group-chat-room.h 4.13 KB
Newer Older
1 2
/*
 * client-group-chat-room.h
Ghislain MARY's avatar
Ghislain MARY committed
3
 * Copyright (C) 2010-2017 Belledonne Communications SARL
4
 *
Ghislain MARY's avatar
Ghislain MARY committed
5 6 7 8
 * 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 2
 * of the License, or (at your option) any later version.
9 10 11 12 13 14 15
 *
 * 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
Ghislain MARY's avatar
Ghislain MARY committed
16 17
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 19 20 21 22
 */

#ifndef _CLIENT_GROUP_CHAT_ROOM_H_
#define _CLIENT_GROUP_CHAT_ROOM_H_

Ronan's avatar
Ronan committed
23
#include "chat/chat-room/chat-room.h"
24
#include "conference/remote-conference.h"
25 26 27 28 29 30 31

// =============================================================================

LINPHONE_BEGIN_NAMESPACE

class ClientGroupChatRoomPrivate;

32
class LINPHONE_PUBLIC ClientGroupChatRoom : public ChatRoom, public RemoteConference {
33
public:
34 35 36
	// TODO: Make me private.
	ClientGroupChatRoom (
		const std::shared_ptr<Core> &core,
Ghislain MARY's avatar
Ghislain MARY committed
37
		const std::string &factoryUri,
38
		const IdentityAddress &me,
39 40
		const std::string &subject
	);
41

42 43
	ClientGroupChatRoom (
		const std::shared_ptr<Core> &core,
44
		const ChatRoomId &chatRoomId,
Ronan's avatar
Ronan committed
45
		std::shared_ptr<Participant> &me,
46
		const std::string &subject,
47
		std::list<std::shared_ptr<Participant>> &&participants,
48
		unsigned int lastNotifyId
49 50
	);

51 52
	std::shared_ptr<Core> getCore () const;

53
	CapabilitiesMask getCapabilities () const override;
54
	bool hasBeenLeft () const override;
55

56
	const IdentityAddress &getConferenceAddress () const override;
57 58 59

	bool canHandleParticipants () const override;

60 61
	void addParticipant (const IdentityAddress &addr, const CallSessionParams *params, bool hasMedia) override;
	void addParticipants (const std::list<IdentityAddress> &addresses, const CallSessionParams *params, bool hasMedia) override;
62 63 64 65

	void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
	void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants) override;

66
	std::shared_ptr<Participant> findParticipant (const IdentityAddress &addr) const override;
67

68
	std::shared_ptr<Participant> getMe () const override;
69
	int getParticipantCount () const override;
70
	const std::list<std::shared_ptr<Participant>> &getParticipants () const override;
71 72 73

	void setParticipantAdminStatus (std::shared_ptr<Participant> &participant, bool isAdmin) override;

74
	const std::string &getSubject () const override;
75 76
	void setSubject (const std::string &subject) override;

77
	void join () override;
78
	void leave () override;
79

80 81 82 83
private:
	// TODO: Move me in ClientGroupChatRoomPrivate.
	// ALL METHODS AFTER THIS POINT.

84 85 86
	void onConferenceCreated (const IdentityAddress &addr) override;
	void onConferenceTerminated (const IdentityAddress &addr) override;
	void onFirstNotifyReceived (const IdentityAddress &addr) override;
87 88 89 90 91 92
	void onParticipantAdded (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
	void onParticipantRemoved (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
	void onParticipantSetAdmin (const std::shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) override;
	void onSubjectChanged (const std::shared_ptr<ConferenceSubjectEvent> &event, bool isFullState) override;
	void onParticipantDeviceAdded (const std::shared_ptr<ConferenceParticipantDeviceEvent> &event, bool isFullState) override;
	void onParticipantDeviceRemoved (const std::shared_ptr<ConferenceParticipantDeviceEvent> &event, bool isFullState) override;
93

94 95
	void onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) override;
	void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) override;
96

97
	L_DECLARE_PRIVATE(ClientGroupChatRoom);
98 99 100 101 102 103
	L_DISABLE_COPY(ClientGroupChatRoom);
};

LINPHONE_END_NAMESPACE

#endif // ifndef _CLIENT_GROUP_CHAT_ROOM_H_