forked from MatsuriDayo/nekoray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbstractBean.hpp
71 lines (47 loc) · 1.62 KB
/
AbstractBean.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#pragma once
#include <QJsonObject>
#include <QJsonArray>
#include "main/NekoGui.hpp"
namespace NekoGui_fmt {
struct CoreObjOutboundBuildResult {
public:
QJsonObject outbound;
QString error;
};
struct ExternalBuildResult {
public:
QString program;
QStringList env;
QStringList arguments;
//
QString tag;
//
QString error;
QString config_export;
};
class AbstractBean : public JsonStore {
public:
int version;
QString name = "";
QString serverAddress = "127.0.0.1";
int serverPort = 1080;
QString custom_config = "";
QString custom_outbound = "";
explicit AbstractBean(int version);
//
QString ToNekorayShareLink(const QString &type);
void ResolveDomainToIP(const std::function<void()> &onFinished);
//
[[nodiscard]] virtual QString DisplayAddress();
[[nodiscard]] virtual QString DisplayName();
virtual QString DisplayCoreType() { return software_core_name; };
virtual QString DisplayType() { return {}; };
virtual QString DisplayTypeAndName();
//
virtual int NeedExternal(bool isFirstProfile) { return 0; };
virtual CoreObjOutboundBuildResult BuildCoreObjV2Ray() { return {}; };
virtual CoreObjOutboundBuildResult BuildCoreObjSingBox() { return {}; };
virtual ExternalBuildResult BuildExternal(int mapping_port, int socks_port, int external_stat) { return {}; };
virtual QString ToShareLink() { return {}; };
};
} // namespace NekoGui_fmt