package com.cooleshow.teacher.contract;

import android.view.View;

import com.cooleshow.base.presenter.view.BaseView;
import com.cooleshow.teacher.bean.LiveRoomInfoBean;
import com.rong.io.live.message.RCChatJoinRoomMessage;
import com.rong.io.live.message.RCOnSnappingUpMessage;
import com.rong.io.live.message.RCUserAddLikeMessage;
import com.rong.io.live.message.RCUserSeatApplyMessage;

import java.util.List;

import cn.rongcloud.rtc.api.RCRTCRemoteUser;
import cn.rongcloud.rtc.api.stream.RCRTCVideoView;
import cn.rongcloud.rtc.base.RCRTCLiveRole;
import io.rong.imlib.model.Message;
import io.rong.imlib.model.MessageContent;

/**
 * 创建日期：2022/5/20 15:02
 *
 * @author Ryan
 * 类说明：
 */
public interface LiveRoomContract {
    interface LiveRoomView extends BaseView {
        /**
         * 获取房间信息成功
         *
         * @param roomInfoBean
         */
        void getRoomInfoSuccess(LiveRoomInfoBean roomInfoBean);

        /**
         * 获取房间信息失败
         *
         * @param throwable
         */
        void getRoomInfoError(Throwable throwable);

        /**
         * 显示finishview
         */
        void showFinishView();

        /**
         * 添加多条公屏消息
         */
        void addMessageList(List<MessageContent> messageContents, boolean isReset);

        /**
         * 添加单条公屏消息
         */
        void addMessageContent(Message message, boolean isReset);


        /**
         * 设置房间数据
         */
        void setRoomData(LiveRoomInfoBean roomInfoBean);

        /**
         * 推流成功
         */
        void onPublishSuccess();

        View getContentView();

        void addVideoPreview(RCRTCVideoView videoView);

        void openCameraSuccess(Boolean data);

        void openCameraError(String errorMsg);

        /**
         * 成员同步
         *
         * @param count
         */
        void syncMemberCount(String count);

        /**
         * 加入房间消息
         *
         * @param joinRoomMessage
         */
        void receiveJoinMessage(RCChatJoinRoomMessage joinRoomMessage);
        /**
         * 抢购消息
         *
         * @param
         */
        void receiveSnapUpMessage(RCOnSnappingUpMessage snappingUpMessage);

        void liveRoomOffline();

        void onAddLikeMessage(RCUserAddLikeMessage addLikeMessage);

        void onUserJoinRoom(RCRTCRemoteUser rcrtcRemoteUser);

        void onUserLeftRoomMic(RCRTCRemoteUser rcrtcRemoteUser);

        void onUserOfflineRoomMic(RCRTCRemoteUser rcrtcRemoteUser);

        void onSwitchRole(String userId, RCRTCLiveRole role);

        /**
         * 连麦申请
         */
        void onSeatApplyMessage(RCUserSeatApplyMessage seatApplyMessage);

    }

    interface Presenter {
        void handleAction(int action, Object... params);

        void notifyJoinRoomAction(String roomId, String userId);

        void notifyLeaveRoomAction();
    }
}
