Blender  V2.93
tree_element.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "tree_element.h"
24 
25 namespace blender::ed::outliner {
26 
27 /* -------------------------------------------------------------------- */
28 /* Tree-Display Interface */
29 
31  protected:
38 
39  public:
40  virtual ~AbstractTreeElement() = default;
41 
45  virtual bool expandPoll(const SpaceOutliner &) const
46  {
47  return true;
48  }
52  virtual void expand(SpaceOutliner &) const
53  {
54  }
55  virtual void postExpand(SpaceOutliner &) const
56  {
57  }
58 
63  virtual bool isExpandValid() const
64  {
65  return true;
66  }
67 
68  protected:
69  /* Pseudo-abstract: Only allow creation through derived types. */
70  AbstractTreeElement(TreeElement &legacy_te) : legacy_te_(legacy_te)
71  {
72  }
73 };
74 
75 } // namespace blender::ed::outliner
AbstractTreeElement(TreeElement &legacy_te)
Definition: tree_element.hh:70
virtual void postExpand(SpaceOutliner &) const
Definition: tree_element.hh:55
virtual bool expandPoll(const SpaceOutliner &) const
Definition: tree_element.hh:45
virtual void expand(SpaceOutliner &) const
Definition: tree_element.hh:52