X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/559fe022dbd5d4d961402b5c973e5225fa91f17f..5d9dba5b1a3a9072b8f9a2789ab39e11f193940d:/docs/latex/wx/htparser.tex

diff --git a/docs/latex/wx/htparser.tex b/docs/latex/wx/htparser.tex
index 9df02c7c11..fea721c027 100644
--- a/docs/latex/wx/htparser.tex
+++ b/docs/latex/wx/htparser.tex
@@ -26,6 +26,11 @@ Typically the user calls only the \helpref{Parse}{wxhtmlparserparse} method.
 
 wxObject
 
+\wxheading{Include files}
+
+<wx/html/htmlpars.h>
+
+
 \wxheading{See also}
 
 \helpref{Cells Overview}{cells},
@@ -122,31 +127,6 @@ See wxHtmlWinParser for details.
 
 Returns pointer to the source being parsed.
 
-\membersection{wxHtmlParser::GetTempData}\label{wxhtmlparsergettempdata}
-
-\func{virtual wxList*}{GetTempData}{\void}
-
-This method returns list of wxObjects that represents
-all data allocated by the parser. These can't be freed
-by the destructor because they must be valid as long as
-GetProduct's return value is valid - the caller must
-explicitly call
-
-\begin{verbatim}
-delete (MyParser -> GetTempData());
-\end{verbatim}
-
-to free the memory (this method always sets the list to delete its contents).
-
-\wxheading{Example}
-
-Why is this neccessary? Imagine wxHtmlWinParser: when handling
-a FONT tag it creates some fonts. These fonts are then used by wxHtmlWindow
-to display the text. But the wxHtmWinParser object is needed only when parsing
-the document - it may be deleted then. But fonts CAN'T be deleted - they
-must exist as long as the window is displaying text.
-
-GetTempData() solves the problem.
 
 \membersection{wxHtmlParser::InitParser}\label{wxhtmlparserinitparser}
 
@@ -164,7 +144,7 @@ call it when you need to obtain parsed output (which is parser-specific)
 
 The method does these things:
 
-\begin{enumerate}
+\begin{enumerate}\itemsep=0pt
 \item calls \helpref{InitParser(source)}{wxhtmlparserinitparser}
 \item calls \helpref{DoParsing}{wxhtmlparserdoparsing}
 \item calls \helpref{GetProduct}{wxhtmlparsergetproduct}
@@ -174,6 +154,67 @@ The method does these things:
 
 You shouldn't use InitParser, DoParsing, GetProduct or DoneParser directly.
 
+
+
+\membersection{wxHtmlParser::PushTagHandler}\label{wxhtmlparserpushtaghandler}
+
+\func{void}{PushTagHandler}{\param{wxHtmlTagHandler* }{handler}, \param{wxString }{tags}}
+
+Forces the handler to handle additional tags 
+(not returned by \helpref{GetSupportedTags}{wxhtmltaghandlergetsupportedtags}). 
+The handler should already be added to this parser.
+
+\wxheading{Parameters}
+
+\docparam{handler}{the handler}
+\docparam{tags}{List of tags (in same format as GetSupportedTags's return value). The parser
+will redirect these tags to {\it handler} (until call to \helpref{PopTagHandler}{wxhtmlparserpoptaghandler}). }
+
+\wxheading{Example}
+
+Imagine you want to parse following pseudo-html structure:
+
+\begin{verbatim}
+<myitems>
+    <param name="one" value="1">
+    <param name="two" value="2">
+</myitems>
+
+<execute>
+    <param program="text.exe">
+</execute>
+\end{verbatim}
+
+It is obvious that you cannot use only one tag handler for <param> tag.
+Instead you must use context-sensitive handlers for <param> inside <myitems>
+and <param> inside <execute>.        
+
+This is the prefered solution:
+
+\begin{verbatim}
+TAG_HANDLER_BEGIN(MYITEM, "MYITEMS")
+    TAG_HANDLER_PROC(tag)
+    {
+        // ...something...
+
+        m_Parser -> PushTagHandler(this, "PARAM");
+        ParseInner(tag);
+        m_Parser -> PopTagHandler();
+
+        // ...something...
+     }
+TAG_HANDLER_END(MYITEM)
+\end{verbatim}
+
+
+\membersection{wxHtmlParser::PopTagHandler}\label{wxhtmlparserpoptaghandler}
+
+\func{void}{PopTagHandler}{\void}
+
+Restores parser's state before last call to 
+\helpref{PushTagHandler}{wxhtmlparserpushtaghandler}.
+
+
 \membersection{wxHtmlParser::SetFS}\label{wxhtmlparsersetfs}
 
 \func{void}{SetFS}{\param{wxFileSystem }{*fs}}
