File indexing completed on 2025-01-18 10:10:31
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ROOT7_Browsable_RWrapper
0010 #define ROOT7_Browsable_RWrapper
0011
0012 #include <ROOT/Browsable/RElement.hxx>
0013 #include <ROOT/Browsable/RLevelIter.hxx>
0014
0015 namespace ROOT {
0016 namespace Browsable {
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 class RWrapper : public RElement {
0027 std::string fName;
0028 std::shared_ptr<RElement> fElem;
0029 bool fExapndByDefault{false};
0030
0031 public:
0032 RWrapper() = default;
0033
0034 RWrapper(const std::string &name, std::shared_ptr<RElement> elem) : fName(name), fElem(elem) {}
0035
0036 virtual ~RWrapper() = default;
0037
0038
0039 std::string GetName() const override { return fName; }
0040
0041
0042 std::string GetTitle() const override { return fElem->GetTitle(); }
0043
0044
0045 std::unique_ptr<RLevelIter> GetChildsIter() override { return fElem->GetChildsIter(); }
0046
0047
0048 std::string GetContent(const std::string &kind = "text") override { return fElem->GetContent(kind); }
0049
0050
0051 std::unique_ptr<RHolder> GetObject() override { return fElem->GetObject(); }
0052
0053
0054 EActionKind GetDefaultAction() const override { return fElem->GetDefaultAction(); }
0055
0056
0057 bool IsCapable(EActionKind action) const override { return fElem->IsCapable(action); }
0058
0059 bool IsExpandByDefault() const override { return fExapndByDefault || fElem->IsExpandByDefault(); }
0060 void SetExpandByDefault(bool on = true) { fExapndByDefault = on; }
0061 };
0062
0063
0064 }
0065 }
0066
0067 #endif