16 #ifndef ROOT7_RWebDisplayArgs
17 #define ROOT7_RWebDisplayArgs
25 namespace Experimental {
29 class RWebDisplayArgs {
31 friend class RWebWindow;
47 EBrowserKind fKind{kNative};
49 bool fHeadless{
false};
50 bool fStandalone{
true};
51 THttpServer *fServer{
nullptr};
58 void *fDriverData{
nullptr};
60 std::shared_ptr<RWebWindow> fMaster;
61 int fMasterChannel{-1};
66 RWebDisplayArgs(
const std::string &browser);
68 RWebDisplayArgs(
const char *browser);
70 RWebDisplayArgs(
int width,
int height,
int x = -1,
int y = -1,
const std::string &browser =
"");
72 RWebDisplayArgs(std::shared_ptr<RWebWindow> master,
int channel = -1);
74 virtual ~RWebDisplayArgs();
76 RWebDisplayArgs &SetBrowserKind(
const std::string &kind);
78 RWebDisplayArgs &SetBrowserKind(EBrowserKind kind) { fKind = kind;
return *
this; }
80 EBrowserKind GetBrowserKind()
const {
return fKind; }
81 std::string GetBrowserName()
const;
83 void SetMasterWindow(std::shared_ptr<RWebWindow> master,
int channel = -1);
86 bool IsLocalDisplay()
const
88 return (GetBrowserKind() == kLocal) || (GetBrowserKind() == kCEF) || (GetBrowserKind() == kQt5);
92 bool IsSupportHeadless()
const
94 return (GetBrowserKind() == kNative) || (GetBrowserKind() == kFirefox) || (GetBrowserKind() == kChrome);
98 RWebDisplayArgs &SetUrl(
const std::string &url) { fUrl = url;
return *
this; }
100 std::string GetUrl()
const {
return fUrl; }
104 void SetStandalone(
bool on =
true) { fStandalone = on; }
106 bool IsStandalone()
const {
return fStandalone; }
109 RWebDisplayArgs &SetUrlOpt(
const std::string &opt) { fUrlOpt = opt;
return *
this; }
111 std::string GetUrlOpt()
const {
return fUrlOpt; }
114 void AppendUrlOpt(
const std::string &opt);
117 std::string GetFullUrl()
const;
120 void SetHeadless(
bool on =
true) { fHeadless = on; }
122 bool IsHeadless()
const {
return fHeadless; }
125 RWebDisplayArgs &SetWidth(
int w = 0) { fWidth = w;
return *
this; }
127 RWebDisplayArgs &SetHeight(
int h = 0) { fHeight = h;
return *
this; }
128 RWebDisplayArgs &SetSize(
int w,
int h) { fWidth = w; fHeight = h;
return *
this; }
131 RWebDisplayArgs &SetX(
int x = -1) { fX = x;
return *
this; }
133 RWebDisplayArgs &SetY(
int y = -1) { fY = y;
return *
this; }
134 RWebDisplayArgs &SetPos(
int x = -1,
int y = -1) { fX = x; fY = y;
return *
this; }
137 int GetWidth()
const {
return fWidth; }
139 int GetHeight()
const {
return fHeight; }
141 int GetX()
const {
return fX; }
143 int GetY()
const {
return fY; }
146 void SetCustomExec(
const std::string &exec);
148 std::string GetCustomExec()
const;
151 void SetHttpServer(THttpServer *serv) { fServer = serv; }
153 THttpServer *GetHttpServer()
const {
return fServer; }
156 void SetDriverData(
void *data) { fDriverData = data; }
158 void *GetDriverData()
const {
return fDriverData; }