2020-09-08 19:15:28 +08:00
|
|
|
#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);
|
2020-09-08 19:15:28 +08:00
|
|
|
|
|
|
|
Type type;
|
|
|
|
std::string text;
|
|
|
|
TextFormat format;
|
|
|
|
HtmlElement* link;
|
|
|
|
HtmlObject *obj;
|
|
|
|
int space;
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::ValueMap attrs;
|
2020-09-08 19:15:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_FGUI_END
|
|
|
|
|
|
|
|
#endif
|