]>
Commit | Line | Data |
---|---|---|
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 | \wxheading{Library} | |
20 | ||
21 | \helpref{wxHtml}{librarieslist} | |
22 | ||
23 | \latexignore{\rtfignore{\wxheading{Members}}} | |
24 | ||
25 | \membersection{wxHtmlTag::wxHtmlTag}\label{wxhtmltagwxhtmltag} | |
26 | ||
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}} | |
30 | ||
31 | Constructor. You will probably never have to construct a wxHtmlTag object | |
32 | yourself. Feel free to ignore the constructor parameters. | |
33 | Have a look at src/html/htmlpars.cpp if you're interested in creating it. | |
34 | ||
35 | \membersection{wxHtmlTag::GetAllParams}\label{wxhtmltaggetallparams} | |
36 | ||
37 | \constfunc{const wxString\&}{GetAllParams}{\void} | |
38 | ||
39 | Returns a string containing all parameters. | |
40 | ||
41 | Example : tag contains {\tt <FONT SIZE=+2 COLOR="\#000000">}. Call to | |
42 | tag.GetAllParams() would return {\tt SIZE=+2 COLOR="\#000000"}. | |
43 | ||
44 | ||
45 | \membersection{wxHtmlTag::GetBeginPos}\label{wxhtmltaggetbeginpos} | |
46 | ||
47 | \constfunc{int}{GetBeginPos}{\void} | |
48 | ||
49 | Returns beginning position of the text {\it between} this tag and paired | |
50 | ending tag. | |
51 | See explanation (returned position is marked with `|'): | |
52 | ||
53 | \begin{verbatim} | |
54 | bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla | |
55 | | | |
56 | \end{verbatim} | |
57 | ||
58 | ||
59 | \membersection{wxHtmlTag::GetEndPos1}\label{wxhtmltaggetendpos1} | |
60 | ||
61 | \constfunc{int}{GetEndPos1}{\void} | |
62 | ||
63 | Returns ending position of the text {\it between} this tag and paired | |
64 | ending tag. | |
65 | See explanation (returned position is marked with `|'): | |
66 | ||
67 | \begin{verbatim} | |
68 | bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla | |
69 | | | |
70 | \end{verbatim} | |
71 | ||
72 | ||
73 | \membersection{wxHtmlTag::GetEndPos2}\label{wxhtmltaggetendpos2} | |
74 | ||
75 | \constfunc{int}{GetEndPos2}{\void} | |
76 | ||
77 | Returns ending position 2 of the text {\it between} this tag and paired | |
78 | ending tag. | |
79 | See explanation (returned position is marked with `|'): | |
80 | ||
81 | \begin{verbatim} | |
82 | bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla | |
83 | | | |
84 | \end{verbatim} | |
85 | ||
86 | \membersection{wxHtmlTag::GetName}\label{wxhtmltaggetname} | |
87 | ||
88 | \constfunc{wxString}{GetName}{\void} | |
89 | ||
90 | Returns 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" | |
92 | and name of {\tt </table>} is "TABLE") | |
93 | ||
94 | ||
95 | \membersection{wxHtmlTag::GetParam}\label{wxhtmltaggetparam} | |
96 | ||
97 | \constfunc{wxString}{GetParam}{\param{const wxString\& }{par}, \param{bool }{with\_quotes = false}} | |
98 | ||
99 | Returns the value of the parameter. You should check whether the | |
100 | parameter exists or not (use \helpref{HasParam}{wxhtmltaghasparam}) first. | |
101 | ||
102 | \wxheading{Parameters} | |
103 | ||
104 | \docparam{par}{The parameter's name.} | |
105 | ||
106 | \docparam{with\_quotes}{true if you want to get quotes as well. See example.} | |
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"> */ | |
114 | dummy = tag.GetParam("SIZE"); | |
115 | // dummy == "+2" | |
116 | dummy = tag.GetParam("COLOR"); | |
117 | // dummy == "#0000FF" | |
118 | dummy = tag.GetParam("COLOR", true); | |
119 | // dummy == "\"#0000FF\"" -- see the difference!! | |
120 | \end{verbatim} | |
121 | ||
122 | \membersection{wxHtmlTag::GetParamAsColour}\label{wxhtmltaggetparamascolour} | |
123 | ||
124 | \constfunc{bool}{GetParamAsColour}{\param{const wxString\& }{par}, \param{wxColour *}{clr}} | |
125 | ||
126 | Interprets tag parameter {\it par} as colour specification and saves its value | |
127 | into wxColour variable pointed by {\it clr}. | |
128 | ||
129 | Returns true on success and false if {\it par} is not colour specification or | |
130 | if 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 | ||
136 | Interprets tag parameter {\it par} as an integer and saves its value | |
137 | into int variable pointed by {\it value}. | |
138 | ||
139 | Returns true on success and false if {\it par} is not an integer or | |
140 | if the tag has no such parameter. | |
141 | ||
142 | \membersection{wxHtmlTag::HasEnding}\label{wxhtmltaghasending} | |
143 | ||
144 | \constfunc{bool}{HasEnding}{\void} | |
145 | ||
146 | Returns true if this tag is paired with ending tag, false otherwise. | |
147 | ||
148 | See the example of HTML document: | |
149 | ||
150 | \begin{verbatim} | |
151 | <html><body> | |
152 | Hello<p> | |
153 | How are you? | |
154 | <p align=center>This is centered...</p> | |
155 | Oops<br>Oooops! | |
156 | </body></html> | |
157 | \end{verbatim} | |
158 | ||
159 | In this example tags HTML and BODY have ending tags, first P and BR | |
160 | doesn't have ending tag while the second P has. The third P tag (which | |
161 | is ending itself) of course doesn't have ending tag. | |
162 | ||
163 | \membersection{wxHtmlTag::HasParam}\label{wxhtmltaghasparam} | |
164 | ||
165 | \constfunc{bool}{HasParam}{\param{const wxString\& }{par}} | |
166 | ||
167 | Returns true if the tag has a parameter of the given name. | |
168 | Example : {\tt <FONT SIZE=+2 COLOR="\#FF00FF">} has two parameters named | |
169 | "SIZE" and "COLOR". | |
170 | ||
171 | \wxheading{Parameters} | |
172 | ||
173 | \docparam{par}{the parameter you're looking for.} | |
174 | ||
175 | \membersection{wxHtmlTag::ScanParam}\label{wxhtmltagscanparam} | |
176 | ||
177 | \constfunc{wxString}{ScanParam}{\param{const wxString\& }{par}, \param{const wxChar *}{format}, \param{void *}{value}} | |
178 | ||
179 | This method scans the given parameter. Usage is exactly the same as sscanf's | |
180 | usage except that you don't pass a string but a parameter name as the first | |
181 | argument | |
182 | and you can only retrieve one value (i.e. you can use only one "\%" element | |
183 | in {\it format}). | |
184 | ||
185 | ||
186 | \wxheading{Parameters} | |
187 | ||
188 | \docparam{par}{The name of the tag you want to query} | |
189 | ||
190 | \docparam{format}{scanf()-like format string.} | |
191 | ||
192 | \docparam{value}{pointer to a variable to store the value in } | |
193 |