#ifndef __USE_Engine_H__
#define __USE_Engine_H__
#include "ui_use_engine.h"
#include "api/avdengine.h"

class Use_Engine :public QWidget
	, public rtc::IAVDEngine::IListener
{
public:
	Q_OBJECT
public:
	Use_Engine(QWidget *parent = 0);
	~Use_Engine();
public:
	bool isWorking() const;

public slots:
	bool engine_init();
	bool engine_uninit();
	//
	bool scheduleRoom();
	bool getRoomByRoomId();
	bool getRoomByAppRoomId();
	bool getUsersCount();
	bool cancelRoom();

public:
	/// IAVDEngine::IListener implementation
	virtual void onInitResult(Result result);
	virtual void onUninitResult(Result result);
	// room operation
	virtual void onGetRoomResult(uint32 callId, Result result, const rtc::RoomInfo& room);
	virtual void onFindRoomsResult(uint32 callId, Result result, const rtc::RoomInfosType& rooms);
    virtual void onScheduleRoomResult(uint32 callId, Result result, const rtc::RoomId& roomId);
    virtual void onCancelRoomResult(uint32 callId, Result result, const rtc::RoomId& roomId);
    virtual void onGetUsersCountResult(uint32 callId, Result result, uint32 usersCount, const rtc::RoomId& roomId);
    virtual void onCallOutgoingDeviceResult(uint32 callId, Result result, const rtc::UserId& userId) ;
    virtual void onStartMixrecord(uint32 callId, Result result) ;
    virtual void onStopMixrecord(uint32 callId, Result result);
	//
	static void enableLog();
private:
	Ui::Use_Engine ui;

};

#endif //__USE_Engine_H__
