123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #pragma once
- #include "CBaseMode.h"
- #include "CUserInfo.h"
- #include "CServerList.h"
- #include "CVersion.h"
- #include "CSysConfig.h"
- #include "CLoginInfo.h"
- enum struct PROXY_MODE {
- sys_mode = 0,
- tun_mode,
- };
- enum struct ROUT_MODE{
- cn_mode = 0,
- qg_mode,
- };
- struct SysMode {
- int id;
- PROXY_MODE proxy_mode;
- SStringW name;
- };
- struct RouteMode {
- int id;
- ROUT_MODE route_mode;
- SStringW name;
- };
- class CApp : public SSingleton<CApp>
- {
- public:
- CApp();
- ~CApp();
- void Init();
- void UnInit();
- CLoginInfo* GetLoginInfo();
- CSysConfig* CApp::GetSysconfig();
- CUserInfo* GetUserinfo();
- CServerList* GetServerList();
- CVersion* GetVerinfo();
- void SetOut(int out);
- int GetOut();
- void SetSysMode(PROXY_MODE mode);
- PROXY_MODE GetSysMode();
- void SetRouteMode(ROUT_MODE mode);
- ROUT_MODE GetRouteMode();
- void SetMethod(HINSTANCE hinst);
- HINSTANCE GetMethod();
-
- //¼ì²â»òÕßÉèÖÃDataĿ¼
- void ChkeAndSetDtaPath();
- bool CheckOnlyOneInstance() noexcept;
- std::filesystem::path GetDataPath();
- std::filesystem::path GetConfigPath();
- std::filesystem::path GetConfigGuiPath();
- void SetupDataDirectory();
- void SetCLashRuning(bool m);
- bool GetClashRuning();
-
- std::string GetToken() const { return m_token; }
- void SetToken(std::string val) { m_token = val; }
- std::string GetSelect_node() const;
- void SetSelect_node(std::string val);
- void SetSelectNodeById(int i_d);
- int GetSelectNodeById();
- private:
- int m_is_out;
- CLoginInfo* m_login_info;
- CServerList* m_server_list;
- CUserInfo* m_userinfo;
- CVersion* m_versioninfo;
- CSysConfig* m_sys_config;
- PROXY_MODE m_proxy_mode;
- ROUT_MODE m_route_mode;
- HINSTANCE m_hInst;
- std::filesystem::path m_dataPath;
- std::filesystem::path m_configPath;
- std::filesystem::path m_config_Gui_Path;
- bool m_clashRuning = true;
- std::string m_token;
- /**/
- std::string select_node;
- int node_select_id;
- };
|