#include </home/zeitlin/src/wx/github/interface/wx/html/htmlpars.h>
Public Member Functions | |
wxHtmlTagHandler () | |
Constructor. | |
virtual wxString | GetSupportedTags ()=0 |
Returns list of supported tags. | |
virtual bool | HandleTag (const wxHtmlTag &tag)=0 |
This is the core method of each handler. | |
virtual void | SetParser (wxHtmlParser *parser) |
Assigns parser to this handler. | |
Protected Member Functions | |
void | ParseInner (const wxHtmlTag &tag) |
This method calls parser's wxHtmlParser::DoParsing method for the string between this tag and the paired ending tag: | |
Protected Attributes | |
wxHtmlParser * | m_Parser |
This attribute is used to access parent parser. |
wxHtmlTagHandler::wxHtmlTagHandler | ( | ) |
Constructor.
virtual wxString wxHtmlTagHandler::GetSupportedTags | ( | ) | [pure virtual] |
Returns list of supported tags.
The list is in uppercase and tags are delimited by ','. Example: "I,B,FONT,P"
virtual bool wxHtmlTagHandler::HandleTag | ( | const wxHtmlTag & | tag | ) | [pure virtual] |
This is the core method of each handler.
It is called each time one of supported tags is detected. tag contains all necessary info (see wxHtmlTag for details).
例:
bool MyHandler::HandleTag(const wxHtmlTag& tag) { ... // change state of parser (e.g. set bold face) ParseInner(tag); ... // restore original state of parser }
You shouldn't call ParseInner() if the tag is not paired with an ending one.
void wxHtmlTagHandler::ParseInner | ( | const wxHtmlTag & | tag | ) | [protected] |
This method calls parser's wxHtmlParser::DoParsing method for the string between this tag and the paired ending tag:
...<A HREF="x.htm">Hello, world!</A>...
In this example, a call to ParseInner() (with tag pointing to A tag) will parse 'Hello, world!'.
virtual void wxHtmlTagHandler::SetParser | ( | wxHtmlParser * | parser | ) | [virtual] |
Assigns parser to this handler.
Each instance of handler is guaranteed to be called only from the parser.
wxHtmlParser* wxHtmlTagHandler::m_Parser [protected] |
This attribute is used to access parent parser.
It is protected so that it can't be accessed by user but can be accessed from derived classes.