| 107 }; |
107 }; |
| 108 |
108 |
| 109 G_BEGIN_DECLS |
109 G_BEGIN_DECLS |
| 110 |
110 |
| 111 /** |
111 /** |
| |
112 * gtk_webview_get_type: |
| |
113 * |
| 112 * Returns the GType for a GtkWebView widget |
114 * Returns the GType for a GtkWebView widget |
| 113 * |
115 * |
| 114 * Returns: The GType for GtkWebView widget |
116 * Returns: The GType for GtkWebView widget |
| 115 */ |
117 */ |
| 116 GType gtk_webview_get_type(void); |
118 GType gtk_webview_get_type(void); |
| 117 |
119 |
| 118 /** |
120 /** |
| |
121 * gtk_webview_new: |
| |
122 * @editable: Whether this GtkWebView will be user-editable |
| |
123 * |
| 119 * Create a new GtkWebView object |
124 * Create a new GtkWebView object |
| 120 * |
125 * |
| 121 * @editable: Whether this GtkWebView will be user-editable |
|
| 122 * |
|
| 123 * Returns: A GtkWidget corresponding to the GtkWebView object |
126 * Returns: A GtkWidget corresponding to the GtkWebView object |
| 124 */ |
127 */ |
| 125 GtkWidget *gtk_webview_new(gboolean editable); |
128 GtkWidget *gtk_webview_new(gboolean editable); |
| 126 |
129 |
| 127 /** |
130 /** |
| |
131 * gtk_webview_append_html: |
| |
132 * @webview: The GtkWebView object |
| |
133 * @markup: The html markup to append |
| |
134 * |
| 128 * A very basic routine to append html, which can be considered |
135 * A very basic routine to append html, which can be considered |
| 129 * equivalent to a "document.write" using JavaScript. |
136 * equivalent to a "document.write" using JavaScript. |
| 130 * |
|
| 131 * @webview: The GtkWebView object |
|
| 132 * @markup: The html markup to append |
|
| 133 */ |
137 */ |
| 134 void gtk_webview_append_html(GtkWebView *webview, const char *markup); |
138 void gtk_webview_append_html(GtkWebView *webview, const char *markup); |
| 135 |
139 |
| 136 /** |
140 /** |
| 137 * Requests loading of the given content. |
141 * gtk_webview_load_html_string: |
| 138 * |
|
| 139 * @webview: The GtkWebView object |
142 * @webview: The GtkWebView object |
| 140 * @html: The HTML content to load |
143 * @html: The HTML content to load |
| |
144 * |
| |
145 * Requests loading of the given content. |
| 141 */ |
146 */ |
| 142 void gtk_webview_load_html_string(GtkWebView *webview, const char *html); |
147 void gtk_webview_load_html_string(GtkWebView *webview, const char *html); |
| 143 |
148 |
| 144 /** |
149 /** |
| |
150 * gtk_webview_load_html_string_with_selection: |
| |
151 * @webview: The GtkWebView object |
| |
152 * @html: The HTML content to load |
| |
153 * |
| 145 * Requests loading of the given content and sets the selection. You must |
154 * Requests loading of the given content and sets the selection. You must |
| 146 * include an anchor tag with id='caret' in the HTML string, which will be |
155 * include an anchor tag with id='caret' in the HTML string, which will be |
| 147 * used to set the selection. This tag is then removed so that querying the |
156 * used to set the selection. This tag is then removed so that querying the |
| 148 * WebView's HTML contents will no longer return it. |
157 * WebView's HTML contents will no longer return it. |
| 149 * |
158 */ |
| |
159 void gtk_webview_load_html_string_with_selection(GtkWebView *webview, const char *html); |
| |
160 |
| |
161 /** |
| |
162 * gtk_webview_safe_execute_script: |
| 150 * @webview: The GtkWebView object |
163 * @webview: The GtkWebView object |
| 151 * @html: The HTML content to load |
164 * @script: The script to execute |
| 152 */ |
165 * |
| 153 void gtk_webview_load_html_string_with_selection(GtkWebView *webview, const char *html); |
|
| 154 |
|
| 155 /** |
|
| 156 * Execute the JavaScript only after the webkit_webview_load_string |
166 * Execute the JavaScript only after the webkit_webview_load_string |
| 157 * loads completely. We also guarantee that the scripts are executed |
167 * loads completely. We also guarantee that the scripts are executed |
| 158 * in the order they are called here. This is useful to avoid race |
168 * in the order they are called here. This is useful to avoid race |
| 159 * conditions when calling JS functions immediately after opening the |
169 * conditions when calling JS functions immediately after opening the |
| 160 * page. |
170 * page. |
| 161 * |
|
| 162 * @webview: The GtkWebView object |
|
| 163 * @script: The script to execute |
|
| 164 */ |
171 */ |
| 165 void gtk_webview_safe_execute_script(GtkWebView *webview, const char *script); |
172 void gtk_webview_safe_execute_script(GtkWebView *webview, const char *script); |
| 166 |
173 |
| 167 /** |
174 /** |
| |
175 * gtk_webview_quote_js_string: |
| |
176 * @str: The string to escape and quote |
| |
177 * |
| 168 * A convenience routine to quote a string for use as a JavaScript |
178 * A convenience routine to quote a string for use as a JavaScript |
| 169 * string. For instance, "hello 'world'" becomes "'hello \\'world\\''" |
179 * string. For instance, "hello 'world'" becomes "'hello \\'world\\''" |
| 170 * |
180 * |
| 171 * @str: The string to escape and quote |
|
| 172 * |
|
| 173 * Returns: The quoted string |
181 * Returns: The quoted string |
| 174 */ |
182 */ |
| 175 char *gtk_webview_quote_js_string(const char *str); |
183 char *gtk_webview_quote_js_string(const char *str); |
| 176 |
184 |
| 177 /** |
185 /** |
| 178 * Set the vertical adjustment for the GtkWebView. |
186 * gtk_webview_set_vadjustment: |
| 179 * |
|
| 180 * @webview: The GtkWebView object |
187 * @webview: The GtkWebView object |
| 181 * @vadj: The GtkAdjustment that control the webview |
188 * @vadj: The GtkAdjustment that control the webview |
| |
189 * |
| |
190 * Set the vertical adjustment for the GtkWebView. |
| 182 */ |
191 */ |
| 183 void gtk_webview_set_vadjustment(GtkWebView *webview, GtkAdjustment *vadj); |
192 void gtk_webview_set_vadjustment(GtkWebView *webview, GtkAdjustment *vadj); |
| 184 |
193 |
| 185 /** |
194 /** |
| 186 * Scrolls the Webview to the end of its contents. |
195 * gtk_webview_scroll_to_end: |
| 187 * |
|
| 188 * @webview: The GtkWebView object |
196 * @webview: The GtkWebView object |
| 189 * @smooth: A boolean indicating if smooth scrolling should be used |
197 * @smooth: A boolean indicating if smooth scrolling should be used |
| |
198 * |
| |
199 * Scrolls the Webview to the end of its contents. |
| 190 */ |
200 */ |
| 191 void gtk_webview_scroll_to_end(GtkWebView *webview, gboolean smooth); |
201 void gtk_webview_scroll_to_end(GtkWebView *webview, gboolean smooth); |
| 192 |
202 |
| 193 /** |
203 /** |
| |
204 * gtk_webview_set_autoscroll: |
| |
205 * @webview: The GtkWebView object |
| |
206 * @scroll: Whether to automatically scroll |
| |
207 * |
| 194 * Set whether the GtkWebView stays at its end when HTML content is appended. If |
208 * Set whether the GtkWebView stays at its end when HTML content is appended. If |
| 195 * not already at the end before appending, then scrolling will not occur. |
209 * not already at the end before appending, then scrolling will not occur. |
| 196 * |
210 */ |
| |
211 void gtk_webview_set_autoscroll(GtkWebView *webview, gboolean scroll); |
| |
212 |
| |
213 /** |
| |
214 * gtk_webview_get_autoscroll: |
| 197 * @webview: The GtkWebView object |
215 * @webview: The GtkWebView object |
| 198 * @scroll: Whether to automatically scroll |
216 * |
| 199 */ |
|
| 200 void gtk_webview_set_autoscroll(GtkWebView *webview, gboolean scroll); |
|
| 201 |
|
| 202 /** |
|
| 203 * Set whether the GtkWebView stays at its end when HTML content is appended. If |
217 * Set whether the GtkWebView stays at its end when HTML content is appended. If |
| 204 * not already at the end before appending, then scrolling will not occur. |
218 * not already at the end before appending, then scrolling will not occur. |
| 205 * |
219 * |
| 206 * @webview: The GtkWebView object |
|
| 207 * |
|
| 208 * Returns: Whether to automatically scroll |
220 * Returns: Whether to automatically scroll |
| 209 */ |
221 */ |
| 210 gboolean gtk_webview_get_autoscroll(GtkWebView *webview); |
222 gboolean gtk_webview_get_autoscroll(GtkWebView *webview); |
| 211 |
223 |
| 212 /** |
224 /** |
| |
225 * gtk_webview_page_up: |
| |
226 * @webview: The GtkWebView. |
| |
227 * |
| 213 * Scrolls a GtkWebView up by one page. |
228 * Scrolls a GtkWebView up by one page. |
| 214 * |
229 */ |
| |
230 void gtk_webview_page_up(GtkWebView *webview); |
| |
231 |
| |
232 /** |
| |
233 * gtk_webview_page_down: |
| 215 * @webview: The GtkWebView. |
234 * @webview: The GtkWebView. |
| 216 */ |
235 * |
| 217 void gtk_webview_page_up(GtkWebView *webview); |
|
| 218 |
|
| 219 /** |
|
| 220 * Scrolls a GtkWebView down by one page. |
236 * Scrolls a GtkWebView down by one page. |
| 221 * |
|
| 222 * @webview: The GtkWebView. |
|
| 223 */ |
237 */ |
| 224 void gtk_webview_page_down(GtkWebView *webview); |
238 void gtk_webview_page_down(GtkWebView *webview); |
| 225 |
239 |
| 226 /** |
240 /** |
| 227 * Setup formatting for a GtkWebView depending on the flags specified. |
241 * gtk_webview_setup_entry: |
| 228 * |
|
| 229 * @webview: The GtkWebView. |
242 * @webview: The GtkWebView. |
| 230 * @flags: The connection flags describing the allowed formatting. |
243 * @flags: The connection flags describing the allowed formatting. |
| |
244 * |
| |
245 * Setup formatting for a GtkWebView depending on the flags specified. |
| 231 */ |
246 */ |
| 232 void gtk_webview_setup_entry(GtkWebView *webview, PurpleConnectionFlags flags); |
247 void gtk_webview_setup_entry(GtkWebView *webview, PurpleConnectionFlags flags); |
| 233 |
248 |
| 234 /** |
249 /** |
| 235 * Setup spell-checking on a GtkWebView. |
250 * pidgin_webview_set_spellcheck: |
| 236 * |
|
| 237 * @webview: The GtkWebView. |
251 * @webview: The GtkWebView. |
| 238 * @enable: Whether to enable or disable spell-checking. |
252 * @enable: Whether to enable or disable spell-checking. |
| |
253 * |
| |
254 * Setup spell-checking on a GtkWebView. |
| 239 */ |
255 */ |
| 240 void pidgin_webview_set_spellcheck(GtkWebView *webview, gboolean enable); |
256 void pidgin_webview_set_spellcheck(GtkWebView *webview, gboolean enable); |
| 241 |
257 |
| 242 /** |
258 /** |
| |
259 * gtk_webview_set_whole_buffer_formatting_only: |
| |
260 * @webview: The GtkWebView |
| |
261 * @wbfo: %TRUE to enable the mode, or %FALSE otherwise. |
| |
262 * |
| 243 * Enables or disables whole buffer formatting only (wbfo) in a GtkWebView. |
263 * Enables or disables whole buffer formatting only (wbfo) in a GtkWebView. |
| 244 * In this mode formatting options to the buffer take effect for the entire |
264 * In this mode formatting options to the buffer take effect for the entire |
| 245 * buffer instead of specific text. |
265 * buffer instead of specific text. |
| 246 * |
|
| 247 * @webview: The GtkWebView |
|
| 248 * @wbfo: %TRUE to enable the mode, or %FALSE otherwise. |
|
| 249 */ |
266 */ |
| 250 void gtk_webview_set_whole_buffer_formatting_only(GtkWebView *webview, |
267 void gtk_webview_set_whole_buffer_formatting_only(GtkWebView *webview, |
| 251 gboolean wbfo); |
268 gboolean wbfo); |
| 252 |
269 |
| 253 /** |
270 /** |
| |
271 * gtk_webview_set_format_functions: |
| |
272 * @webview: The GtkWebView |
| |
273 * @buttons: A GtkWebViewButtons bitmask indicating which functions to use |
| |
274 * |
| 254 * Indicates which formatting functions to enable and disable in a GtkWebView. |
275 * Indicates which formatting functions to enable and disable in a GtkWebView. |
| 255 * |
|
| 256 * @webview: The GtkWebView |
|
| 257 * @buttons: A GtkWebViewButtons bitmask indicating which functions to use |
|
| 258 */ |
276 */ |
| 259 void gtk_webview_set_format_functions(GtkWebView *webview, |
277 void gtk_webview_set_format_functions(GtkWebView *webview, |
| 260 GtkWebViewButtons buttons); |
278 GtkWebViewButtons buttons); |
| 261 |
279 |
| 262 /** |
280 /** |
| |
281 * gtk_webview_activate_anchor: |
| |
282 * @link: The WebKitDOMHTMLAnchorElement object |
| |
283 * |
| 263 * Activates a WebKitDOMHTMLAnchorElement object. This triggers the navigation |
284 * Activates a WebKitDOMHTMLAnchorElement object. This triggers the navigation |
| 264 * signals, and marks the link as visited (when possible). |
285 * signals, and marks the link as visited (when possible). |
| 265 * |
|
| 266 * @link: The WebKitDOMHTMLAnchorElement object |
|
| 267 * |
|
| 268 */ |
286 */ |
| 269 void gtk_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link); |
287 void gtk_webview_activate_anchor(WebKitDOMHTMLAnchorElement *link); |
| 270 |
288 |
| 271 /** |
289 /** |
| 272 * Register a protocol with the GtkWebView widget. Registering a protocol would |
290 * gtk_webview_class_register_protocol: |
| 273 * allow certain text to be clickable. |
|
| 274 * |
|
| 275 * @name: The name of the protocol (e.g. http://) |
291 * @name: The name of the protocol (e.g. http://) |
| 276 * @activate: The callback to trigger when the protocol text is clicked. |
292 * @activate: The callback to trigger when the protocol text is clicked. |
| 277 * Removes any current protocol definition if %NULL. The |
293 * Removes any current protocol definition if %NULL. The |
| 278 * callback should return %TRUE if the link was activated |
294 * callback should return %TRUE if the link was activated |
| 279 * properly, %FALSE otherwise. |
295 * properly, %FALSE otherwise. |
| 280 * @context_menu: The callback to trigger when the context menu is popped |
296 * @context_menu: The callback to trigger when the context menu is popped |
| 281 * up on the protocol text. The callback should return |
297 * up on the protocol text. The callback should return |
| 282 * %TRUE if the request for context menu was processed |
298 * %TRUE if the request for context menu was processed |
| 283 * successfully, %FALSE otherwise. |
299 * successfully, %FALSE otherwise. |
| 284 * |
300 * |
| |
301 * Register a protocol with the GtkWebView widget. Registering a protocol would |
| |
302 * allow certain text to be clickable. |
| |
303 * |
| 285 * Returns: %TRUE if the protocol was successfully registered |
304 * Returns: %TRUE if the protocol was successfully registered |
| 286 * (or unregistered, when \a activate is %NULL) |
305 * (or unregistered, when \a activate is %NULL) |
| 287 */ |
306 */ |
| 288 gboolean gtk_webview_class_register_protocol(const char *name, |
307 gboolean gtk_webview_class_register_protocol(const char *name, |
| 289 gboolean (*activate)(GtkWebView *webview, const char *uri), |
308 gboolean (*activate)(GtkWebView *webview, const char *uri), |
| 290 gboolean (*context_menu)(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu)); |
309 gboolean (*context_menu)(GtkWebView *webview, WebKitDOMHTMLAnchorElement *link, GtkWidget *menu)); |
| 291 |
310 |
| 292 /** |
311 /** |
| |
312 * gtk_webview_get_format_functions: |
| |
313 * @webview: The GtkWebView |
| |
314 * |
| 293 * Returns which formatting functions are enabled in a GtkWebView. |
315 * Returns which formatting functions are enabled in a GtkWebView. |
| 294 * |
316 * |
| 295 * @webview: The GtkWebView |
|
| 296 * |
|
| 297 * Returns: A GtkWebViewButtons bitmask indicating which functions to are enabled |
317 * Returns: A GtkWebViewButtons bitmask indicating which functions to are enabled |
| 298 */ |
318 */ |
| 299 GtkWebViewButtons gtk_webview_get_format_functions(GtkWebView *webview); |
319 GtkWebViewButtons gtk_webview_get_format_functions(GtkWebView *webview); |
| 300 |
320 |
| 301 /** |
321 /** |
| 302 * Sets each boolean to %TRUE or %FALSE to indicate if that formatting |
322 * gtk_webview_get_current_format: |
| 303 * option is enabled at the current position in a GtkWebView. |
|
| 304 * |
|
| 305 * @webview: The GtkWebView |
323 * @webview: The GtkWebView |
| 306 * @bold: The boolean to set for bold or %NULL. |
324 * @bold: The boolean to set for bold or %NULL. |
| 307 * @italic: The boolean to set for italic or %NULL. |
325 * @italic: The boolean to set for italic or %NULL. |
| 308 * @underline: The boolean to set for underline or %NULL. |
326 * @underline: The boolean to set for underline or %NULL. |
| 309 * @strikethrough: The boolean to set for strikethrough or %NULL. |
327 * @strikethrough: The boolean to set for strikethrough or %NULL. |
| |
328 * |
| |
329 * Sets each boolean to %TRUE or %FALSE to indicate if that formatting |
| |
330 * option is enabled at the current position in a GtkWebView. |
| 310 */ |
331 */ |
| 311 void gtk_webview_get_current_format(GtkWebView *webview, gboolean *bold, |
332 void gtk_webview_get_current_format(GtkWebView *webview, gboolean *bold, |
| 312 gboolean *italic, gboolean *underline, |
333 gboolean *italic, gboolean *underline, |
| 313 gboolean *strike); |
334 gboolean *strike); |
| 314 |
335 |
| 315 /** |
336 /** |
| |
337 * gtk_webview_get_current_fontface: |
| |
338 * @webview: The GtkWebView |
| |
339 * |
| 316 * Returns a string containing the selected font face at the current position |
340 * Returns a string containing the selected font face at the current position |
| 317 * in a GtkWebView. |
341 * in a GtkWebView. |
| 318 * |
342 * |
| 319 * @webview: The GtkWebView |
|
| 320 * |
|
| 321 * Returns: A string containing the font face or %NULL if none is set. |
343 * Returns: A string containing the font face or %NULL if none is set. |
| 322 */ |
344 */ |
| 323 char *gtk_webview_get_current_fontface(GtkWebView *webview); |
345 char *gtk_webview_get_current_fontface(GtkWebView *webview); |
| 324 |
346 |
| 325 /** |
347 /** |
| |
348 * gtk_webview_get_current_forecolor: |
| |
349 * @webview: The GtkWebView |
| |
350 * |
| 326 * Returns a string containing the selected foreground color at the current |
351 * Returns a string containing the selected foreground color at the current |
| 327 * position in a GtkWebView. |
352 * position in a GtkWebView. |
| 328 * |
353 * |
| 329 * @webview: The GtkWebView |
|
| 330 * |
|
| 331 * Returns: A string containing the foreground color or %NULL if none is set. |
354 * Returns: A string containing the foreground color or %NULL if none is set. |
| 332 */ |
355 */ |
| 333 char *gtk_webview_get_current_forecolor(GtkWebView *webview); |
356 char *gtk_webview_get_current_forecolor(GtkWebView *webview); |
| 334 |
357 |
| 335 /** |
358 /** |
| |
359 * gtk_webview_get_current_backcolor: |
| |
360 * @webview: The GtkWebView |
| |
361 * |
| 336 * Returns a string containing the selected font background color at the current |
362 * Returns a string containing the selected font background color at the current |
| 337 * position in a GtkWebView. |
363 * position in a GtkWebView. |
| 338 * |
364 * |
| 339 * @webview: The GtkWebView |
|
| 340 * |
|
| 341 * Returns: A string containing the background color or %NULL if none is set. |
365 * Returns: A string containing the background color or %NULL if none is set. |
| 342 */ |
366 */ |
| 343 char *gtk_webview_get_current_backcolor(GtkWebView *webview); |
367 char *gtk_webview_get_current_backcolor(GtkWebView *webview); |
| 344 |
368 |
| 345 /** |
369 /** |
| |
370 * gtk_webview_get_current_fontsize: |
| |
371 * @webview: The GtkWebView |
| |
372 * |
| 346 * Returns a integer containing the selected HTML font size at the current |
373 * Returns a integer containing the selected HTML font size at the current |
| 347 * position in a GtkWebView. |
374 * position in a GtkWebView. |
| 348 * |
375 * |
| 349 * @webview: The GtkWebView |
|
| 350 * |
|
| 351 * Returns: The HTML font size. |
376 * Returns: The HTML font size. |
| 352 */ |
377 */ |
| 353 gint gtk_webview_get_current_fontsize(GtkWebView *webview); |
378 gint gtk_webview_get_current_fontsize(GtkWebView *webview); |
| 354 |
379 |
| 355 /** |
380 /** |
| |
381 * gtk_webview_get_head_html: |
| |
382 * @webview: The GtkWebView |
| |
383 * |
| 356 * Gets the content of the head element of a GtkWebView as HTML. |
384 * Gets the content of the head element of a GtkWebView as HTML. |
| 357 * |
385 * |
| 358 * @webview: The GtkWebView |
|
| 359 * |
|
| 360 * Returns: The HTML from the head element. |
386 * Returns: The HTML from the head element. |
| 361 */ |
387 */ |
| 362 gchar *gtk_webview_get_head_html(GtkWebView *webview); |
388 gchar *gtk_webview_get_head_html(GtkWebView *webview); |
| 363 |
389 |
| 364 /** |
390 /** |
| |
391 * gtk_webview_get_body_html: |
| |
392 * @webview: The GtkWebView |
| |
393 * |
| 365 * Gets the HTML content of a GtkWebView. |
394 * Gets the HTML content of a GtkWebView. |
| 366 * |
395 * |
| 367 * @webview: The GtkWebView |
|
| 368 * |
|
| 369 * Returns: The HTML that is currently displayed. |
396 * Returns: The HTML that is currently displayed. |
| 370 */ |
397 */ |
| 371 gchar *gtk_webview_get_body_html(GtkWebView *webview); |
398 gchar *gtk_webview_get_body_html(GtkWebView *webview); |
| 372 |
399 |
| 373 /** |
400 /** |
| |
401 * gtk_webview_get_body_text: |
| |
402 * @webview: The GtkWebView |
| |
403 * |
| 374 * Gets the text content of a GtkWebView. |
404 * Gets the text content of a GtkWebView. |
| 375 * |
405 * |
| 376 * @webview: The GtkWebView |
|
| 377 * |
|
| 378 * Returns: The HTML-free text that is currently displayed. |
406 * Returns: The HTML-free text that is currently displayed. |
| 379 */ |
407 */ |
| 380 gchar *gtk_webview_get_body_text(GtkWebView *webview); |
408 gchar *gtk_webview_get_body_text(GtkWebView *webview); |
| 381 |
409 |
| 382 /** |
410 /** |
| |
411 * gtk_webview_get_selected_text: |
| |
412 * @webview: The GtkWebView |
| |
413 * |
| 383 * Gets the selected text of a GtkWebView. |
414 * Gets the selected text of a GtkWebView. |
| 384 * |
|
| 385 * @webview: The GtkWebView |
|
| 386 * |
415 * |
| 387 * Returns: The HTML-free text that is currently selected, or NULL if nothing is |
416 * Returns: The HTML-free text that is currently selected, or NULL if nothing is |
| 388 * currently selected. |
417 * currently selected. |
| 389 */ |
418 */ |
| 390 gchar *gtk_webview_get_selected_text(GtkWebView *webview); |
419 gchar *gtk_webview_get_selected_text(GtkWebView *webview); |
| 391 |
420 |
| 392 /** |
421 /** |
| 393 * Gets the container of the caret, along with its position in the container |
422 * gtk_webview_get_caret: |
| 394 * from a GtkWebView. |
|
| 395 * |
|
| 396 * @webview: The GtkWebView |
423 * @webview: The GtkWebView |
| 397 * @container_ret: A pointer to a pointer to a WebKitDOMNode. This pointer |
424 * @container_ret: A pointer to a pointer to a WebKitDOMNode. This pointer |
| 398 * will be set to the container the caret is in. Set to |
425 * will be set to the container the caret is in. Set to |
| 399 * %NULL if a range is selected. |
426 * %NULL if a range is selected. |
| 400 * @pos_ret: A pointer to a glong. This value will be set to the |
427 * @pos_ret: A pointer to a glong. This value will be set to the |
| 401 * position of the caret in the container. Set to -1 if a |
428 * position of the caret in the container. Set to -1 if a |
| 402 * range is selected. |
429 * range is selected. |
| |
430 * |
| |
431 * Gets the container of the caret, along with its position in the container |
| |
432 * from a GtkWebView. |
| 403 */ |
433 */ |
| 404 void gtk_webview_get_caret(GtkWebView *webview, WebKitDOMNode **container_ret, |
434 void gtk_webview_get_caret(GtkWebView *webview, WebKitDOMNode **container_ret, |
| 405 glong *pos_ret); |
435 glong *pos_ret); |
| 406 |
436 |
| 407 /** |
437 /** |
| 408 * Sets the caret position in container, in a GtkWebView. |
438 * gtk_webview_set_caret: |
| 409 * |
|
| 410 * @webview: The GtkWebView |
439 * @webview: The GtkWebView |
| 411 * @container: The WebKitDOMNode to set the caret in |
440 * @container: The WebKitDOMNode to set the caret in |
| 412 * @pos: The position of the caret in the container |
441 * @pos: The position of the caret in the container |
| |
442 * |
| |
443 * Sets the caret position in container, in a GtkWebView. |
| 413 */ |
444 */ |
| 414 void gtk_webview_set_caret(GtkWebView *webview, WebKitDOMNode *container, |
445 void gtk_webview_set_caret(GtkWebView *webview, WebKitDOMNode *container, |
| 415 glong pos); |
446 glong pos); |
| 416 |
447 |
| 417 /** |
448 /** |
| |
449 * gtk_webview_clear_formatting: |
| |
450 * @webview: The GtkWebView |
| |
451 * |
| 418 * Clear all the formatting on a GtkWebView. |
452 * Clear all the formatting on a GtkWebView. |
| 419 * |
|
| 420 * @webview: The GtkWebView |
|
| 421 */ |
453 */ |
| 422 void gtk_webview_clear_formatting(GtkWebView *webview); |
454 void gtk_webview_clear_formatting(GtkWebView *webview); |
| 423 |
455 |
| 424 /** |
456 /** |
| |
457 * gtk_webview_toggle_bold: |
| |
458 * @webview: The GtkWebView |
| |
459 * |
| 425 * Toggles bold at the cursor location or selection in a GtkWebView. |
460 * Toggles bold at the cursor location or selection in a GtkWebView. |
| 426 * |
|
| 427 * @webview: The GtkWebView |
|
| 428 */ |
461 */ |
| 429 void gtk_webview_toggle_bold(GtkWebView *webview); |
462 void gtk_webview_toggle_bold(GtkWebView *webview); |
| 430 |
463 |
| 431 /** |
464 /** |
| |
465 * gtk_webview_toggle_italic: |
| |
466 * @webview: The GtkWebView |
| |
467 * |
| 432 * Toggles italic at the cursor location or selection in a GtkWebView. |
468 * Toggles italic at the cursor location or selection in a GtkWebView. |
| 433 * |
|
| 434 * @webview: The GtkWebView |
|
| 435 */ |
469 */ |
| 436 void gtk_webview_toggle_italic(GtkWebView *webview); |
470 void gtk_webview_toggle_italic(GtkWebView *webview); |
| 437 |
471 |
| 438 /** |
472 /** |
| |
473 * gtk_webview_toggle_underline: |
| |
474 * @webview: The GtkWebView |
| |
475 * |
| 439 * Toggles underline at the cursor location or selection in a GtkWebView. |
476 * Toggles underline at the cursor location or selection in a GtkWebView. |
| 440 * |
|
| 441 * @webview: The GtkWebView |
|
| 442 */ |
477 */ |
| 443 void gtk_webview_toggle_underline(GtkWebView *webview); |
478 void gtk_webview_toggle_underline(GtkWebView *webview); |
| 444 |
479 |
| 445 /** |
480 /** |
| |
481 * gtk_webview_toggle_strike: |
| |
482 * @webview: The GtkWebView |
| |
483 * |
| 446 * Toggles strikethrough at the cursor location or selection in a GtkWebView. |
484 * Toggles strikethrough at the cursor location or selection in a GtkWebView. |
| 447 * |
|
| 448 * @webview: The GtkWebView |
|
| 449 */ |
485 */ |
| 450 void gtk_webview_toggle_strike(GtkWebView *webview); |
486 void gtk_webview_toggle_strike(GtkWebView *webview); |
| 451 |
487 |
| 452 /** |
488 /** |
| |
489 * gtk_webview_toggle_forecolor: |
| |
490 * @webview: The GtkWebView |
| |
491 * @color: The HTML-style color, or %NULL or "" to clear the color. |
| |
492 * |
| 453 * Toggles a foreground color at the current location or selection in a |
493 * Toggles a foreground color at the current location or selection in a |
| 454 * GtkWebView. |
494 * GtkWebView. |
| 455 * |
495 * |
| |
496 * Returns: %TRUE if a color was set, or %FALSE if it was cleared. |
| |
497 */ |
| |
498 gboolean gtk_webview_toggle_forecolor(GtkWebView *webview, const char *color); |
| |
499 |
| |
500 /** |
| |
501 * gtk_webview_toggle_backcolor: |
| 456 * @webview: The GtkWebView |
502 * @webview: The GtkWebView |
| 457 * @color: The HTML-style color, or %NULL or "" to clear the color. |
503 * @color: The HTML-style color, or %NULL or "" to clear the color. |
| 458 * |
504 * |
| 459 * Returns: %TRUE if a color was set, or %FALSE if it was cleared. |
|
| 460 */ |
|
| 461 gboolean gtk_webview_toggle_forecolor(GtkWebView *webview, const char *color); |
|
| 462 |
|
| 463 /** |
|
| 464 * Toggles a background color at the current location or selection in a |
505 * Toggles a background color at the current location or selection in a |
| 465 * GtkWebView. |
506 * GtkWebView. |
| 466 * |
507 * |
| 467 * @webview: The GtkWebView |
|
| 468 * @color: The HTML-style color, or %NULL or "" to clear the color. |
|
| 469 * |
|
| 470 * Returns: %TRUE if a color was set, or %FALSE if it was cleared. |
508 * Returns: %TRUE if a color was set, or %FALSE if it was cleared. |
| 471 */ |
509 */ |
| 472 gboolean gtk_webview_toggle_backcolor(GtkWebView *webview, const char *color); |
510 gboolean gtk_webview_toggle_backcolor(GtkWebView *webview, const char *color); |
| 473 |
511 |
| 474 /** |
512 /** |
| |
513 * gtk_webview_toggle_fontface: |
| |
514 * @webview: The GtkWebView |
| |
515 * @face: The font face name, or %NULL or "" to clear the font. |
| |
516 * |
| 475 * Toggles a font face at the current location or selection in a GtkWebView. |
517 * Toggles a font face at the current location or selection in a GtkWebView. |
| 476 * |
518 * |
| 477 * @webview: The GtkWebView |
|
| 478 * @face: The font face name, or %NULL or "" to clear the font. |
|
| 479 * |
|
| 480 * Returns: %TRUE if a font name was set, or %FALSE if it was cleared. |
519 * Returns: %TRUE if a font name was set, or %FALSE if it was cleared. |
| 481 */ |
520 */ |
| 482 gboolean gtk_webview_toggle_fontface(GtkWebView *webview, const char *face); |
521 gboolean gtk_webview_toggle_fontface(GtkWebView *webview, const char *face); |
| 483 |
522 |
| 484 /** |
523 /** |
| |
524 * gtk_webview_font_set_size: |
| |
525 * @webview: The GtkWebView |
| |
526 * @size: The HTML font size to use. |
| |
527 * |
| 485 * Sets the font size at the current location or selection in a GtkWebView. |
528 * Sets the font size at the current location or selection in a GtkWebView. |
| 486 * |
|
| 487 * @webview: The GtkWebView |
|
| 488 * @size: The HTML font size to use. |
|
| 489 */ |
529 */ |
| 490 void gtk_webview_font_set_size(GtkWebView *webview, gint size); |
530 void gtk_webview_font_set_size(GtkWebView *webview, gint size); |
| 491 |
531 |
| 492 /** |
532 /** |
| |
533 * gtk_webview_font_shrink: |
| |
534 * @webview: The GtkWebView |
| |
535 * |
| 493 * Decreases the font size by 1 at the current location or selection in a |
536 * Decreases the font size by 1 at the current location or selection in a |
| 494 * GtkWebView. |
537 * GtkWebView. |
| 495 * |
|
| 496 * @webview: The GtkWebView |
|
| 497 */ |
538 */ |
| 498 void gtk_webview_font_shrink(GtkWebView *webview); |
539 void gtk_webview_font_shrink(GtkWebView *webview); |
| 499 |
540 |
| 500 /** |
541 /** |
| |
542 * gtk_webview_font_grow: |
| |
543 * @webview: The GtkWebView |
| |
544 * |
| 501 * Increases the font size by 1 at the current location or selection in a |
545 * Increases the font size by 1 at the current location or selection in a |
| 502 * GtkWebView. |
546 * GtkWebView. |
| 503 * |
|
| 504 * @webview: The GtkWebView |
|
| 505 */ |
547 */ |
| 506 void gtk_webview_font_grow(GtkWebView *webview); |
548 void gtk_webview_font_grow(GtkWebView *webview); |
| 507 |
549 |
| 508 /** |
550 /** |
| |
551 * gtk_webview_insert_hr: |
| |
552 * @webview: The GtkWebView |
| |
553 * |
| 509 * Inserts a horizontal rule at the current location or selection in a |
554 * Inserts a horizontal rule at the current location or selection in a |
| 510 * GtkWebView. |
555 * GtkWebView. |
| 511 * |
|
| 512 * @webview: The GtkWebView |
|
| 513 */ |
556 */ |
| 514 void gtk_webview_insert_hr(GtkWebView *webview); |
557 void gtk_webview_insert_hr(GtkWebView *webview); |
| 515 |
558 |
| 516 /** |
559 /** |
| 517 * Inserts a link at the current location or selection in a GtkWebView. |
560 * gtk_webview_insert_link: |
| 518 * |
|
| 519 * @webview: The GtkWebView |
561 * @webview: The GtkWebView |
| 520 * @url: The URL of the link |
562 * @url: The URL of the link |
| 521 * @desc: The text description of the link. If not supplied, the URL is |
563 * @desc: The text description of the link. If not supplied, the URL is |
| 522 * used instead. |
564 * used instead. |
| |
565 * |
| |
566 * Inserts a link at the current location or selection in a GtkWebView. |
| 523 */ |
567 */ |
| 524 void gtk_webview_insert_link(GtkWebView *webview, const char *url, const char *desc); |
568 void gtk_webview_insert_link(GtkWebView *webview, const char *url, const char *desc); |
| 525 |
569 |
| 526 /** |
570 /** |
| |
571 * gtk_webview_insert_image: |
| |
572 * @webview: The GtkWebView |
| |
573 * @id: The PurpleStoredImage id |
| |
574 * |
| 527 * Inserts an image at the current location or selection in a GtkWebView. |
575 * Inserts an image at the current location or selection in a GtkWebView. |
| 528 * |
|
| 529 * @webview: The GtkWebView |
|
| 530 * @id: The PurpleStoredImage id |
|
| 531 */ |
576 */ |
| 532 void gtk_webview_insert_image(GtkWebView *webview, int id); |
577 void gtk_webview_insert_image(GtkWebView *webview, int id); |
| 533 |
578 |
| 534 /** |
579 /** |
| |
580 * gtk_webview_get_protocol_name: |
| |
581 * @webview: The GtkWebView |
| |
582 * |
| 535 * Gets the protocol name associated with this GtkWebView. |
583 * Gets the protocol name associated with this GtkWebView. |
| 536 * |
|
| 537 * @webview: The GtkWebView |
|
| 538 */ |
584 */ |
| 539 const char *gtk_webview_get_protocol_name(GtkWebView *webview); |
585 const char *gtk_webview_get_protocol_name(GtkWebView *webview); |
| 540 |
586 |
| 541 /** |
587 /** |
| 542 * Associates a protocol name with a GtkWebView. |
588 * gtk_webview_set_protocol_name: |
| 543 * |
|
| 544 * @webview: The GtkWebView |
589 * @webview: The GtkWebView |
| 545 * @protocol_name: The protocol name to associate with the GtkWebView |
590 * @protocol_name: The protocol name to associate with the GtkWebView |
| |
591 * |
| |
592 * Associates a protocol name with a GtkWebView. |
| 546 */ |
593 */ |
| 547 void gtk_webview_set_protocol_name(GtkWebView *webview, const char *protocol_name); |
594 void gtk_webview_set_protocol_name(GtkWebView *webview, const char *protocol_name); |
| 548 |
595 |
| 549 /** |
596 /** |
| 550 * Create a new GtkWebViewSmiley. |
597 * gtk_webview_smiley_create: |
| 551 * |
|
| 552 * @file: The image file for the smiley |
598 * @file: The image file for the smiley |
| 553 * @shortcut: The key shortcut for the smiley |
599 * @shortcut: The key shortcut for the smiley |
| 554 * @hide: %TRUE if the smiley should be hidden in the smiley dialog, |
600 * @hide: %TRUE if the smiley should be hidden in the smiley dialog, |
| 555 * %FALSE otherwise |
601 * %FALSE otherwise |
| 556 * @flags: The smiley flags |
602 * @flags: The smiley flags |
| 557 * |
603 * |
| |
604 * Create a new GtkWebViewSmiley. |
| |
605 * |
| 558 * Returns: The newly created smiley |
606 * Returns: The newly created smiley |
| 559 */ |
607 */ |
| 560 GtkWebViewSmiley *gtk_webview_smiley_create(const char *file, |
608 GtkWebViewSmiley *gtk_webview_smiley_create(const char *file, |
| 561 const char *shortcut, |
609 const char *shortcut, |
| 562 gboolean hide, |
610 gboolean hide, |
| 563 GtkWebViewSmileyFlags flags); |
611 GtkWebViewSmileyFlags flags); |
| 564 |
612 |
| 565 /** |
613 /** |
| |
614 * gtk_webview_smiley_reload: |
| |
615 * @smiley: The smiley to reload |
| |
616 * |
| 566 * Reload the image data for the smiley. |
617 * Reload the image data for the smiley. |
| 567 * |
|
| 568 * @smiley: The smiley to reload |
|
| 569 */ |
618 */ |
| 570 void gtk_webview_smiley_reload(GtkWebViewSmiley *smiley); |
619 void gtk_webview_smiley_reload(GtkWebViewSmiley *smiley); |
| 571 |
620 |
| 572 /** |
621 /** |
| |
622 * gtk_webview_smiley_destroy: |
| |
623 * @smiley: The smiley to destroy |
| |
624 * |
| 573 * Destroy a GtkWebViewSmiley. |
625 * Destroy a GtkWebViewSmiley. |
| 574 * |
|
| 575 * @smiley: The smiley to destroy |
|
| 576 */ |
626 */ |
| 577 void gtk_webview_smiley_destroy(GtkWebViewSmiley *smiley); |
627 void gtk_webview_smiley_destroy(GtkWebViewSmiley *smiley); |
| 578 |
628 |
| 579 /** |
629 /** |
| |
630 * gtk_webview_smiley_get_smile: |
| |
631 * @smiley: The smiley |
| |
632 * |
| 580 * Returns the text associated with a smiley. |
633 * Returns the text associated with a smiley. |
| 581 * |
634 * |
| |
635 * Returns: The text |
| |
636 */ |
| |
637 const char *gtk_webview_smiley_get_smile(const GtkWebViewSmiley *smiley); |
| |
638 |
| |
639 /** |
| |
640 * gtk_webview_smiley_get_file: |
| 582 * @smiley: The smiley |
641 * @smiley: The smiley |
| 583 * |
642 * |
| 584 * Returns: The text |
|
| 585 */ |
|
| 586 const char *gtk_webview_smiley_get_smile(const GtkWebViewSmiley *smiley); |
|
| 587 |
|
| 588 /** |
|
| 589 * Returns the file associated with a smiley. |
643 * Returns the file associated with a smiley. |
| 590 * |
644 * |
| |
645 * Returns: The file |
| |
646 */ |
| |
647 const char *gtk_webview_smiley_get_file(const GtkWebViewSmiley *smiley); |
| |
648 |
| |
649 /** |
| |
650 * gtk_webview_smiley_get_hidden: |
| 591 * @smiley: The smiley |
651 * @smiley: The smiley |
| 592 * |
652 * |
| 593 * Returns: The file |
|
| 594 */ |
|
| 595 const char *gtk_webview_smiley_get_file(const GtkWebViewSmiley *smiley); |
|
| 596 |
|
| 597 /** |
|
| 598 * Returns the invisibility of a smiley. |
653 * Returns the invisibility of a smiley. |
| 599 * |
654 * |
| |
655 * Returns: The hidden status |
| |
656 */ |
| |
657 gboolean gtk_webview_smiley_get_hidden(const GtkWebViewSmiley *smiley); |
| |
658 |
| |
659 /** |
| |
660 * gtk_webview_smiley_get_flags: |
| 600 * @smiley: The smiley |
661 * @smiley: The smiley |
| 601 * |
662 * |
| 602 * Returns: The hidden status |
|
| 603 */ |
|
| 604 gboolean gtk_webview_smiley_get_hidden(const GtkWebViewSmiley *smiley); |
|
| 605 |
|
| 606 /** |
|
| 607 * Returns the flags associated with a smiley. |
663 * Returns the flags associated with a smiley. |
| 608 * |
664 * |
| 609 * @smiley: The smiley |
|
| 610 * |
|
| 611 * Returns: The flags |
665 * Returns: The flags |
| 612 */ |
666 */ |
| 613 GtkWebViewSmileyFlags gtk_webview_smiley_get_flags(const GtkWebViewSmiley *smiley); |
667 GtkWebViewSmileyFlags gtk_webview_smiley_get_flags(const GtkWebViewSmiley *smiley); |
| 614 |
668 |
| 615 /** |
669 /** |
| 616 * Returns the smiley object associated with the text. |
670 * gtk_webview_smiley_find: |
| 617 * |
|
| 618 * @webview: The GtkWebView |
671 * @webview: The GtkWebView |
| 619 * @sml: The name of the smiley category |
672 * @sml: The name of the smiley category |
| 620 * @text: The text associated with the smiley |
673 * @text: The text associated with the smiley |
| |
674 * |
| |
675 * Returns the smiley object associated with the text. |
| 621 */ |
676 */ |
| 622 GtkWebViewSmiley *gtk_webview_smiley_find(GtkWebView *webview, const char *sml, |
677 GtkWebViewSmiley *gtk_webview_smiley_find(GtkWebView *webview, const char *sml, |
| 623 const char *text); |
678 const char *text); |
| 624 |
679 |
| 625 /** |
680 /** |
| 626 * Associates a smiley with a GtkWebView. |
681 * gtk_webview_associate_smiley: |
| 627 * |
|
| 628 * @webview: The GtkWebView |
682 * @webview: The GtkWebView |
| 629 * @sml: The name of the smiley category |
683 * @sml: The name of the smiley category |
| 630 * @smiley: The GtkWebViewSmiley to associate |
684 * @smiley: The GtkWebViewSmiley to associate |
| |
685 * |
| |
686 * Associates a smiley with a GtkWebView. |
| 631 */ |
687 */ |
| 632 void gtk_webview_associate_smiley(GtkWebView *webview, const char *sml, |
688 void gtk_webview_associate_smiley(GtkWebView *webview, const char *sml, |
| 633 GtkWebViewSmiley *smiley); |
689 GtkWebViewSmiley *smiley); |
| 634 |
690 |
| 635 /** |
691 /** |
| |
692 * gtk_webview_remove_smileys: |
| |
693 * @webview: The GtkWebView. |
| |
694 * |
| 636 * Removes all smileys associated with a GtkWebView. |
695 * Removes all smileys associated with a GtkWebView. |
| 637 * |
|
| 638 * @webview: The GtkWebView. |
|
| 639 */ |
696 */ |
| 640 void gtk_webview_remove_smileys(GtkWebView *webview); |
697 void gtk_webview_remove_smileys(GtkWebView *webview); |
| 641 |
698 |
| 642 /** |
699 /** |
| 643 * Inserts a smiley at the current location or selection in a GtkWebView. |
700 * gtk_webview_insert_smiley: |
| 644 * |
|
| 645 * @webview: The GtkWebView |
701 * @webview: The GtkWebView |
| 646 * @sml: The category of the smiley |
702 * @sml: The category of the smiley |
| 647 * @smiley: The text of the smiley to insert |
703 * @smiley: The text of the smiley to insert |
| |
704 * |
| |
705 * Inserts a smiley at the current location or selection in a GtkWebView. |
| 648 */ |
706 */ |
| 649 void gtk_webview_insert_smiley(GtkWebView *webview, const char *sml, |
707 void gtk_webview_insert_smiley(GtkWebView *webview, const char *sml, |
| 650 const char *smiley); |
708 const char *smiley); |
| 651 |
709 |
| 652 /** |
710 /** |
| |
711 * gtk_webview_show_toolbar: |
| |
712 * @webview: The GtkWebView. |
| |
713 * |
| 653 * Makes the toolbar associated with a GtkWebView visible. |
714 * Makes the toolbar associated with a GtkWebView visible. |
| 654 * |
715 */ |
| |
716 void gtk_webview_show_toolbar(GtkWebView *webview); |
| |
717 |
| |
718 /** |
| |
719 * gtk_webview_hide_toolbar: |
| 655 * @webview: The GtkWebView. |
720 * @webview: The GtkWebView. |
| 656 */ |
721 * |
| 657 void gtk_webview_show_toolbar(GtkWebView *webview); |
|
| 658 |
|
| 659 /** |
|
| 660 * Makes the toolbar associated with a GtkWebView invisible. |
722 * Makes the toolbar associated with a GtkWebView invisible. |
| 661 * |
|
| 662 * @webview: The GtkWebView. |
|
| 663 */ |
723 */ |
| 664 void gtk_webview_hide_toolbar(GtkWebView *webview); |
724 void gtk_webview_hide_toolbar(GtkWebView *webview); |
| 665 |
725 |
| 666 /** |
726 /** |
| |
727 * gtk_webview_activate_toolbar: |
| |
728 * @webview: The GtkWebView |
| |
729 * @action: The GtkWebViewAction |
| |
730 * |
| 667 * Activate an action on the toolbar associated with a GtkWebView. |
731 * Activate an action on the toolbar associated with a GtkWebView. |
| 668 * |
|
| 669 * @webview: The GtkWebView |
|
| 670 * @action: The GtkWebViewAction |
|
| 671 */ |
732 */ |
| 672 void gtk_webview_activate_toolbar(GtkWebView *webview, GtkWebViewAction action); |
733 void gtk_webview_activate_toolbar(GtkWebView *webview, GtkWebViewAction action); |
| 673 |
734 |
| 674 /* Do not use. */ |
735 /* Do not use. */ |
| 675 void |
736 void |