]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/httag.tex
fix LaTeX error (escape underscores); don't abuse bold face
[wxWidgets.git] / docs / latex / wx / httag.tex
CommitLineData
704a4b75
VS
1%
2% automatically generated by HelpGen from
3% htmltag.tex at 14/Mar/99 20:13:37
4%
5
704a4b75
VS
6\section{\class{wxHtmlTag}}\label{wxhtmltag}
7
448af9a4 8This class represents a single HTML tag.
704a4b75
VS
9It is used by \helpref{tag handlers}{handlers}.
10
704a4b75
VS
11\wxheading{Derived from}
12
13wxObject
14
9704b250
VS
15\wxheading{Include files}
16
17<wx/html/htmltag.h>
18
a7af285d
VZ
19\wxheading{Library}
20
21\helpref{wxHtml}{librarieslist}
22
704a4b75
VS
23\latexignore{\rtfignore{\wxheading{Members}}}
24
704a4b75
VS
25\membersection{wxHtmlTag::wxHtmlTag}\label{wxhtmltagwxhtmltag}
26
f6e9a818
RN
27\func{}{wxHtmlTag}{\param{wxHtmlTag *}{parent}, \param{const wxString\& }{source},
28\param{int }{pos}, \param{int }{end\_pos},
29\param{wxHtmlTagsCache* }{cache}, \param{wxHtmlEntitiesParser *}{entParser}}
704a4b75 30
f6bcfd97 31Constructor. You will probably never have to construct a wxHtmlTag object
448af9a4 32yourself. Feel free to ignore the constructor parameters.
cc6e1950 33Have a look at src/html/htmlpars.cpp if you're interested in creating it.
704a4b75 34
559fe022 35\membersection{wxHtmlTag::GetAllParams}\label{wxhtmltaggetallparams}
704a4b75 36
559fe022 37\constfunc{const wxString\&}{GetAllParams}{\void}
704a4b75 38
cc6e1950 39Returns a string containing all parameters.
704a4b75 40
559fe022
VS
41Example : tag contains {\tt <FONT SIZE=+2 COLOR="\#000000">}. Call to
42tag.GetAllParams() would return {\tt SIZE=+2 COLOR="\#000000"}.
704a4b75 43
605d715d 44
559fe022 45\membersection{wxHtmlTag::GetBeginPos}\label{wxhtmltaggetbeginpos}
704a4b75 46
559fe022 47\constfunc{int}{GetBeginPos}{\void}
704a4b75 48
559fe022
VS
49Returns beginning position of the text {\it between} this tag and paired
50ending tag.
605d715d 51See explanation (returned position is marked with `|'):
704a4b75 52
559fe022 53\begin{verbatim}
2edb0bde 54bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla
605d715d 55 |
559fe022
VS
56\end{verbatim}
57
605d715d 58
559fe022
VS
59\membersection{wxHtmlTag::GetEndPos1}\label{wxhtmltaggetendpos1}
60
61\constfunc{int}{GetEndPos1}{\void}
62
63Returns ending position of the text {\it between} this tag and paired
64ending tag.
605d715d 65See explanation (returned position is marked with `|'):
559fe022
VS
66
67\begin{verbatim}
2edb0bde 68bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla
605d715d 69 |
559fe022
VS
70\end{verbatim}
71
605d715d 72
559fe022
VS
73\membersection{wxHtmlTag::GetEndPos2}\label{wxhtmltaggetendpos2}
74
75\constfunc{int}{GetEndPos2}{\void}
76
77Returns ending position 2 of the text {\it between} this tag and paired
78ending tag.
605d715d 79See explanation (returned position is marked with `|'):
559fe022
VS
80
81\begin{verbatim}
2edb0bde 82bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla
605d715d 83 |
559fe022
VS
84\end{verbatim}
85
86\membersection{wxHtmlTag::GetName}\label{wxhtmltaggetname}
87
88\constfunc{wxString}{GetName}{\void}
89
90Returns tag's name. The name is always in uppercase and it doesn't contain
91'<' or '/' characters. (So the name of {\tt <FONT SIZE=+2>} tag is "FONT"
92and name of {\tt </table>} is "TABLE")
704a4b75 93
605d715d 94
704a4b75
VS
95\membersection{wxHtmlTag::GetParam}\label{wxhtmltaggetparam}
96
614f9713 97\constfunc{wxString}{GetParam}{\param{const wxString\& }{par}, \param{bool }{with\_quotes = false}}
704a4b75 98
cc6e1950
VS
99Returns the value of the parameter. You should check whether the
100parameter exists or not (use \helpref{HasParam}{wxhtmltaghasparam}) first.
704a4b75
VS
101
102\wxheading{Parameters}
103
cc6e1950 104\docparam{par}{The parameter's name.}
704a4b75 105
614f9713 106\docparam{with\_quotes}{true if you want to get quotes as well. See example.}
704a4b75
VS
107
108\wxheading{Example}
109
110\begin{verbatim}
111...
112/* you have wxHtmlTag variable tag which is equal to
113 HTML tag <FONT SIZE=+2 COLOR="#0000FF"> */
114dummy = tag.GetParam("SIZE");
115 // dummy == "+2"
116dummy = tag.GetParam("COLOR");
117 // dummy == "#0000FF"
cc81d32f 118dummy = tag.GetParam("COLOR", true);
704a4b75
VS
119 // dummy == "\"#0000FF\"" -- see the difference!!
120\end{verbatim}
121
8ca46841
VS
122\membersection{wxHtmlTag::GetParamAsColour}\label{wxhtmltaggetparamascolour}
123
124\constfunc{bool}{GetParamAsColour}{\param{const wxString\& }{par}, \param{wxColour *}{clr}}
125
126Interprets tag parameter {\it par} as colour specification and saves its value
127into wxColour variable pointed by {\it clr}.
128
cc81d32f 129Returns true on success and false if {\it par} is not colour specification or
8ca46841
VS
130if the tag has no such parameter.
131
132\membersection{wxHtmlTag::GetParamAsInt}\label{wxhtmltaggetparamasint}
133
134\constfunc{bool}{GetParamAsInt}{\param{const wxString\& }{par}, \param{int *}{value}}
135
136Interprets tag parameter {\it par} as an integer and saves its value
137into int variable pointed by {\it value}.
138
cc81d32f 139Returns true on success and false if {\it par} is not an integer or
8ca46841
VS
140if the tag has no such parameter.
141
704a4b75
VS
142\membersection{wxHtmlTag::HasEnding}\label{wxhtmltaghasending}
143
144\constfunc{bool}{HasEnding}{\void}
145
cc81d32f 146Returns true if this tag is paired with ending tag, false otherwise.
704a4b75
VS
147
148See the example of HTML document:
149
150\begin{verbatim}
151<html><body>
152Hello<p>
153How are you?
154<p align=center>This is centered...</p>
155Oops<br>Oooops!
156</body></html>
157\end{verbatim}
158
159In this example tags HTML and BODY have ending tags, first P and BR
160doesn't have ending tag while the second P has. The third P tag (which
161is ending itself) of course doesn't have ending tag.
162
559fe022 163\membersection{wxHtmlTag::HasParam}\label{wxhtmltaghasparam}
704a4b75 164
559fe022 165\constfunc{bool}{HasParam}{\param{const wxString\& }{par}}
704a4b75 166
cc81d32f 167Returns true if the tag has a parameter of the given name.
559fe022
VS
168Example : {\tt <FONT SIZE=+2 COLOR="\#FF00FF">} has two parameters named
169"SIZE" and "COLOR".
704a4b75 170
559fe022 171\wxheading{Parameters}
704a4b75 172
cc6e1950 173\docparam{par}{the parameter you're looking for.}
704a4b75 174
559fe022 175\membersection{wxHtmlTag::ScanParam}\label{wxhtmltagscanparam}
704a4b75 176
cc6e1950 177\constfunc{wxString}{ScanParam}{\param{const wxString\& }{par}, \param{const wxChar *}{format}, \param{void *}{value}}
704a4b75 178
2edb0bde
VZ
179This method scans the given parameter. Usage is exactly the same as sscanf's
180usage except that you don't pass a string but a parameter name as the first
181argument
182and you can only retrieve one value (i.e. you can use only one "\%" element
cc6e1950
VS
183in {\it format}).
184
559fe022
VS
185
186\wxheading{Parameters}
187
2edb0bde 188\docparam{par}{The name of the tag you want to query}
559fe022
VS
189
190\docparam{format}{scanf()-like format string.}
191
2edb0bde 192\docparam{value}{pointer to a variable to store the value in }
704a4b75 193