package com.gensee.rtdemo.doc;

import com.gensee.callback.IDocCallBack;
import com.gensee.doc.IDocModule;
import com.gensee.pdu.AbsAnno;
import com.gensee.pdu.PduDoc;
import com.gensee.pdu.PduPage;
import com.gensee.room.RtSdk;

public class DocCallback implements IDocCallBack {

    private RtSdk rtSdk;
    private IDocModule docModule;

    public  DocCallback(RtSdk rtSdk){
        this.rtSdk = rtSdk;
        docModule = rtSdk.getDocModule();
    }
    @Override
    public void onDocPageSize(int i, int i1) {

    }


    @Override
    public void onDocJoinConfirm(boolean b) {

    }

    @Override
    public void onDocOpened(PduDoc pduDoc) {

        //文档列表，包含加入之前已经存在的和新加的都会回调回调回来，自己维护一个列表
        if(pduDoc.getDocName().equals("6.docx")){
            docModule.gotoPage(pduDoc.getCurPage(),true,null);
        }

    }

    @Override
    public void onDocClosed(int i) {

    }

    @Override
    public void onDocGotoPage(int i, int i1, int i2) {

    }

    @Override
    public void onDocGotoAnimation(int i, int i1, int i2) {

    }

    @Override
    public void onDocSavedOnServer(int i, boolean b, boolean b1) {

    }

    @Override
    public void onDocPageReady(int i, PduPage pduPage, byte[] bytes) {

    }

    @Override
    public void onDocReceiveAnno(int i, int i1, AbsAnno absAnno) {

    }

    @Override
    public void onDocRemoveAnno(int i, int i1, long l) {

    }

    @Override
    public void onDocRename(int i, String s) {

    }

    @Override
    public void onPageChanged(int i, int i1, int i2, int i3) {

    }

    @Override
    public void onDocPublish(int i, boolean b, boolean b1, boolean b2) {

    }

    @Override
    public void onDocUploadStatus(String s, int i, int i1) {

    }
}
