13#ifndef ROOT7_RFileDialog
14#define ROOT7_RFileDialog
24namespace Experimental {
67 void ProcessMsg(
unsigned connid,
const std::string &arg);
73 static std::string
Dialog(
EDialogTypes kind,
const std::string &title,
const std::string &fname);
108 static std::string
OpenFile(
const std::string &title =
"",
const std::string &fname =
"");
109 static std::string
SaveAs(
const std::string &title =
"",
const std::string &fname =
"");
110 static std::string
NewFile(
const std::string &title =
"",
const std::string &fname =
"");
112 static std::shared_ptr<RFileDialog>
Embedded(
const std::shared_ptr<RWebWindow> &window,
const std::string &args);
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
Way to browse (hopefully) everything in ROOT.
const auto & GetNameFilters() const
Returns array of name filters.
std::vector< std::string > fNameFilters
! name filters
static std::string Dialog(EDialogTypes kind, const std::string &title, const std::string &fname)
Start specified dialog type.
EDialogTypes fKind
! dialog kind OpenFile, SaveAs, NewFile
void SetNameFilters(const std::vector< std::string > &arr)
Set array of name filters like "Text files (*.txt)", "Any files (*)", "Image files (*png *....
bool GetCanChangePath() const
Returns true if working path can be change with gui elements.
bool fDidSelect
! true when dialog is selected or closed
void Show(const RWebDisplayArgs &args="")
Show or update RFileDialog in web window If web window already started - just refresh it like "reload...
void InvokeCallBack()
Invoke specified callback.
std::shared_ptr< RWebWindow > fWebWindow
! web window for file dialog
static std::string SaveAs(const std::string &title="", const std::string &fname="")
Start SaveAs dialog.
std::string GetSelectedFilter() const
Returns selected filter Can differ from specified value - if it does not match to existing entry in N...
const EDialogTypes & GetType() const
RBrowserData fBrowsable
! central browsing element
bool fCanChangePath
! if working path can be changed via gui elements
void ProcessMsg(unsigned connid, const std::string &arg)
Process received data from client.
void SetCanChangePath(bool on=true)
Configure if working path in dialog can be changed via gui elements.
static std::shared_ptr< RFileDialog > Embedded(const std::shared_ptr< RWebWindow > &window, const std::string &args)
Create dialog instance to use as embedded dialog inside other widget Embedded dialog started on the c...
static std::string OpenFile(const std::string &title="", const std::string &fname="")
Start OpenFile dialog.
std::string fSelectedFilter
! name of selected filter
const std::string & GetFileName() const
void Hide()
Hide ROOT Browser.
std::string fSelect
! result of file selection
std::string GetRegexp(const std::string &name) const
Returns regexp for selected filter String should have form "Filter name (*.ext1 *....
void SendChPathMsg(unsigned connid)
Sends new data after change current directory.
std::string fTitle
! title, when not specified default will be used
RFileDialogCallback_t fCallback
! function receiving result, called once
std::string GetWorkingPath() const
Returns current working path.
static std::string TypeAsString(EDialogTypes kind)
Returns dialog type as string String value used for configuring JS-side.
static std::string NewFile(const std::string &title="", const std::string &fname="")
Start NewFile dialog.
void SetSelectedFilter(const std::string &name)
Configure selected filter Has to be one of the string from NameFilters entry.
void SetCallback(RFileDialogCallback_t callback)
Assign callback.
void SendInitMsg(unsigned connid)
Sends initial message to the client.
void SetWorkingPath(const std::string &)
Change current working path of file dialog If dialog already shown, change will be immediately applie...
virtual ~RFileDialog()
destructor
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
std::function< void(const std::string &)> RFileDialogCallback_t
function signature for file dialog call-backs argument is selected file name
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...