summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_web_eo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_web_eo.h')
-rw-r--r--src/lib/elementary/elm_web_eo.h603
1 files changed, 602 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_web_eo.h b/src/lib/elementary/elm_web_eo.h
index 33b3f7e..0407b40 100644
--- a/src/lib/elementary/elm_web_eo.h
+++ b/src/lib/elementary/elm_web_eo.h
@@ -1 +1,602 @@
1#include "elm_web.eo.h" \ No newline at end of file 1#ifndef _ELM_WEB_EO_H_
2#define _ELM_WEB_EO_H_
3
4#ifndef _ELM_WEB_EO_CLASS_TYPE
5#define _ELM_WEB_EO_CLASS_TYPE
6
7typedef Eo Elm_Web;
8
9#endif
10
11#ifndef _ELM_WEB_EO_TYPES
12#define _ELM_WEB_EO_TYPES
13
14
15#endif
16/** Elementary web view class
17 *
18 * @ingroup Elm_Web
19 */
20#define ELM_WEB_CLASS elm_web_class_get()
21
22EWAPI const Efl_Class *elm_web_class_get(void);
23
24/**
25 * @brief Sets whether to highlight the matched marks.
26 *
27 * If enabled, marks set with @ref elm_obj_web_text_matches_mark will be
28 * highlighted.
29 *
30 * @param[in] obj The object.
31 * @param[in] highlight Whether to highlight the marks or not.
32 *
33 * @return @c true on success, @c false otherwise
34 *
35 * @ingroup Elm_Web
36 */
37EOAPI Eina_Bool elm_obj_web_text_matches_highlight_set(Eo *obj, Eina_Bool highlight);
38
39/**
40 * @brief Get whether highlighting marks is enabled.
41 *
42 * @param[in] obj The object.
43 *
44 * @return Whether to highlight the marks or not.
45 *
46 * @ingroup Elm_Web
47 */
48EOAPI Eina_Bool elm_obj_web_text_matches_highlight_get(const Eo *obj);
49
50/**
51 * @brief Change useragent of a elm_web object.
52 *
53 * @param[in] obj The object.
54 * @param[in] user_agent String for useragent.
55 *
56 * @ingroup Elm_Web
57 */
58EOAPI void elm_obj_web_useragent_set(Eo *obj, const char *user_agent);
59
60/**
61 * @brief Return current useragent of elm_web object.
62 *
63 * @param[in] obj The object.
64 *
65 * @return String for useragent.
66 *
67 * @ingroup Elm_Web
68 */
69EOAPI const char *elm_obj_web_useragent_get(const Eo *obj);
70
71/**
72 * @brief Sets the URL for the web object.
73 *
74 * It must be a full URL, with resource included, in the form
75 * http://www.enlightenment.org or file:///tmp/something.html
76 *
77 * @param[in] obj The object.
78 * @param[in] url The URL to set.
79 *
80 * @return @c true on success, @c false otherwise
81 *
82 * @ingroup Elm_Web
83 */
84EOAPI Eina_Bool elm_obj_web_url_set(Eo *obj, const char *url);
85
86/**
87 * @brief Get the current URL for the object.
88 *
89 * The returned string must not be freed and is guaranteed to be stringshared.
90 *
91 * @param[in] obj The object.
92 *
93 * @return The URL to set.
94 *
95 * @ingroup Elm_Web
96 */
97EOAPI const char *elm_obj_web_url_get(const Eo *obj);
98
99/**
100 * @brief Sets the background color to be used by the web object.
101 *
102 * This is the color that will be used by default when the loaded page does not
103 * set it's own. Color values are pre-multiplied.
104 *
105 * @param[in] obj The object.
106 * @param[in] r Red component.
107 * @param[in] g Green component.
108 * @param[in] b Blue component.
109 * @param[in] a Alpha component.
110 *
111 * @ingroup Elm_Web
112 */
113EOAPI void elm_obj_web_bg_color_set(Eo *obj, int r, int g, int b, int a);
114
115/**
116 * @brief Get the background color to be used by the web object.
117 *
118 * This is the color that will be used by default when the loaded page does not
119 * set it's own. Color values are pre-multiplied.
120 *
121 * @param[in] obj The object.
122 * @param[out] r Red component.
123 * @param[out] g Green component.
124 * @param[out] b Blue component.
125 * @param[out] a Alpha component.
126 *
127 * @ingroup Elm_Web
128 */
129EOAPI void elm_obj_web_bg_color_get(const Eo *obj, int *r, int *g, int *b, int *a);
130
131/**
132 * @brief Sets the default dialogs to use an Inwin instead of a normal window.
133 *
134 * If set, then the default implementation for the JavaScript dialogs and file
135 * selector will be opened in an Inwin. Otherwise they will use a normal
136 * separated window.
137 *
138 * @param[in] obj The object.
139 * @param[in] value @c true if dialog will be opened as Inwin, @c false
140 * otherwise
141 *
142 * @ingroup Elm_Web
143 */
144EOAPI void elm_obj_web_inwin_mode_set(Eo *obj, Eina_Bool value);
145
146/**
147 * @brief Get whether Inwin mode is set for the current object.
148 *
149 * @param[in] obj The object.
150 *
151 * @return @c true if dialog will be opened as Inwin, @c false otherwise
152 *
153 * @ingroup Elm_Web
154 */
155EOAPI Eina_Bool elm_obj_web_inwin_mode_get(const Eo *obj);
156
157/**
158 * @brief Sets whether to use tab propagation.
159 *
160 * If tab propagation is enabled, whenever the user presses the Tab key,
161 * Elementary will handle it and switch focus to the next widget. The default
162 * value is disabled, where WebKit will handle the Tab key to cycle focus
163 * though its internal objects, jumping to the next widget only when that cycle
164 * ends.
165 *
166 * @param[in] obj The object.
167 * @param[in] propagate Whether to propagate Tab keys to Elementary or not.
168 *
169 * @ingroup Elm_Web
170 */
171EOAPI void elm_obj_web_tab_propagate_set(Eo *obj, Eina_Bool propagate);
172
173/**
174 * @brief Get the status of the tab propagation.
175 *
176 * @param[in] obj The object.
177 *
178 * @return Whether to propagate Tab keys to Elementary or not.
179 *
180 * @ingroup Elm_Web
181 */
182EOAPI Eina_Bool elm_obj_web_tab_propagate_get(const Eo *obj);
183
184/**
185 * @brief Enables or disables the browsing history.
186 *
187 * @param[in] obj The object.
188 * @param[in] enable Whether to enable or disable the browsing history.
189 *
190 * @ingroup Elm_Web
191 */
192EOAPI void elm_obj_web_history_enabled_set(Eo *obj, Eina_Bool enable);
193
194/**
195 * @brief Get whether browsing history is enabled for the given object.
196 *
197 * @param[in] obj The object.
198 *
199 * @return Whether to enable or disable the browsing history.
200 *
201 * @ingroup Elm_Web
202 */
203EOAPI Eina_Bool elm_obj_web_history_enabled_get(const Eo *obj);
204
205/**
206 * @brief Sets the function to call when a console message is emitted from JS.
207 *
208 * This hook will be called when a console message is emitted from JavaScript.
209 * There is no default implementation for this feature.
210 *
211 * @param[in] obj The object.
212 * @param[in] func The callback function to be used.
213 * @param[in] data User data.
214 *
215 * @ingroup Elm_Web
216 */
217EOAPI void elm_obj_web_console_message_hook_set(Eo *obj, Elm_Web_Console_Message func, void *data);
218
219/**
220 * @brief Sets the function to call when a new window is requested.
221 *
222 * This hook will be called when a request to create a new window is issued
223 * from the web page loaded. There is no default implementation for this
224 * feature, so leaving this unset or passing @c null in @c func will prevent
225 * new windows from opening.
226 *
227 * @param[in] obj The object.
228 * @param[in] func The hook function to be called when a window is requested.
229 * @param[in] data User data.
230 *
231 * @ingroup Elm_Web
232 */
233EOAPI void elm_obj_web_window_create_hook_set(Eo *obj, Elm_Web_Window_Open func, void *data);
234
235/**
236 * @brief Sets the function to call when an file selector dialog.
237 *
238 * This hook will be called when a JavaScript file selector dialog is
239 * requested. If no function is set or @c null is passed in @c func, the
240 * default implementation will take place.
241 *
242 * @param[in] obj The object.
243 * @param[in] func The callback function to be used.
244 * @param[in] data User data.
245 *
246 * @ingroup Elm_Web
247 */
248EOAPI void elm_obj_web_dialog_file_selector_hook_set(Eo *obj, Elm_Web_Dialog_File_Selector func, void *data);
249
250/**
251 * @brief Sets the function to call when an confirm dialog.
252 *
253 * This hook will be called when a JavaScript confirm dialog is requested. If
254 * no function is set or @c null is passed in @c func, the default
255 * implementation will take place.
256 *
257 * @param[in] obj The object.
258 * @param[in] func The callback function to be used.
259 * @param[in] data User data.
260 *
261 * @ingroup Elm_Web
262 */
263EOAPI void elm_obj_web_dialog_confirm_hook_set(Eo *obj, Elm_Web_Dialog_Confirm func, void *data);
264
265/**
266 * @brief Tells the web object which index in the currently open popup was
267 * selected.
268 *
269 * When the user handles the popup creation from the "popup,created" signal, it
270 * needs to tell the web object which item was selected by calling this
271 * function with the index corresponding to the item.
272 *
273 * @param[in] obj The object.
274 * @param[in] idx The index selected.
275 *
276 * @ingroup Elm_Web
277 */
278EOAPI void elm_obj_web_popup_selected_set(Eo *obj, int idx);
279
280/**
281 * @brief Sets the function to call when an prompt dialog.
282 *
283 * This hook will be called when a JavaScript prompt dialog is requested. If no
284 * function is set or @c null is passed in @c func, the default implementation
285 * will take place.
286 *
287 * @param[in] obj The object.
288 * @param[in] func The callback function to be used.
289 * @param[in] data User data.
290 *
291 * @ingroup Elm_Web
292 */
293EOAPI void elm_obj_web_dialog_prompt_hook_set(Eo *obj, Elm_Web_Dialog_Prompt func, void *data);
294
295/**
296 * @brief Sets the function to call when an alert dialog.
297 *
298 * This hook will be called when a JavaScript alert dialog is requested. If no
299 * function is set or @c null is passed in @c func, the default implementation
300 * will take place.
301 *
302 * @param[in] obj The object.
303 * @param[in] func Callback function to be used.
304 * @param[in] data User data.
305 *
306 * @ingroup Elm_Web
307 */
308EOAPI void elm_obj_web_dialog_alert_hook_set(Eo *obj, Elm_Web_Dialog_Alert func, void *data);
309
310/**
311 * @brief Queries whether it's possible to go forward in history.
312 *
313 * @param[in] obj The object.
314 *
315 * @return @c true if it is possible to go forward, @c false otherwise
316 *
317 * @ingroup Elm_Web
318 */
319EOAPI Eina_Bool elm_obj_web_forward_possible_get(const Eo *obj);
320
321/**
322 * @brief Get internal ewk_view object from web object.
323 *
324 * Elementary may not provide some low level features of EWebKit, instead of
325 * cluttering the API with proxy methods we opted to return the internal
326 * reference. Be careful using it as it may interfere with elm_web behavior.
327 *
328 * @param[in] obj The object.
329 *
330 * @return The internal ewk_view object or @c null if it does not exist.
331 * (Failure to create or Elementary compiled without ewebkit)
332 *
333 * @ingroup Elm_Web
334 */
335EOAPI Efl_Canvas_Object *elm_obj_web_webkit_view_get(const Eo *obj);
336
337/**
338 * @brief Queries whether it's possible to go back in history.
339 *
340 * @param[in] obj The object.
341 *
342 * @return @c true if it is possible to go back, @c false otherwise
343 *
344 * @ingroup Elm_Web
345 */
346EOAPI Eina_Bool elm_obj_web_back_possible_get(const Eo *obj);
347
348/**
349 * @brief Get the overall loading progress of the page.
350 *
351 * Returns the estimated loading progress of the page, with a value between 0.0
352 * and 1.0. This is an estimated progress accounting for all the frames
353 * included in the page.
354 *
355 * @param[in] obj The object.
356 *
357 * @return A value between 0.0 and 1.0 indicating the progress, or -1.0 on
358 * failure.
359 *
360 * @ingroup Elm_Web
361 */
362EOAPI double elm_obj_web_load_progress_get(const Eo *obj);
363
364/**
365 * @brief Get a copy of the currently selected text.
366 *
367 * The string returned must be freed by the user when it's done with it.
368 *
369 * @param[in] obj The object.
370 *
371 * @return A newly allocated string, or @c null if nothing is selected or an
372 * error occurred.
373 *
374 * @ingroup Elm_Web
375 */
376EOAPI char *elm_obj_web_selection_get(const Eo *obj) EINA_WARN_UNUSED_RESULT;
377
378/**
379 * @brief Get the current title.
380 *
381 * The returned string must not be freed and is guaranteed to be stringshared.
382 *
383 * @param[in] obj The object.
384 *
385 * @return A stringshared internal string with the current title, or @c null on
386 * failure.
387 *
388 * @ingroup Elm_Web
389 */
390EOAPI Eina_Stringshare *elm_obj_web_title_get(const Eo *obj) EINA_WARN_UNUSED_RESULT;
391
392/**
393 * @brief Jumps the given number of steps in the browsing history.
394 *
395 * The @c steps value can be a negative integer to back in history, or a
396 * positive to move forward.
397 *
398 * @param[in] obj The object.
399 * @param[in] steps The number of steps to jump.
400 *
401 * @return @c true on success, @c false on error or if not enough history
402 * exists to jump the given number of steps
403 *
404 * @ingroup Elm_Web
405 */
406EOAPI Eina_Bool elm_obj_web_navigate(Eo *obj, int steps);
407
408/**
409 * @brief Goes back one step in the browsing history.
410 *
411 * This is equivalent to calling elm_web_object_navigate(obj, -1);
412 *
413 * @param[in] obj The object.
414 *
415 * @return @c true on success, @c false otherwise
416 *
417 * @ingroup Elm_Web
418 */
419EOAPI Eina_Bool elm_obj_web_back(Eo *obj);
420
421/**
422 * @brief Loads the specified @c html string as the content of the web object.
423 *
424 * External objects such as stylesheets or images referenced in the HTML
425 * document are located relative to @c base_url.
426 *
427 * If an @c unreachable_url is passed it is used as the url for the loaded
428 * content. This is typically used to display error pages for a failed load.
429 *
430 * @param[in] obj The object.
431 * @param[in] html HTML data to load.
432 * @param[in] base_url Base URL used for relative paths to external objects
433 * (optional).
434 * @param[in] unreachable_url URL that could not be reached (optional).
435 *
436 * @return @c true on success, @c false otherwise
437 *
438 * @since 1.9
439 *
440 * @ingroup Elm_Web
441 */
442EOAPI Eina_Bool elm_obj_web_html_string_load(Eo *obj, const char *html, const char *base_url, const char *unreachable_url);
443
444/**
445 * @brief Searches the given string in a document.
446 *
447 * @param[in] obj The object.
448 * @param[in] string String to search.
449 * @param[in] case_sensitive If search should be case sensitive or not.
450 * @param[in] forward If search is from cursor and on or backwards.
451 * @param[in] wrap If search should wrap at the end.
452 *
453 * @return @c true if the given string was found, @c false if not or failure.
454 *
455 * @ingroup Elm_Web
456 */
457EOAPI Eina_Bool elm_obj_web_text_search(const Eo *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
458
459/**
460 * @brief Dismisses an open dropdown popup
461 *
462 * When the popup from a dropdown widget is to be dismissed, either after
463 * selecting an option or to cancel it, this function must be called, which
464 * will later emit an "popup,willdelete" signal to notify the user that any
465 * memory and objects related to this popup can be freed.
466 *
467 * @param[in] obj The object.
468 *
469 * @return @c true if the menu was successfully destroyed, or @c false if there
470 * was no menu to destroy.
471 *
472 * @ingroup Elm_Web
473 */
474EOAPI Eina_Bool elm_obj_web_popup_destroy(Eo *obj);
475
476/**
477 * @brief Shows the given region in the web object.
478 *
479 * @param[in] obj The object.
480 * @param[in] x The x coordinate of the region to show.
481 * @param[in] y The y coordinate of the region to show.
482 * @param[in] w The width of the region to show.
483 * @param[in] h The height of the region to show.
484 *
485 * @ingroup Elm_Web
486 */
487EOAPI void elm_obj_web_region_show(Eo *obj, int x, int y, int w, int h);
488
489/**
490 * @brief Goes forward one step in the browsing history.
491 *
492 * This is equivalent to calling elm_web_object_navigate(obj, 1);
493 *
494 * See also @ref elm_obj_web_history_enabled_set,
495 * @ref elm_obj_web_forward_possible_get, @ref elm_obj_web_back,
496 * @ref elm_obj_web_navigate.
497 *
498 * @param[in] obj The object.
499 *
500 * @return @c true on success, @c false otherwise.
501 *
502 * @ingroup Elm_Web
503 */
504EOAPI Eina_Bool elm_obj_web_forward(Eo *obj);
505
506/**
507 * @brief Marks matches of the given string in a document.
508 *
509 * @param[in] obj The object.
510 * @param[in] string String to match.
511 * @param[in] case_sensitive If match should be case sensitive or not.
512 * @param[in] highlight If matches should be highlighted.
513 * @param[in] limit Maximum amount of matches, or zero to unlimited.
514 *
515 * @return Number of matched @c string.
516 *
517 * @ingroup Elm_Web
518 */
519EOAPI unsigned int elm_obj_web_text_matches_mark(Eo *obj, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
520
521/**
522 * @brief Brings in the region to the visible area.
523 *
524 * Like @ref elm_obj_web_region_show, but it animates the scrolling of the
525 * object to show the area.
526 *
527 * @param[in] obj The object.
528 * @param[in] x The x coordinate of the region to show.
529 * @param[in] y The y coordinate of the region to show.
530 * @param[in] w The width of the region to show.
531 * @param[in] h The height of the region to show.
532 *
533 * @ingroup Elm_Web
534 */
535EOAPI void elm_obj_web_region_bring_in(Eo *obj, int x, int y, int w, int h);
536
537/**
538 * @brief Stops loading the current page.
539 *
540 * Cancels the loading of the current page in the web object. This will cause a
541 * "load,error" signal to be emitted, with the is_cancellation flag set to
542 * @c true.
543 *
544 * @param[in] obj The object.
545 *
546 * @return @c true if the cancel was successful, @c false otherwise.
547 *
548 * @ingroup Elm_Web
549 */
550EOAPI Eina_Bool elm_obj_web_stop(Eo *obj);
551
552/**
553 * @brief Queries whether it's possible to jump the given number of steps.
554 *
555 * The @c steps value can be a negative integer to back in history, or positive
556 * to move forward.
557 *
558 * @param[in] obj The object.
559 * @param[in] steps The number of steps to check for.
560 *
561 * @return @c true if enough history exists to perform the given jump, @c false
562 * otherwise.
563 *
564 * @ingroup Elm_Web
565 */
566EOAPI Eina_Bool elm_obj_web_navigate_possible_get(Eo *obj, int steps);
567
568/**
569 * @brief Requests a reload of the current document, avoiding any existing
570 * caches.
571 *
572 * @param[in] obj The object.
573 *
574 * @return @c true on success, @c false otherwise.
575 *
576 * @ingroup Elm_Web
577 */
578EOAPI Eina_Bool elm_obj_web_reload_full(Eo *obj);
579
580/**
581 * @brief Clears all marked matches in the document.
582 *
583 * @param[in] obj The object.
584 *
585 * @return @c true on success, @c false otherwise.
586 *
587 * @ingroup Elm_Web
588 */
589EOAPI Eina_Bool elm_obj_web_text_matches_unmark_all(Eo *obj);
590
591/**
592 * @brief Requests a reload of the current document in the object.
593 *
594 * @param[in] obj The object.
595 *
596 * @return @c true on success, @c false otherwise.
597 *
598 * @ingroup Elm_Web
599 */
600EOAPI Eina_Bool elm_obj_web_reload(Eo *obj);
601
602#endif