Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::RWebDisplayArgs Class Reference

Holds different arguments for starting browser with RWebDisplayHandle::Display() method.

Definition at line 33 of file RWebDisplayArgs.hxx.

Public Types

enum  EBrowserKind {
  kChrome , kEdge , kFirefox , kNative ,
  kCEF , kQt5 , kQt6 , kLocal ,
  kDefault , kServer , kEmbedded , kOff ,
  kCustom
}
 

Public Member Functions

 RWebDisplayArgs ()
 Default constructor.
 
 RWebDisplayArgs (const char *browser)
 Constructor.
 
 RWebDisplayArgs (const std::string &browser)
 Constructor.
 
 RWebDisplayArgs (int width, int height, int x=-1, int y=-1, const std::string &browser="")
 Constructor.
 
 RWebDisplayArgs (std::shared_ptr< RWebWindow > master, unsigned conndid=0, int channel=-1)
 Constructor.
 
virtual ~RWebDisplayArgs ()
 Destructor.
 
void AppendUrlOpt (const std::string &opt)
 append extra url options, add "&" as separator if required
 
EBrowserKind GetBrowserKind () const
 returns configured browser kind, see EBrowserKind for supported values
 
std::string GetBrowserName () const
 Returns configured browser name.
 
std::string GetCustomExec () const
 returns custom executable to start web browser
 
void * GetDriverData () const
 [internal] returns web-driver data, used to start window
 
const std::string & GetExtraArgs () const
 get extra command line arguments for starting web browser command
 
std::string GetFullUrl () const
 returns window url with append options
 
int GetHeight () const
 returns preferable web window height
 
THttpServerGetHttpServer () const
 returns http server instance, used for window display
 
const std::string & GetPageContent () const
 returns window url
 
const std::string & GetRedirectOutput () const
 get file name to which web browser output should be redirected
 
const std::string & GetUrl () const
 returns window url
 
const std::string & GetUrlOpt () const
 returns window url options
 
const std::string & GetWidgetKind () const
 returns widget kind
 
int GetWidth () const
 returns preferable web window width
 
int GetX () const
 set preferable web window x position
 
int GetY () const
 set preferable web window y position
 
bool IsBatchMode () const
 returns batch mode
 
bool IsHeadless () const
 returns headless mode
 
bool IsInteractiveBrowser () const
 returns true if interactive browser window supposed to be started
 
bool IsLocalDisplay () const
 returns true if local display like CEF or Qt5 QWebEngine should be used
 
bool IsStandalone () const
 Return true if browser should runs in standalone mode.
 
bool IsSupportHeadless () const
 returns true if browser supports headless mode
 
void SetBatchMode (bool on=true)
 set batch mode
 
RWebDisplayArgsSetBrowserKind (const std::string &kind)
 Set browser kind as string argument.
 
RWebDisplayArgsSetBrowserKind (EBrowserKind kind)
 set browser kind, see EBrowserKind for allowed values
 
void SetCustomExec (const std::string &exec)
 set custom executable to start web browser
 
void SetDriverData (void *data)
 [internal] set web-driver data, used to start window
 
void SetExtraArgs (const std::string &args)
 set extra command line arguments for starting web browser command
 
void SetHeadless (bool on=true)
 set headless mode
 
RWebDisplayArgsSetHeight (int h=0)
 set preferable web window height
 
void SetHttpServer (THttpServer *serv)
 set http server instance, used for window display
 
void SetMasterWindow (std::shared_ptr< RWebWindow > master, unsigned connid=0, int channel=-1)
 Assign window, connection and channel id where other window will be embed.
 
RWebDisplayArgsSetPageContent (const std::string &cont)
 set window url
 
RWebDisplayArgsSetPos (int x=-1, int y=-1)
 set preferable web window x and y position, negative is default
 
void SetRedirectOutput (const std::string &fname="")
 specify file name to which web browser output should be redirected
 
RWebDisplayArgsSetSize (int w, int h)
 set preferable web window width and height
 
void SetStandalone (bool on=true)
 Set standalone mode for running browser, default on When disabled, normal browser window (or just tab) will be started.
 
RWebDisplayArgsSetUrl (const std::string &url)
 set window url
 
RWebDisplayArgsSetUrlOpt (const std::string &opt)
 set window url options
 
RWebDisplayArgsSetWidgetKind (const std::string &kind)
 set widget kind
 
RWebDisplayArgsSetWidth (int w=0)
 set preferable web window width
 
RWebDisplayArgsSetX (int x=-1)
 set preferable web window x position, negative is default
 
RWebDisplayArgsSetY (int y=-1)
 set preferable web window y position, negative is default
 

Static Public Member Functions

static std::string GetQt5EmbedQualifier (const void *qparent, const std::string &urlopt="", unsigned qtversion=0x50000)
 Returns string which can be used as argument in RWebWindow::Show() method to display web window in provided Qt5 QWidget.
 

Protected Member Functions

bool SetPosAsStr (const std::string &str)
 Set position of web browser window as string like "100,100".
 
bool SetSizeAsStr (const std::string &str)
 Set size of web browser window as string like "800x600".
 

Protected Attributes

bool fBatchMode {false}
 ! is browser runs in batch mode
 
void * fDriverData {nullptr}
 ! special data delivered to driver, can be used for QWebEngine
 
std::string fExec
 ! string to run browser, used with kCustom type
 
std::string fExtraArgs
 ! extra arguments which will be append to exec string
 
bool fHeadless {false}
 ! is browser runs in headless mode
 
int fHeight {0}
 ! custom window height, when not specified - used RWebWindow geometry
 
EBrowserKind fKind {kNative}
 ! id of web browser used for display
 
std::shared_ptr< RWebWindowfMaster
 ! master window
 
int fMasterChannel {-1}
 ! used master channel
 
unsigned fMasterConnection {0}
 ! used master connection
 
std::string fPageContent
 ! HTML page content
 
std::string fRedirectOutput
 ! filename where browser output should be redirected
 
THttpServerfServer {nullptr}
 ! http server which handle all requests
 
bool fStandalone {true}
 ! indicates if browser should run isolated from other browser instances
 
std::string fUrl
 ! URL to display
 
std::string fUrlOpt
 ! extra URL options, which are append to window URL
 
std::string fWidgetKind
 ! widget kind, used to identify that will be displayed in the web window
 
int fWidth {0}
 ! custom window width, when not specified - used RWebWindow geometry
 
int fX {-1}
 ! custom window x position, negative is default
 
int fY {-1}
 ! custom window y position, negative is default
 

Friends

class RWebWindow
 

#include <ROOT/RWebDisplayArgs.hxx>

Member Enumeration Documentation

◆ EBrowserKind

Enumerator
kChrome 

Google Chrome browser.

kEdge 

Microsoft Edge browser (Windows only)

kFirefox 

Mozilla Firefox browser.

kNative 

either Chrome or Firefox - both support major functionality

kCEF 

Chromium Embedded Framework - local display with CEF libs.

kQt5 

Qt5 QWebEngine libraries - Chromium code packed in qt5.

kQt6 

Qt6 QWebEngine libraries - Chromium code packed in qt6.

kLocal 

either CEF or Qt5 - both runs on local display without real http server

kDefault 

default system web browser, can not be used in batch mode

kServer 

indicates that ROOT runs as server and just printouts window URL, browser should be started by the user

kEmbedded 

window will be embedded into other, no extra browser need to be started

kOff 

disable web display, do not start any browser

kCustom 

custom web browser, execution string should be provided

Definition at line 38 of file RWebDisplayArgs.hxx.

Constructor & Destructor Documentation

◆ RWebDisplayArgs() [1/5]

RWebDisplayArgs::RWebDisplayArgs ( )

Default constructor.

Browser kind configured from gROOT->GetWebDisplay()

Definition at line 42 of file RWebDisplayArgs.cxx.

◆ RWebDisplayArgs() [2/5]

RWebDisplayArgs::RWebDisplayArgs ( const std::string &  browser)

Constructor.

Browser kind specified as std::string. See SetBrowserKind method for description of allowed parameters

Definition at line 52 of file RWebDisplayArgs.cxx.

◆ RWebDisplayArgs() [3/5]

RWebDisplayArgs::RWebDisplayArgs ( const char *  browser)

Constructor.

Browser kind specified as const char *. See SetBrowserKind method for description of allowed parameters

Definition at line 62 of file RWebDisplayArgs.cxx.

◆ RWebDisplayArgs() [4/5]

RWebDisplayArgs::RWebDisplayArgs ( int  width,
int  height,
int  x = -1,
int  y = -1,
const std::string &  browser = "" 
)

Constructor.

Let specify window width and height

Definition at line 71 of file RWebDisplayArgs.cxx.

◆ RWebDisplayArgs() [5/5]

RWebDisplayArgs::RWebDisplayArgs ( std::shared_ptr< RWebWindow master,
unsigned  conndid = 0,
int  channel = -1 
)

Constructor.

Let specify master window and channel (if reserved already)

Definition at line 82 of file RWebDisplayArgs.cxx.

◆ ~RWebDisplayArgs()

RWebDisplayArgs::~RWebDisplayArgs ( )
virtualdefault

Destructor.

Must be defined in source code to correctly call RWebWindow destructor

Member Function Documentation

◆ AppendUrlOpt()

void RWebDisplayArgs::AppendUrlOpt ( const std::string &  opt)

append extra url options, add "&" as separator if required

Append string to url options.

Add "&" as separator if any options already exists

Definition at line 282 of file RWebDisplayArgs.cxx.

◆ GetBrowserKind()

EBrowserKind ROOT::RWebDisplayArgs::GetBrowserKind ( ) const
inline

returns configured browser kind, see EBrowserKind for supported values

Definition at line 97 of file RWebDisplayArgs.hxx.

◆ GetBrowserName()

std::string RWebDisplayArgs::GetBrowserName ( ) const

Returns configured browser name.

Definition at line 244 of file RWebDisplayArgs.cxx.

◆ GetCustomExec()

std::string RWebDisplayArgs::GetCustomExec ( ) const

returns custom executable to start web browser

Returns custom executable to start web browser.

Definition at line 327 of file RWebDisplayArgs.cxx.

◆ GetDriverData()

void * ROOT::RWebDisplayArgs::GetDriverData ( ) const
inline

[internal] returns web-driver data, used to start window

Definition at line 211 of file RWebDisplayArgs.hxx.

◆ GetExtraArgs()

const std::string & ROOT::RWebDisplayArgs::GetExtraArgs ( ) const
inline

get extra command line arguments for starting web browser command

Definition at line 191 of file RWebDisplayArgs.hxx.

◆ GetFullUrl()

std::string RWebDisplayArgs::GetFullUrl ( ) const

returns window url with append options

Returns full url, which is combined from URL and extra URL options.

Takes into account "#" symbol in url - options are inserted before that symbol

Definition at line 296 of file RWebDisplayArgs.cxx.

◆ GetHeight()

int ROOT::RWebDisplayArgs::GetHeight ( ) const
inline

returns preferable web window height

Definition at line 182 of file RWebDisplayArgs.hxx.

◆ GetHttpServer()

THttpServer * ROOT::RWebDisplayArgs::GetHttpServer ( ) const
inline

returns http server instance, used for window display

Definition at line 206 of file RWebDisplayArgs.hxx.

◆ GetPageContent()

const std::string & ROOT::RWebDisplayArgs::GetPageContent ( ) const
inline

returns window url

Definition at line 136 of file RWebDisplayArgs.hxx.

◆ GetQt5EmbedQualifier()

std::string RWebDisplayArgs::GetQt5EmbedQualifier ( const void *  qparent,
const std::string &  urlopt = "",
unsigned  qtversion = 0x50000 
)
static

Returns string which can be used as argument in RWebWindow::Show() method to display web window in provided Qt5 QWidget.

After RWebWindow is displayed created QWebEngineView can be found with the command:

auto view = qparent->findChild<QWebEngineView*>("RootWebView"); 

Definition at line 348 of file RWebDisplayArgs.cxx.

◆ GetRedirectOutput()

const std::string & ROOT::RWebDisplayArgs::GetRedirectOutput ( ) const
inline

get file name to which web browser output should be redirected

Definition at line 196 of file RWebDisplayArgs.hxx.

◆ GetUrl()

const std::string & ROOT::RWebDisplayArgs::GetUrl ( ) const
inline

returns window url

Definition at line 126 of file RWebDisplayArgs.hxx.

◆ GetUrlOpt()

const std::string & ROOT::RWebDisplayArgs::GetUrlOpt ( ) const
inline

returns window url options

Definition at line 147 of file RWebDisplayArgs.hxx.

◆ GetWidgetKind()

const std::string & ROOT::RWebDisplayArgs::GetWidgetKind ( ) const
inline

returns widget kind

Definition at line 131 of file RWebDisplayArgs.hxx.

◆ GetWidth()

int ROOT::RWebDisplayArgs::GetWidth ( ) const
inline

returns preferable web window width

Definition at line 180 of file RWebDisplayArgs.hxx.

◆ GetX()

int ROOT::RWebDisplayArgs::GetX ( ) const
inline

set preferable web window x position

Definition at line 184 of file RWebDisplayArgs.hxx.

◆ GetY()

int ROOT::RWebDisplayArgs::GetY ( ) const
inline

set preferable web window y position

Definition at line 186 of file RWebDisplayArgs.hxx.

◆ IsBatchMode()

bool ROOT::RWebDisplayArgs::IsBatchMode ( ) const
inline

returns batch mode

Definition at line 158 of file RWebDisplayArgs.hxx.

◆ IsHeadless()

bool ROOT::RWebDisplayArgs::IsHeadless ( ) const
inline

returns headless mode

Definition at line 163 of file RWebDisplayArgs.hxx.

◆ IsInteractiveBrowser()

bool ROOT::RWebDisplayArgs::IsInteractiveBrowser ( ) const
inline

returns true if interactive browser window supposed to be started

Definition at line 103 of file RWebDisplayArgs.hxx.

◆ IsLocalDisplay()

bool ROOT::RWebDisplayArgs::IsLocalDisplay ( ) const
inline

returns true if local display like CEF or Qt5 QWebEngine should be used

Definition at line 110 of file RWebDisplayArgs.hxx.

◆ IsStandalone()

bool ROOT::RWebDisplayArgs::IsStandalone ( ) const
inline

Return true if browser should runs in standalone mode.

Definition at line 142 of file RWebDisplayArgs.hxx.

◆ IsSupportHeadless()

bool ROOT::RWebDisplayArgs::IsSupportHeadless ( ) const
inline

returns true if browser supports headless mode

Definition at line 116 of file RWebDisplayArgs.hxx.

◆ SetBatchMode()

void ROOT::RWebDisplayArgs::SetBatchMode ( bool  on = true)
inline

set batch mode

Definition at line 156 of file RWebDisplayArgs.hxx.

◆ SetBrowserKind() [1/2]

RWebDisplayArgs & RWebDisplayArgs::SetBrowserKind ( const std::string &  _kind)

Set browser kind as string argument.

Recognized values:

 chrome - use Google Chrome web browser, supports headless mode from v60, default
firefox - use Mozilla Firefox browser, supports headless mode from v57
 native - (or empty string) either chrome or firefox, only these browsers support batch (headless) mode
browser - default system web-browser, no batch mode
 safari - Safari browser on Mac
    cef - Chromium Embeded Framework, local display, local communication
    qt5 - Qt5 QWebEngine, local display, local communication
    qt6 - Qt6 QWebEngineCore, local display, local communication
  local - either cef or qt5 or qt6

<prog> - any program name which will be started instead of default browser, like /usr/bin/opera

Definition at line 157 of file RWebDisplayArgs.cxx.

◆ SetBrowserKind() [2/2]

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetBrowserKind ( EBrowserKind  kind)
inline

set browser kind, see EBrowserKind for allowed values

Definition at line 95 of file RWebDisplayArgs.hxx.

◆ SetCustomExec()

void RWebDisplayArgs::SetCustomExec ( const std::string &  exec)

set custom executable to start web browser

Configure custom web browser.

Either just name of browser which can be used like "opera" or full execution string which must includes $url like "/usr/bin/opera $url"

Definition at line 318 of file RWebDisplayArgs.cxx.

◆ SetDriverData()

void ROOT::RWebDisplayArgs::SetDriverData ( void *  data)
inline

[internal] set web-driver data, used to start window

Definition at line 209 of file RWebDisplayArgs.hxx.

◆ SetExtraArgs()

void ROOT::RWebDisplayArgs::SetExtraArgs ( const std::string &  args)
inline

set extra command line arguments for starting web browser command

Definition at line 189 of file RWebDisplayArgs.hxx.

◆ SetHeadless()

void ROOT::RWebDisplayArgs::SetHeadless ( bool  on = true)
inline

set headless mode

Definition at line 161 of file RWebDisplayArgs.hxx.

◆ SetHeight()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetHeight ( int  h = 0)
inline

set preferable web window height

Definition at line 168 of file RWebDisplayArgs.hxx.

◆ SetHttpServer()

void ROOT::RWebDisplayArgs::SetHttpServer ( THttpServer serv)
inline

set http server instance, used for window display

Definition at line 204 of file RWebDisplayArgs.hxx.

◆ SetMasterWindow()

void RWebDisplayArgs::SetMasterWindow ( std::shared_ptr< RWebWindow master,
unsigned  connid = 0,
int  channel = -1 
)

Assign window, connection and channel id where other window will be embed.

Definition at line 270 of file RWebDisplayArgs.cxx.

◆ SetPageContent()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetPageContent ( const std::string &  cont)
inline

set window url

Definition at line 134 of file RWebDisplayArgs.hxx.

◆ SetPos()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetPos ( int  x = -1,
int  y = -1 
)
inline

set preferable web window x and y position, negative is default

Definition at line 177 of file RWebDisplayArgs.hxx.

◆ SetPosAsStr()

bool RWebDisplayArgs::SetPosAsStr ( const std::string &  str)
protected

Set position of web browser window as string like "100,100".

Definition at line 120 of file RWebDisplayArgs.cxx.

◆ SetRedirectOutput()

void ROOT::RWebDisplayArgs::SetRedirectOutput ( const std::string &  fname = "")
inline

specify file name to which web browser output should be redirected

Definition at line 194 of file RWebDisplayArgs.hxx.

◆ SetSize()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetSize ( int  w,
int  h 
)
inline

set preferable web window width and height

Definition at line 170 of file RWebDisplayArgs.hxx.

◆ SetSizeAsStr()

bool RWebDisplayArgs::SetSizeAsStr ( const std::string &  str)
protected

Set size of web browser window as string like "800x600".

Definition at line 96 of file RWebDisplayArgs.cxx.

◆ SetStandalone()

void ROOT::RWebDisplayArgs::SetStandalone ( bool  on = true)
inline

Set standalone mode for running browser, default on When disabled, normal browser window (or just tab) will be started.

Definition at line 140 of file RWebDisplayArgs.hxx.

◆ SetUrl()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetUrl ( const std::string &  url)
inline

set window url

Definition at line 124 of file RWebDisplayArgs.hxx.

◆ SetUrlOpt()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetUrlOpt ( const std::string &  opt)
inline

set window url options

Definition at line 145 of file RWebDisplayArgs.hxx.

◆ SetWidgetKind()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetWidgetKind ( const std::string &  kind)
inline

set widget kind

Definition at line 129 of file RWebDisplayArgs.hxx.

◆ SetWidth()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetWidth ( int  w = 0)
inline

set preferable web window width

Definition at line 166 of file RWebDisplayArgs.hxx.

◆ SetX()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetX ( int  x = -1)
inline

set preferable web window x position, negative is default

Definition at line 173 of file RWebDisplayArgs.hxx.

◆ SetY()

RWebDisplayArgs & ROOT::RWebDisplayArgs::SetY ( int  y = -1)
inline

set preferable web window y position, negative is default

Definition at line 175 of file RWebDisplayArgs.hxx.

Friends And Related Symbol Documentation

◆ RWebWindow

friend class RWebWindow
friend

Definition at line 35 of file RWebDisplayArgs.hxx.

Member Data Documentation

◆ fBatchMode

bool ROOT::RWebDisplayArgs::fBatchMode {false}
protected

! is browser runs in batch mode

Definition at line 61 of file RWebDisplayArgs.hxx.

◆ fDriverData

void* ROOT::RWebDisplayArgs::fDriverData {nullptr}
protected

! special data delivered to driver, can be used for QWebEngine

Definition at line 71 of file RWebDisplayArgs.hxx.

◆ fExec

std::string ROOT::RWebDisplayArgs::fExec
protected

! string to run browser, used with kCustom type

Definition at line 70 of file RWebDisplayArgs.hxx.

◆ fExtraArgs

std::string ROOT::RWebDisplayArgs::fExtraArgs
protected

! extra arguments which will be append to exec string

Definition at line 57 of file RWebDisplayArgs.hxx.

◆ fHeadless

bool ROOT::RWebDisplayArgs::fHeadless {false}
protected

! is browser runs in headless mode

Definition at line 62 of file RWebDisplayArgs.hxx.

◆ fHeight

int ROOT::RWebDisplayArgs::fHeight {0}
protected

! custom window height, when not specified - used RWebWindow geometry

Definition at line 66 of file RWebDisplayArgs.hxx.

◆ fKind

EBrowserKind ROOT::RWebDisplayArgs::fKind {kNative}
protected

! id of web browser used for display

Definition at line 55 of file RWebDisplayArgs.hxx.

◆ fMaster

std::shared_ptr<RWebWindow> ROOT::RWebDisplayArgs::fMaster
protected

! master window

Definition at line 73 of file RWebDisplayArgs.hxx.

◆ fMasterChannel

int ROOT::RWebDisplayArgs::fMasterChannel {-1}
protected

! used master channel

Definition at line 75 of file RWebDisplayArgs.hxx.

◆ fMasterConnection

unsigned ROOT::RWebDisplayArgs::fMasterConnection {0}
protected

! used master connection

Definition at line 74 of file RWebDisplayArgs.hxx.

◆ fPageContent

std::string ROOT::RWebDisplayArgs::fPageContent
protected

! HTML page content

Definition at line 58 of file RWebDisplayArgs.hxx.

◆ fRedirectOutput

std::string ROOT::RWebDisplayArgs::fRedirectOutput
protected

! filename where browser output should be redirected

Definition at line 59 of file RWebDisplayArgs.hxx.

◆ fServer

THttpServer* ROOT::RWebDisplayArgs::fServer {nullptr}
protected

! http server which handle all requests

Definition at line 64 of file RWebDisplayArgs.hxx.

◆ fStandalone

bool ROOT::RWebDisplayArgs::fStandalone {true}
protected

! indicates if browser should run isolated from other browser instances

Definition at line 63 of file RWebDisplayArgs.hxx.

◆ fUrl

std::string ROOT::RWebDisplayArgs::fUrl
protected

! URL to display

Definition at line 56 of file RWebDisplayArgs.hxx.

◆ fUrlOpt

std::string ROOT::RWebDisplayArgs::fUrlOpt
protected

! extra URL options, which are append to window URL

Definition at line 69 of file RWebDisplayArgs.hxx.

◆ fWidgetKind

std::string ROOT::RWebDisplayArgs::fWidgetKind
protected

! widget kind, used to identify that will be displayed in the web window

Definition at line 60 of file RWebDisplayArgs.hxx.

◆ fWidth

int ROOT::RWebDisplayArgs::fWidth {0}
protected

! custom window width, when not specified - used RWebWindow geometry

Definition at line 65 of file RWebDisplayArgs.hxx.

◆ fX

int ROOT::RWebDisplayArgs::fX {-1}
protected

! custom window x position, negative is default

Definition at line 67 of file RWebDisplayArgs.hxx.

◆ fY

int ROOT::RWebDisplayArgs::fY {-1}
protected

! custom window y position, negative is default

Definition at line 68 of file RWebDisplayArgs.hxx.

Libraries for ROOT::RWebDisplayArgs:

The documentation for this class was generated from the following files: