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