Home | History | Annotate | Download | only in ewk
      1 /*
      2     Copyright (C) 2009-2010 ProFUSION embedded systems
      3     Copyright (C) 2009-2010 Samsung Electronics
      4 
      5     This library is free software; you can redistribute it and/or
      6     modify it under the terms of the GNU Library General Public
      7     License as published by the Free Software Foundation; either
      8     version 2 of the License, or (at your option) any later version.
      9 
     10     This library is distributed in the hope that it will be useful,
     11     but WITHOUT ANY WARRANTY; without even the implied warranty of
     12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13     Library General Public License for more details.
     14 
     15     You should have received a copy of the GNU Library General Public License
     16     along with this library; see the file COPYING.LIB.  If not, write to
     17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     18     Boston, MA 02110-1301, USA.
     19 */
     20 
     21 /**
     22  * @file    ewk_private.h
     23  * @brief   Private methods of WebKit-EFL.
     24  */
     25 
     26 #ifndef ewk_private_h
     27 #define ewk_private_h
     28 
     29 #include "BackForwardListImpl.h"
     30 #include "EWebKit.h"
     31 #include "Frame.h"
     32 #include "Page.h"
     33 #include "Settings.h"
     34 #include "Widget.h"
     35 #include "ewk_logging.h"
     36 #include "ewk_util.h"
     37 
     38 #include <cairo.h>
     39 #include <wtf/PassRefPtr.h>
     40 #include <wtf/Vector.h>
     41 
     42 #ifdef __cplusplus
     43 extern "C" {
     44 #endif
     45 
     46 // If defined, ewk will do type checking to ensure objects are of correct type
     47 #define EWK_TYPE_CHECK 1
     48 
     49 // forward declarations
     50 namespace WebCore {
     51 struct PopupMenuClient;
     52 struct ContextMenu;
     53 struct ContextMenuItem;
     54 }
     55 
     56 void ewk_view_ready(Evas_Object *o);
     57 void ewk_view_input_method_state_set(Evas_Object* o, Eina_Bool active);
     58 void ewk_view_title_set(Evas_Object *o, const char *title);
     59 void ewk_view_uri_changed(Evas_Object *o);
     60 void ewk_view_load_started(Evas_Object *o);
     61 void ewk_view_load_provisional(Evas_Object *o);
     62 void ewk_view_frame_main_load_started(Evas_Object *o);
     63 void ewk_view_frame_main_cleared(Evas_Object *o);
     64 void ewk_view_frame_main_icon_received(Evas_Object *o);
     65 void ewk_view_load_finished(Evas_Object *o, const Ewk_Frame_Load_Error *error);
     66 void ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error);
     67 void ewk_view_load_progress_changed(Evas_Object *o);
     68 void ewk_view_load_show(Evas_Object* o);
     69 void ewk_view_restore_state(Evas_Object *o, Evas_Object *frame);
     70 Evas_Object *ewk_view_window_create(Evas_Object *o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures);
     71 void ewk_view_window_close(Evas_Object *o);
     72 
     73 void ewk_view_mouse_link_hover_in(Evas_Object *o, void *data);
     74 void ewk_view_mouse_link_hover_out(Evas_Object *o);
     75 
     76 void ewk_view_toolbars_visible_set(Evas_Object *o, Eina_Bool visible);
     77 void ewk_view_toolbars_visible_get(Evas_Object *o, Eina_Bool *visible);
     78 
     79 void ewk_view_statusbar_visible_set(Evas_Object *o, Eina_Bool visible);
     80 void ewk_view_statusbar_visible_get(Evas_Object *o, Eina_Bool *visible);
     81 void ewk_view_statusbar_text_set(Evas_Object *o, const char *text);
     82 
     83 void ewk_view_scrollbars_visible_set(Evas_Object *o, Eina_Bool visible);
     84 void ewk_view_scrollbars_visible_get(Evas_Object *o, Eina_Bool *visible);
     85 
     86 void ewk_view_menubar_visible_set(Evas_Object *o, Eina_Bool visible);
     87 void ewk_view_menubar_visible_get(Evas_Object *o, Eina_Bool *visible);
     88 
     89 void ewk_view_tooltip_text_set(Evas_Object *o, const char *text);
     90 
     91 void ewk_view_add_console_message(Evas_Object *o, const char *message, unsigned int lineNumber, const char *sourceID);
     92 
     93 void ewk_view_run_javascript_alert(Evas_Object *o, Evas_Object *frame, const char *message);
     94 Eina_Bool ewk_view_run_javascript_confirm(Evas_Object *o, Evas_Object *frame, const char *message);
     95 Eina_Bool ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *frame, const char *message, const char *defaultValue, char **value);
     96 Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object *o);
     97 uint64_t ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
     98 
     99 Eina_Bool ewk_view_run_open_panel(Evas_Object *o, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
    100 
    101 void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
    102 void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame);
    103 WebCore::Page *ewk_view_core_page_get(const Evas_Object *o);
    104 
    105 WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Object *frame, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WTF::String& referrer);
    106 
    107 WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually);
    108 
    109 void ewk_view_popup_new(Evas_Object *o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect);
    110 void ewk_view_viewport_attributes_set(Evas_Object *o, const WebCore::ViewportArguments& arguments);
    111 
    112 void ewk_view_download_request(Evas_Object *o, Ewk_Download *download);
    113 
    114 int ewk_view_dpi_get(void);
    115 
    116 #if ENABLE(TOUCH_EVENTS)
    117 void ewk_view_need_touch_events_set(Evas_Object*, bool needed);
    118 Eina_Bool ewk_view_need_touch_events_get(Evas_Object*);
    119 #endif
    120 
    121 Ewk_History *ewk_history_new(WebCore::BackForwardListImpl *history);
    122 void ewk_history_free(Ewk_History *history);
    123 
    124 #if ENABLE(CONTEXT_MENUS)
    125 
    126 Ewk_Context_Menu *ewk_context_menu_new(Evas_Object *view, WebCore::ContextMenuController *controller);
    127 Eina_Bool ewk_context_menu_free(Ewk_Context_Menu *o);
    128 void ewk_context_menu_item_append(Ewk_Context_Menu *o, WebCore::ContextMenuItem& core);
    129 Ewk_Context_Menu *ewk_context_menu_custom_get(Ewk_Context_Menu *o);
    130 void ewk_context_menu_show(Ewk_Context_Menu *o);
    131 
    132 #endif
    133 
    134 Ewk_Window_Features *ewk_window_features_new_from_core(const WebCore::WindowFeatures* core);
    135 
    136 Evas_Object *ewk_frame_add(Evas *e);
    137 Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame);
    138 Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String& name, const WebCore::KURL& url, const WTF::String& referrer);
    139 
    140 WebCore::Frame *ewk_frame_core_get(const Evas_Object *o);
    141 void ewk_frame_core_gone(Evas_Object *o);
    142 
    143 void ewk_frame_load_started(Evas_Object *o);
    144 void ewk_frame_load_provisional(Evas_Object *o);
    145 void ewk_frame_load_firstlayout_finished(Evas_Object *o);
    146 void ewk_frame_load_firstlayout_nonempty_finished(Evas_Object *o);
    147 void ewk_frame_load_document_finished(Evas_Object *o);
    148 void ewk_frame_load_finished(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url);
    149 void ewk_frame_load_error(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url);
    150 void ewk_frame_load_progress_changed(Evas_Object *o);
    151 
    152 void ewk_frame_request_will_send(Evas_Object *o, Ewk_Frame_Resource_Request *request);
    153 void ewk_frame_request_assign_identifier(Evas_Object *o, const Ewk_Frame_Resource_Request *request);
    154 void ewk_frame_view_state_save(Evas_Object *o, WebCore::HistoryItem* item);
    155 
    156 void ewk_frame_did_perform_first_navigation(Evas_Object *o);
    157 
    158 void ewk_frame_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h);
    159 void ewk_frame_title_set(Evas_Object *o, const char *title);
    160 
    161 void ewk_frame_view_create_for_view(Evas_Object *o, Evas_Object *view);
    162 Eina_Bool ewk_frame_uri_changed(Evas_Object *o);
    163 void ewk_frame_force_layout(Evas_Object *o);
    164 
    165 WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually);
    166 
    167 Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request);
    168 
    169 void ewk_view_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h);
    170 
    171 WebCore::FloatRect ewk_view_page_rect_get(Evas_Object *o);
    172 
    173 const char* ewk_settings_default_user_agent_get(void);
    174 
    175 #ifdef __cplusplus
    176 
    177 }
    178 #endif
    179 #endif // ewk_private_h
    180