#ifndef __USE_Engine_H__
#define __USE_Engine_H__
#include "ui_use_engine.h"
#include "api_c/avdengine_c.h"

class Use_Engine :public QWidget
{
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:
	// engine implementation
	static void onInitResult(Result result);
	static void onUninitResult(Result result);
	// room implementation
	static void onGetRoomResult(uint32 callId, Result result, const AVDRoomInfo& room);
	static void onFindRoomsResult(uint32 callId, Result result, const LPAVDRoomInfo* rooms, uint32 numOfRoom);
	static void onScheduleRoomResult(uint32 callId, Result result, const char* roomId);
	static void onCancelRoomResult(uint32 callId, Result result, const char* roomId);
	static void onGetUsersCountResult(uint32 callId, Result result, uint32 usersCount, const char* roomId);
    //
    static void enableLog();
private:
	Ui::Use_Engine ui;
	AVDEngine_Callback cb_engine_;
};

#endif //__USE_Engine_H__
