#pragma once
#include "CThread.h"
#include "CLashConfig.h"
#include "ClashApi.h"



class CConnectMage  
{
public:
	CConnectMage();
	 ~CConnectMage();
	 void Stop();
	 void ReqConfig();
	 void ChangeClashNode();
	 void ChangeClashInit();
	 void Init();
	 void SetNodeName(std::string name);
public:
	void SetClashConfig(CLashConfig* m);
	ConnectState GetConnectStatus();
	 
private:
	
	void ThreadFun_ChangeClash_Config(LPARAM lParam);
	void ThreadFun_ChangeClash_Node(LPARAM lParam);
	void ThreadFun_ChangeClash_Stop(LPARAM lParam);
private:
	ConnectState m_connect_status;
	CLashConfig* m_clash_config;
	ClashApi* m_clash_Api;
	SStringW  m_error;
	AsynTaskHandle<LPARAM>	m_Asyntask;
	std::string   m_name;
	bool  m_isclash_config;
};

