Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RWrapper.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_Browsable_RWrapper
10#define ROOT7_Browsable_RWrapper
11
14
15namespace ROOT {
16namespace Browsable {
17
18/** \class RWrapper
19\ingroup rbrowser
20\brief Wrapper for other element - to provide different name
21\author Sergey Linev <S.Linev@gsi.de>
22\date 2019-11-22
23\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
24*/
25
26class RWrapper : public RElement {
27 std::string fName;
28 std::shared_ptr<RElement> fElem;
29 bool fExapndByDefault{false};
30
31public:
32 RWrapper() = default;
33
34 RWrapper(const std::string &name, std::shared_ptr<RElement> elem) : fName(name), fElem(elem) {}
35
36 virtual ~RWrapper() = default;
37
38 /** Name of element, must be provided in derived classes */
39 std::string GetName() const override { return fName; }
40
41 /** Title of element (optional) */
42 std::string GetTitle() const override { return fElem->GetTitle(); }
43
44 /** Create iterator for childs elements if any */
45 std::unique_ptr<RLevelIter> GetChildsIter() override { return fElem->GetChildsIter(); }
46
47 /** Returns element content, depends from kind. Can be "text" or "image64" */
48 std::string GetContent(const std::string &kind = "text") override { return fElem->GetContent(kind); }
49
50 /** Access object */
51 std::unique_ptr<RHolder> GetObject() override { return fElem->GetObject(); }
52
53 /** Get default action */
54 EActionKind GetDefaultAction() const override { return fElem->GetDefaultAction(); }
55
56 /** Check if want to perform action */
57 bool IsCapable(EActionKind action) const override { return fElem->IsCapable(action); }
58
59 bool IsExpandByDefault() const override { return fExapndByDefault || fElem->IsExpandByDefault(); }
60 void SetExpandByDefault(bool on = true) { fExapndByDefault = on; }
61};
62
63
64} // namespace Browsable
65} // namespace ROOT
66
67#endif
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
char name[80]
Definition TGX11.cxx:110
Basic element of browsable hierarchy.
Definition RElement.hxx:34
EActionKind
Possible actions on double-click.
Definition RElement.hxx:50
Wrapper for other element - to provide different name.
Definition RWrapper.hxx:26
RWrapper(const std::string &name, std::shared_ptr< RElement > elem)
Definition RWrapper.hxx:34
bool IsCapable(EActionKind action) const override
Check if want to perform action.
Definition RWrapper.hxx:57
std::unique_ptr< RHolder > GetObject() override
Access object.
Definition RWrapper.hxx:51
std::shared_ptr< RElement > fElem
Definition RWrapper.hxx:28
std::string GetTitle() const override
Title of element (optional)
Definition RWrapper.hxx:42
bool IsExpandByDefault() const override
Should item representing element be expand by default.
Definition RWrapper.hxx:59
std::string GetName() const override
Name of element, must be provided in derived classes.
Definition RWrapper.hxx:39
void SetExpandByDefault(bool on=true)
Definition RWrapper.hxx:60
std::unique_ptr< RLevelIter > GetChildsIter() override
Create iterator for childs elements if any.
Definition RWrapper.hxx:45
EActionKind GetDefaultAction() const override
Get default action.
Definition RWrapper.hxx:54
virtual ~RWrapper()=default
std::string GetContent(const std::string &kind="text") override
Returns element content, depends from kind.
Definition RWrapper.hxx:48
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...