axmol/extensions/fairygui/utils/html/HtmlElement.h

44 lines
779 B
C
Raw Normal View History

#ifndef __HTMLELEMENT_H__
#define __HTMLELEMENT_H__
#include "cocos2d.h"
#include "FairyGUIMacros.h"
#include "display/TextFormat.h"
NS_FGUI_BEGIN
class HtmlObject;
class HtmlElement
{
public:
enum class Type
{
TEXT,
IMAGE,
LINK,
INPUT,
SELECT,
OBJECT
};
HtmlElement(Type type);
virtual ~HtmlElement() {};
int getInt(const std::string& attrName, int defValue = 0);
2022-08-08 18:02:17 +08:00
std::string getString(const std::string& attrName, const std::string& defValue = ax::STD_STRING_EMPTY);
ax::ValueVector& getArray(const std::string& attrName);
Type type;
std::string text;
TextFormat format;
HtmlElement* link;
HtmlObject *obj;
int space;
2022-08-08 18:02:17 +08:00
ax::ValueMap attrs;
};
NS_FGUI_END
#endif