package com.yidianling.im.api.service

import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.template.IProvider
import com.yidianling.im.api.bean.IMLoginInfo
import com.yidianling.im.api.bean.IMRequestCallback

/**
 * author : Zhangwenchao
 * e-mail : zhangwch@yidianling.com
 * time   : 2018/04/13
 */
interface IImService : IProvider {

    // 打开与小壹聊天界面
    fun startP2PXiaoYi(context: Context)

    // 打开私聊界面
    fun startP2PSession(context: Activity, toUid: String)

    fun setAccount(account: String)

    fun setChattingAccountAll()

    fun setChattingAccountNone()

    fun isHasUnread():Boolean

    fun login(info: IMLoginInfo, callback: IMRequestCallback<IMLoginInfo>?)

    /**
     * 绑定手机后，重新登录IM
     */
    fun imLogin(info: IMLoginInfo)

    fun logout()

    fun clear()
    /**
     * 创建一条普通文本消息
     * @param sessionId   聊天对象ID
     * @param content     文本消息内容
     */
    fun createTextMessage(sessionId: String?, content: String, callback: IMRequestCallback<Void>)

    fun sendSubscriptionTimeMessage(sessionId: String?, content: String, callback: IMRequestCallback<Void>)

    fun showSelector(activity: Activity, requestCode: Int)

    fun sendTestResultMessage(uid: String, content: String, title: String?, head: String?, url: String?, id: Int, share_url: String?, callback: IMRequestCallback<Void>)

    fun startChat(context : Activity ,toUid : String ,flag : Int , canTalk : Int)

    /**
     * 根据对方uid获取未读数
     */
    fun getUnReadByUid(uid: String): Int


    /**
     * 获取自己的所有未读数
     */
    fun getAllUnReadNum(): Int
}