MyGUI  3.2.0
MyGUI_ResourceSkin.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_RESOURCE_SKIN_H__
00023 #define __MYGUI_RESOURCE_SKIN_H__
00024 
00025 #include "MyGUI_Prerequest.h"
00026 #include "MyGUI_SubWidgetBinding.h"
00027 #include "MyGUI_ChildSkinInfo.h"
00028 #include "MyGUI_MaskPickInfo.h"
00029 #include "MyGUI_IResource.h"
00030 #include "MyGUI_SubWidgetInfo.h"
00031 
00032 namespace MyGUI
00033 {
00034 
00035     // вспомогательный класс для инициализации одного скина
00036     class MYGUI_EXPORT ResourceSkin :
00037         public IResource
00038     {
00039         MYGUI_RTTI_DERIVED( ResourceSkin )
00040 
00041     public:
00042         ResourceSkin();
00043         virtual ~ResourceSkin();
00044 
00045         virtual void deserialization(xml::ElementPtr _node, Version _version);
00046 
00047         const IntSize& getSize() const;
00048         const std::string& getTextureName() const;
00049         const VectorSubWidgetInfo& getBasisInfo() const;
00050         const MapWidgetStateInfo& getStateInfo() const;
00051         const MapString& getProperties() const;
00052         const VectorChildSkinInfo& getChild() const;
00053         const std::string& getSkinName() const;
00054 
00055     private:
00056         void setInfo(const IntSize& _size, const std::string& _texture);
00057         void addInfo(const SubWidgetBinding& _bind);
00058         void addProperty(const std::string& _key, const std::string& _value);
00059         void addChild(const ChildSkinInfo& _child);
00060         void clear();
00061 
00062         void checkState(const MapStateInfo& _states);
00063         void checkState(const std::string& _name);
00064         void checkBasis();
00065         void fillState(const MapStateInfo& _states, size_t _index);
00066 
00067     private:
00068         IntSize mSize;
00069         std::string mTexture;
00070         VectorSubWidgetInfo mBasis;
00071         MapWidgetStateInfo mStates;
00072         // дополнительные параметры скина
00073         MapString mProperties;
00074         // дети скина
00075         VectorChildSkinInfo mChilds;
00076         std::string mSkinName;
00077     };
00078 
00079 } // namespace MyGUI
00080 
00081 #endif // __MYGUI_RESOURCE_SKIN_H__