MyGUI  3.2.0
MyGUI_LayerItem.h
Go to the documentation of this file.
00001 
00006 /*
00007     This file is part of MyGUI.
00008 
00009     MyGUI is free software: you can redistribute it and/or modify
00010     it under the terms of the GNU Lesser General Public License as published by
00011     the Free Software Foundation, either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     MyGUI is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00021 */
00022 #ifndef __MYGUI_LAYER_ITEM_H__
00023 #define __MYGUI_LAYER_ITEM_H__
00024 
00025 #include "MyGUI_Prerequest.h"
00026 #include "MyGUI_LayerManager.h"
00027 #include "MyGUI_ILayer.h"
00028 #include "MyGUI_ILayerNode.h"
00029 #include "MyGUI_ILayerItem.h"
00030 #include "MyGUI_ISubWidget.h"
00031 
00032 namespace MyGUI
00033 {
00034 
00035     class MYGUI_EXPORT LayerItem :
00036         public ILayerItem
00037     {
00038     public:
00039         LayerItem();
00040         virtual ~LayerItem();
00041 
00042         ILayer* getLayer() const;
00043 
00044         virtual void attachItemToNode(ILayer* _layer, ILayerNode* _node);
00045         virtual void detachFromLayer();
00046         virtual void upLayerItem();
00047 
00048         void setRenderItemTexture(ITexture* _texture);
00049 
00050         void addChildItem(LayerItem* _item);
00051         void removeChildItem(LayerItem* _item);
00052 
00053         void addChildNode(LayerItem* _item);
00054         void removeChildNode(LayerItem* _item);
00055 
00056         void addRenderItem(ISubWidget* _item);
00057         void removeAllRenderItems();
00058 
00059         void saveLayerItem();
00060         void restoreLayerItem();
00061 
00062     protected:
00063         void attachToLayerItemNode(ILayerNode* _node, bool _deep);
00064         void detachFromLayerItemNode(bool _deep);
00065 
00066     private:
00067         // актуально для рутового виджета
00068         ILayer* mLayer;
00069         // конкретный айтем находящийся в слое
00070         ILayerNode* mLayerNode;
00071         ILayerNode* mSaveLayerNode;
00072 
00073         typedef std::vector<LayerItem*> VectorLayerItem;
00074         // список наших детей айтемов
00075         VectorLayerItem mLayerItems;
00076         // список наших узлов
00077         VectorLayerItem mLayerNodes;
00078 
00079         // вектор всех детей сабскинов
00080         VectorSubWidget mDrawItems;
00081 
00082         ITexture* mTexture;
00083     };
00084 
00085 } // namespace MyGUI
00086 
00087 #endif // __MYGUI_LAYER_ITEM_H__