axmol/extensions/cocostudio/WidgetReader/NodeReaderProtocol.h

110 lines
3.5 KiB
C++

/****************************************************************************
Copyright (c) 2014 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __cocos2d_libs__NodeReaderProtocol__
#define __cocos2d_libs__NodeReaderProtocol__
#include "ui/GUIDefine.h"
#include "cocostudio/CocosStudioExport.h"
#include "cocostudio/CocosStudioExtension.h"
#include "pugixml/pugixml_imp.hpp"
#include "pugixml/pugiext.hpp"
namespace flatbuffers
{
class FlatBufferBuilder;
template<typename T> struct Offset;
class Table;
struct ResourceData; // x-studio365 spec, csb batch load support, assets hook functions.
}
namespace cocos2d
{
class Node;
}
namespace cocostudio
{
class CC_STUDIOP_DLL NodeReaderProtocol
{
public:
NodeReaderProtocol() {};
virtual ~NodeReaderProtocol() {};
virtual void setCurrentCustomClassName(const char* className) {};
virtual flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,
flatbuffers::FlatBufferBuilder* builder) = 0;
virtual void setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuffers::Table* nodeOptions) = 0;
virtual cocos2d::Node* createNodeWithFlatBuffers(const flatbuffers::Table* nodeOptions) = 0;
};
}
// x-studio365 spec, csb batch load support, assets hook functions.
namespace cocostudio
{
class Armature;
namespace timeline {
class SkeletonNode;
class BoneNode;
}
};
namespace cocos2d {
// builtin ui predecl
class Sprite;
class ParticleSystemQuad;
namespace ui {
class ImageView;
class Button;
class CheckBox;
class Slider;
class LoadingBar;
class Text;
class TextField;
class TextAtlas;
class TextBMFont;
class Layout;
class ScrollView;
class ListView;
class PageView;
class Widget;
}
namespace wext {
CC_STUDIOP_DLL extern cocos2d::ResourceData makeResourceData(const flatbuffers::ResourceData* data);
CC_STUDIOP_DLL extern cocos2d::ResourceData makeResourceData(const std::string& path, int type = 0);
CC_STUDIOP_DLL extern cocos2d::ResourceData makeResourceData(std::string&& path, int type = 0);
};
};
#endif /* defined(__cocos2d_libs__NodeReaderProtocol__) */