1 #ifndef _STARDICT_PARSEDATA_PLUGIN_H_
2 #define _STARDICT_PARSEDATA_PLUGIN_H_
8 enum ParseResultItemType {
9 ParseResultItemType_mark,
10 ParseResultItemType_link,
11 ParseResultItemType_res,
12 ParseResultItemType_widget,
15 struct ParseResultMarkItem {
20 std::string::size_type pos_;
21 std::string::size_type len_;
23 LinkDesc(std::string::size_type pos, std::string::size_type len, std::string link):
24 pos_(pos), len_(len), link_(link) {}
27 typedef std::list<LinkDesc> LinksPosList;
29 struct ParseResultLinkItem {
31 LinksPosList links_list;
34 struct ParseResultResItem {
39 struct ParseResultWidgetItem {
43 struct ParseResultItem {
44 ParseResultItemType type;
46 ParseResultMarkItem *mark;
47 ParseResultLinkItem *link;
48 ParseResultResItem *res;
49 ParseResultWidgetItem *widget;
56 std::list<ParseResultItem> item_list;
59 struct StarDictParseDataPlugInObject{
60 StarDictParseDataPlugInObject();
62 typedef bool (*parse_func_t)(const char *p, unsigned int *parsed_size, ParseResult &result, const char *oword);
63 parse_func_t parse_func;