﻿using System.Collections.Generic;
namespace ChatSDK
{
	/**
	     * The group manager callback interface.
		 *
	     */
    public interface IGroupManagerDelegate
    {
        /**
	     * Occurs when the user receives a group invitation.
		 * 
	     * @param groupId		The group ID.
	     * @param groupName		The group name.
	     * @param inviter		The user ID of the inviter.
	     * @param reason		The reason for invitation.
	     */
        void OnInvitationReceivedFromGroup(
            string groupId, string groupName, string inviter, string reason);

        /**
         * Occurs when the group owner or admin receives a join request from a user.
	     *
	     * @param groupId		The group ID.
	     * @param groupName		The group name.
	     * @param applicant		The ID of the user requesting to join the group.
	     * @param reason		The reason for requesting to join the group.
	     */        
        void OnRequestToJoinReceivedFromGroup(
            string groupId, string groupName, string applicant, string reason);

        /**
	     * Occurs when a join request is accepted.
	     *
	     * @param groupId 		The group ID.
	     * @param groupName 	The group name.
	     * @param accepter 		The ID of the user that accepts the join request.
	     */
        void OnRequestToJoinAcceptedFromGroup(
            string groupId, string groupName, string accepter);

        /**
         * Occurs when a join request is declined.
	     *
	     * @param groupId 		The group ID.
	     * @param groupName 	The group name.
	     * @param decliner 		The ID of the user that declines the join request.
	     * @param reason 		The reason for declining the join request.
	     */
        void OnRequestToJoinDeclinedFromGroup(
            string groupId, string groupName, string decliner, string reason);

        /**
         * Occurs when a group invitation is accepted.
	     *
	     * @param groupId 		The group ID.
	     * @param invitee 		The user ID of the invitee.
	     * @param reason		The reason for accepting the group invitation.
	     */
        void OnInvitationAcceptedFromGroup(string groupId, string invitee, string reason);

        /**
         * Occurs when a group invitation is declined.
	     *
	     * @param groupId 		The group ID.
	     * @param invitee		The user ID of the invitee.
	     * @param reason 		The reason for declining the invitation.
	     */        
        void OnInvitationDeclinedFromGroup(string groupId, string invitee, string reason);

        /**
         * Occurs when the current user is removed from the group by the group owner or group admin.
	     *
	     * @param groupId 		The group ID.
	     * @param groupName		The group name.
	     */
        void OnUserRemovedFromGroup(string groupId, string groupName);

        /**
         * Occurs when a group is destroyed.
		 * 
         * The SDK will remove the group from the local database and local memory before notifying the app of the group removal via the callback method.
	     *
	     * @param groupId		The group ID.
	     * @param groupName 	The group name.
         */
        void OnDestroyedFromGroup(string groupId, string groupName);

        /**
         * Occurs when the group invitation is accepted automatically.
		 * 
	     * The SDK will add the user to the group before notifying the app of the acceptance of the group invitation via the callback method.
         * 
		 * For settings, see {@link com.hyphenate.chat.EMOptions#setAutoAcceptGroupInvitation(boolean value)}.
	     *
	     * @param groupId			The group ID.
	     * @param inviter			The user ID of the inviter.
	     * @param inviteMessage		The invitation message.
         */
        void OnAutoAcceptInvitationFromGroup(
            string groupId, string inviter, string inviteMessage);

        /**
	     * Occurs when one or more group members are muted.
		 * 
	     * **Note**
		 * 
		 *  A user, when muted, can still see group messages, but cannot send messages in the group. However, a user on the block list can neither see nor send group messages.
	     *
	     * @param groupId		The group ID.
	     * @param mutes 		The member(s) added to the mute list.
	     *	 			        Map.entry.key is the user ID of the muted member; Map.entry.value is the mute duration in milliseconds.
	     */
        void OnMuteListAddedFromGroup(string groupId, List<string> mutes, int muteExpire);

        /**
	     * Occurs when one or more group members are unmuted.
		 * 
	     * **Note**
		 * 
		 * A user, when muted, can still see group messages, but cannot send messages in the group. However, a user on the block list can neither see nor send group messages.
	     *
	     * @param groupId		The group ID.
	     * @param mutes 		The member(s) removed from the mute list.
	     */
        void OnMuteListRemovedFromGroup(string groupId, List<string> mutes);

        /**
	     * Occurs when a member is set as an admin.
	     *
	     * @param groupId		The group ID.
	     * @param administrator The user ID of the member that is set as an admin.
	     */
        void OnAdminAddedFromGroup(string groupId, string administrator);

		/**
		 * Occurs when the admin privileges of a member are removed..
		 *
		 * @param groupId 		The group ID.
		 * @param administrator The user ID of the member whose admin privileges are removed.
		 */
		void OnAdminRemovedFromGroup(string groupId, string administrator);

		/**
		 * Occurs when the group ownership is transferred.
		 * 
		 * @param groupId 		The group ID.
		 * @param newOwner 		The new group owner.
		 * @param oldOwner 		The previous group owner.
		 */
		void OnOwnerChangedFromGroup(string groupId, string newOwner, string oldOwner);

		/**
		 * Occurs when a user joins a group.
		 * 
		 * @param groupId  The group ID.
		 * @param member   The ID of the new member.
		 */
		void OnMemberJoinedFromGroup(string groupId, string member);

		/**
		 * Occurs when a member voluntarily leaves the group.
		 * 
		 * @param groupId   The group ID.
		 * @param member  	The user ID of the member leaving the group.
		 */
		void OnMemberExitedFromGroup(string groupId, string member);

		/**
		 * Occurs when the group announcement is updated.
		 * 
		 * @param groupId  The group ID.
		 * @param announcement  The updated announcement content.
		 */
		void OnAnnouncementChangedFromGroup(string groupId, string announcement);

		/**
		 * Occurs when a shared file is added to a group.
		 * 
		 * @param groupId The group ID.
		 * @param sharedFile The new shared file.
		 */
		void OnSharedFileAddedFromGroup(string groupId, GroupSharedFile sharedFile);

		/**
		 * Occurs when a shared file is removed from a group.
		 * 
		 * @param groupId The group ID.
		 * @param fileId  The ID of the removed shared file.
		 */
		void OnSharedFileDeletedFromGroup(string groupId, string fileId);

		/**
		 * Occurs when one or more group members are added to the allowlist.
		 *
		 * @param groupId       The group ID.
		 * @param whitelist     The member(s) added to the allowlist.
		 */
        void OnAddWhiteListMembersFromGroup(string groupId, List<string> whiteList);

		/**
		 * Occurs when one or more members are removed from the allowlist.
		 *
		 * @param groupId       The group ID.
		 * @param whitelist     Member(s) removed from the allowlist.
		 */
        void OnRemoveWhiteListMembersFromGroup(string groupId, List<string> whiteList);

		/**
		 * Occurs when all group members are muted or unmuted.
		 *
		 * @param groupId       The group ID.
		 * @param isAllMuted    Whether all group members are muted or unmuted. true: all group members are muted; false: all group members are unmuted.
		 */

        void OnAllMemberMuteChangedFromGroup(string groupId, bool isAllMuted);


    }
}
