MyGUI  3.0.1
MyGUI_ILayerNode.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of MyGUI.
9 
10  MyGUI is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MyGUI is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22 */
23 #ifndef __MYGUI_I_LAYER_NODE_H__
24 #define __MYGUI_I_LAYER_NODE_H__
25 
26 #include "MyGUI_Prerequest.h"
27 #include "MyGUI_Enumerator.h"
28 #include "MyGUI_IObject.h"
29 #include "MyGUI_IRenderTarget.h"
30 
31 namespace MyGUI
32 {
33 
34  class ILayer;
35  class ILayerItem;
36  class ILayerNode;
37 
38  class RenderItem;
39  class ISubWidget;
40 
41  typedef std::vector<ILayerNode*> VectorILayerNode;
43 
45  {
47 
48  public:
49  virtual ~ILayerNode() { }
50 
51  // леер, которому мы принадлежим
52  virtual ILayer* getLayer() = 0;
53 
54  // возвращает отца или nullptr
55  virtual ILayerNode* getParent() = 0;
56 
57  // создаем дочерний нод
58  virtual ILayerNode* createChildItemNode() = 0;
59  // удаляем дочерний нод
60  virtual void destroyChildItemNode(ILayerNode* _node) = 0;
61 
62  // поднимаем дочерний нод
63  virtual void upChildItemNode(ILayerNode* _node) = 0;
64 
65  // список детей
66  virtual EnumeratorILayerNode getEnumerator() = 0;
67 
68 
69  // добавляем айтем к ноду
70  virtual void attachLayerItem(ILayerItem* _item) = 0;
71  // удаляем айтем из нода
72  virtual void detachLayerItem(ILayerItem* _root) = 0;
73 
74  // добавляет саб айтем и возвращает рендер айтем
75  virtual RenderItem* addToRenderItem(ITexture* _texture, ISubWidget* _item) = 0;
76  // необходимо обновление нода
77  virtual void outOfDate(RenderItem* _item) = 0;
78 
79  // возвращает виджет по позиции
80  virtual ILayerItem* getLayerItemByPoint(int _left, int _top) = 0;
81 
82  // рисует леер
83  virtual void renderToTarget(IRenderTarget* _target, bool _update) = 0;
84 
85  virtual void dumpStatisticToLog(size_t _level) { }
86 
87  };
88 
89 } // namespace MyGUI
90 
91 #endif // __MYGUI_I_LAYER_NODE_H__