browser-eal/include/gweb.h

Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the EAL package.
00015  *
00016  * The Initial Developer of the Original Code is Nokia Corporation.
00017  * Portions created by the Initial Developer are Copyright (C) 2005
00018  * the Initial Developer. All Rights Reserved.
00019  *
00020  * Contact: Leonid Zolotarev <leonid.zolotarev@nokia.com>
00021  *
00022  * ***** END LICENSE BLOCK ***** */
00023 
00024 #include <glib-object.h>
00025 #include "gwebengine.h"
00026 #include "gwebtransferitem.h"
00027 #include "gwebhistorylist.h"
00028 #include "gwebpluginlist.h"
00029 #include "gwebtransferitemlist.h"
00030 #include "gwebpassman.h"
00031 
00032 #ifndef __GWEB_H__
00033 #define __GWEB_H__
00034 
00035 G_BEGIN_DECLS
00036 
00040 typedef enum
00041 {
00042         G_ACCEPT_COOKIE_ALWAYS = 0, 
00043         G_ACCEPT_COOKIE_PROMPT,     
00044         G_ACCEPT_COOKIE_NEVER       
00045 } GCookieAcceptance;
00046 
00050 typedef enum
00051 {
00052         G_ACCEPT_POPUP_ALWAYS = 0, 
00053         G_ACCEPT_POPUP_PROMPT,     
00054         G_ACCEPT_POPUP_NEVER       
00055 } GPopupAcceptance;
00056 
00057 typedef enum
00058 {
00059         G_CALLBACK_NO_ACTION = 0,
00060         G_CALLBACK_OOM_ACTION = 1,
00061         G_CALLBACK_RESET_ACTION = 2
00062 } GCallbackAction;
00063 
00064 
00068 typedef enum
00069 {
00070         G_MEMORY_CACHE_AUTOMATIC = 0, 
00071         G_MEMORY_CACHE_LARGE,         
00072         G_MEMORY_CACHE_MEDIUM,        
00073         G_MEMORY_CACHE_DEFAULT,       
00074         G_MEMORY_CACHE_SMALL,         
00075         G_MEMORY_CACHE_OFF            
00076 } GMemoryCache;
00077 
00081 #define G_TYPE_WEB             (g_web_get_type ())
00082 #define G_WEB(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_WEB, GWeb))
00083 #define G_WEB_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), G_TYPE_WEB, GWebIface))
00084 #define G_IS_WEB(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_WEB))
00085 #define G_IS_WEB_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), G_TYPE_WEB))
00086 #define G_WEB_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_WEB, GWebIface))
00087 
00088 typedef struct _GWeb GWeb; /* dummy object */
00089 typedef struct _GWebIface GWebIface;
00090 
00094 struct _GWebIface {
00095         GTypeInterface parent;
00096 
00097         void (*destroy) (GWeb *self);
00098     GWebEngine* (*new_web_engine_window) (GWeb *self);
00099     GWebEngine* (*new_web_engine_window_with_context) (GWeb *self, gpointer context, gboolean leave_tracks, gboolean without_history);
00100 
00101     gboolean (*web_set_pref) (GWeb *self, gpointer type, const gchar* name, gpointer value);
00102     gboolean (*web_get_pref) (GWeb *self, gpointer type, const gchar* name, gpointer value);
00103     
00104     GWebTransferItem* (*new_web_transfer_item) (GWeb *self, const gchar* url, const gchar* filename);
00105     GWebTransferItem* (*initialize_web_transfer_item) (GWeb *self, GObject *web_transfer_item);
00106     GWebTransferItemList* (*get_web_transfer_item_list) (GWeb *self);
00107     GWebStatus (*set_home_page) (GWeb *self, const gchar* home_page);
00108     gchar* (*get_home_page) (GWeb *self);
00109     GWebStatus (*set_language) (GWeb *self, const gchar* language);
00110     void (*reset_cache_history_length) (GWeb *self);
00111     gchar* (*get_language) (GWeb *self);
00112     gint (*get_maximum_cache_size) (GWeb *self);
00113     GWebStatus (*set_default_home_page) (GWeb *self, const gchar* default_page);
00114     gchar* (*get_default_home_page) (GWeb *self);
00115     gboolean (*home_page_set) (GWeb *self);
00116     void (*set_frame_borders_enabled) (GWeb *self, gboolean enabled);
00117     gboolean (*get_frame_borders_enabled) (GWeb *self);
00118     GWebStatus (*set_location_completion_suffixes) (GWeb *self, const gchar* suffixes);
00119     gchar* (*get_location_completion_suffixes) (GWeb *self);
00120     GWebStatus (*set_plugins_enabled) (GWeb *self, gboolean enabled);
00121     GWebStatus (*set_oom_cb) (GWeb *self, GFunc func);
00122     GWebStatus (*set_ssl2_support) (GWeb *self, gboolean enabled);
00123     gboolean (*get_ssl2_support) (GWeb *self);
00124     gboolean (*get_plugins_enabled) (GWeb *self);
00125     GWebStatus (*set_js_enabled) (GWeb *self, gboolean enabled);
00126     gboolean (*get_js_enabled) (GWeb *self);
00127     void (*set_memory_cache) (GWeb *self, GMemoryCache acceptance);
00128     GMemoryCache (*get_memory_cache) (GWeb *self);
00129     GWebStatus (*set_cache_size) (GWeb *self, gint size);
00130     gint (*get_cache_size) (GWeb *self);
00131     GWebStatus (*set_browse_offline) (GWeb *self, gboolean offline);
00132     gboolean (*get_browse_offline) (GWeb *self);
00133     GWebStatus (*set_automatic_redirection_enabled) (GWeb *self, gboolean enabled);
00134     gboolean (*get_automatic_redirection_enabled) (GWeb *self);
00135         GWebStatus (*set_load_images) (GWeb *self, GWebEngineImagePolicy level);
00136         GWebEngineImagePolicy (*get_load_images) (GWeb *self); 
00137     void (*disconnect) (GWeb *self);
00138     GWebStatus (*clear_cache) (GWeb *self);
00139     GWebPluginList* (*get_plugins_list) (GWeb *self);
00140     GWebHistoryList* (*get_history_list) (GWeb *self);
00141     GWebStatus (*set_new_window_loads) (GWeb *self, gboolean loads);
00142     gboolean (*get_new_window_loads) (GWeb *self);
00143     void (*set_cookie_acceptance) (GWeb *self, GCookieAcceptance acceptance);
00144     GCookieAcceptance (*get_cookie_acceptance) (GWeb *self);
00145     void (*set_popup_acceptance) (GWeb *self, GPopupAcceptance acceptance);
00146     GPopupAcceptance (*get_popup_acceptance) (GWeb *self);
00147     GWebStatus (*suspend) (GWeb *self);
00148     gboolean (*suspended) (GWeb *self);
00149     void (*resume) (GWeb *self);
00150     void (*set_ua_string) (GWeb *self, gchar *ua_string);
00151     GWebStatus (*set_user_agent_id) (GWeb *self, gint ua_id);
00152     gint (*get_user_agent_id) (GWeb *self);
00153     void (*enable_url_loading) (GWeb *self, gboolean enable);
00154     void (*free_memory) (GWeb *self, gboolean progressive);
00155     GWebStatus (*store_transfers) (GWeb *self);
00156     GWebStatus (*restore_transfers) (GWeb *self);
00157     GWebStatus (*delete_all_cookies) (GWeb *self);
00158     GWebStatus (*confirm_cookie) (GWeb *self, gpointer context, gboolean accept, GWebCookieAction action);
00159     GObject* (*get_global) (GWeb *self);
00160     GWebCertificateMessage (*get_certificate_enum_message) (GWeb *self, GObject *context);
00161     gint (*username_matchinfo_get_matches) (GWeb *self, GObject *info);
00162     void (*username_matchinfo_delete) (GWeb *self, GObject *info, gint index);
00163     GWebStatus (*username_matchinfo_get_username) (GWeb *self, GObject *info, gint index, gchar** username);
00164     GWebPasswordManager* (*get_password_manager) (GWeb *self, const gchar* server, gint index);
00165     GWebStatus (*store_personal_data)(GWeb *self, const gchar* server, const gchar* username, const gchar* password);
00166     GWebStatus (*delete_personal_data)(GWeb *self, const gchar* server, const gchar* username);
00167     GWebCertificateReaction (*perform_crtificate_context_action) (GWeb *self,
00168                                                                     GObject *context,
00169                                                                     GWebCertificateAction action,
00170                                                                     GObject *cert);
00171     GWebStatus (*get_certificate_context_iter) (GWeb *self, GObject* context, GObject **iterator);
00172     GObject* (*get_certificate_iter) (GWeb *self, GObject** iterator);
00173     void (*certificate_free) (GWeb *self, GObject* cert);
00174     void (*certificate_iter_free) (GWeb *self, GObject* iterator);
00175     void (*notify_plugins) (GWeb *self, gint event);    
00176     GWebStatus (*clear_passwords) (GWeb *self);
00177     void (*clear_personal_data) (GWeb *self);
00178     GWebStatus (*clear_all_history) (GWeb *self);
00179     GWebStatus (*set_remember_password) (GWeb *self, gboolean rpassword);
00180     gboolean (*get_remember_password) (GWeb *self);
00181     GWebStatus (*set_remember_password_for_forms) (GWeb *self, gboolean rpassword);
00182     gboolean (*get_remember_password_for_forms) (GWeb *self);
00183     gboolean (*get_plugin_enabled) (GWeb *self, gchar* name);
00184     GWebStatus (*set_plugin_enabled) (GWeb *self, gchar* name, gboolean enable);
00185     GWebStatus (*set_plugin_ignore_filepath) (GWeb *self);
00186 };
00187 
00188 GType g_web_get_type (void);
00189 //gboolean g_web_set_pref (GWeb *self, gpointer type, gchar* name, gpointer value);
00190 //gboolean g_web_get_pref (GWeb *self, gpointer type, gchar* name, gpointer value);
00194 void g_web_destroy (GWeb *self);
00195 
00200 GWebEngine* g_web_new_web_engine_window (GWeb *self);
00201 
00210 GWebEngine* g_web_new_web_engine_window_with_context (GWeb *self, gpointer context, gboolean leave_tracks, gboolean without_history);
00211 
00218 GWebTransferItem* g_web_new_web_transfer_item (GWeb *self, const gchar* url, const gchar* filename);
00219 
00225 GWebTransferItem* g_web_initialize_web_transfer_item (GWeb *self, GObject *web_transfer_item);
00226 
00231 GWebTransferItemList* g_web_get_web_transfer_item_list (GWeb *self);
00232 
00238 GWebStatus g_web_set_home_page (GWeb *self, const gchar* home_page);
00239 
00244 gchar* g_web_get_home_page (GWeb *self);
00245 
00251 GWebStatus g_web_set_language (GWeb *self, const gchar* language);
00252 
00257 gchar* g_web_get_language (GWeb *self);
00258 
00262 void g_web_reset_cache_history_length (GWeb *self);
00263 
00268 gint g_web_get_maximum_cache_size (GWeb *self);
00269 
00275 GWebStatus g_web_set_default_home_page (GWeb *self, const gchar* default_page);
00276 
00281 gchar* g_web_get_default_home_page (GWeb *self);
00282 
00287 gboolean g_web_home_page_set (GWeb *self);
00288 
00293 void g_web_set_frame_borders_enabled (GWeb *self, gboolean enabled);
00294 
00299 gboolean g_web_get_frame_borders_enabled (GWeb *self);
00300 
00306 GWebStatus g_web_set_location_completion_suffixes (GWeb *self, const gchar* suffixes);
00307 
00312 gchar* g_web_get_location_completion_suffixes (GWeb *self);
00313 
00319 GWebStatus g_web_set_plugins_enabled (GWeb *self, gboolean enabled);
00320 
00326 GWebStatus g_web_set_ssl2_support (GWeb *self, gboolean enabled);
00327 
00332 gboolean g_web_get_ssl2_support (GWeb *self);
00333 
00338 gboolean g_web_get_plugins_enabled (GWeb *self);
00339 
00345 GWebStatus g_web_set_js_enabled (GWeb *self, gboolean enabled);
00346 
00351 gboolean g_web_get_js_enabled (GWeb *self);
00352 
00357 void g_web_set_memory_cache (GWeb *self, GMemoryCache acceptance);
00358 
00363 GMemoryCache g_web_get_memory_cache (GWeb *self);
00364 
00370 GWebStatus g_web_set_cache_size (GWeb *self, gint size);
00371 
00376 gint g_web_get_cache_size (GWeb *self);
00377 
00383 GWebStatus g_web_set_browse_offline (GWeb *self, gboolean offline);
00384 
00389 gboolean g_web_get_browse_offline (GWeb *self);
00390 
00396 GWebStatus g_web_set_automatic_redirection_enabled (GWeb *self, gboolean enabled);
00397 
00402 gboolean g_web_get_automatic_redirection_enabled (GWeb *self);
00403 
00409 GWebStatus g_web_set_load_images (GWeb *self, GWebEngineImagePolicy level);
00410 
00415 GWebEngineImagePolicy g_web_get_load_images (GWeb *self); 
00416 
00420 void g_web_disconnect (GWeb *self);
00421 
00426 GWebStatus g_web_clear_cache (GWeb *self);
00427 
00432 GWebPluginList* g_web_get_plugins_list (GWeb *self);
00433 
00438 GWebHistoryList* g_web_get_history_list (GWeb *self);
00439 
00445 GWebStatus g_web_set_new_window_loads (GWeb *self, gboolean loads);
00446 
00451 gboolean g_web_get_new_window_loads (GWeb *self);
00452 
00457 void g_web_set_cookie_acceptance (GWeb *self, GCookieAcceptance acceptance);
00458 
00463 GCookieAcceptance g_web_get_cookie_acceptance (GWeb *self);
00464 
00469 void g_web_set_popup_acceptance (GWeb *self, GPopupAcceptance acceptance);
00470 
00475 GPopupAcceptance g_web_get_popup_acceptance (GWeb *self);
00476 
00481 GWebStatus g_web_suspend (GWeb *self);
00482 
00487 gboolean g_web_suspended (GWeb *self);
00488 
00492 void g_web_resume (GWeb *self);
00493 
00499 void g_web_set_ua_string (GWeb *self, gchar *ua_string);
00500 
00506 GWebStatus g_web_set_user_agent_id (GWeb *self, gint ua_id);
00507 
00512 gint g_web_get_user_agent_id (GWeb *self);
00513 
00518 void g_web_enable_url_loading (GWeb *self, gboolean enable);
00519 
00524 void g_web_free_memory (GWeb *self, gboolean progressive);
00525 
00526 
00533 GWebStatus g_web_store_transfers (GWeb *self);
00534 
00540 GWebStatus g_web_restore_transfers (GWeb *self);
00541 
00546 GWebStatus g_web_delete_all_cookies (GWeb *self);
00547 
00555 GWebStatus g_web_confirm_cookie (GWeb *self, gpointer context, gboolean accept, GWebCookieAction action);
00556 
00561 GObject* g_web_get_global (GWeb *self);
00562 
00577 GWebCertificateMessage g_web_get_certificate_enum_message (GWeb *self, GObject *context);
00578 
00596 GWebCertificateReaction g_web_perform_crtificate_context_action (GWeb *self, GObject* context, GWebCertificateAction action, GObject *cert);
00597 
00608 GWebStatus g_web_get_certificate_context_iter (GWeb *self, GObject* context, GObject **iterator);
00609 
00617 GObject* g_web_get_certificate_iter (GWeb *self, GObject** iterator);
00618 
00625 void g_web_certificate_iter_free (GWeb *self, GObject* iterator);
00626 
00633 void g_web_certificate_free (GWeb *self, GObject* cert);
00634 
00640 void g_web_notify_plugins(GWeb *self, gint event);
00641 
00650 gint g_web_username_matchinfo_get_matches(GWeb *self, GObject *info);
00651 
00658 void g_web_username_matchinfo_delete(GWeb *self, GObject *info, gint index);
00659 
00660 
00670 GWebStatus g_web_username_matchinfo_get_username(GWeb *self, GObject* info, gint index, gchar** username);
00671 
00681 GWebPasswordManager* g_web_get_password_manager (GWeb *self, const gchar* server, gint index);
00682 
00693 GWebStatus g_web_store_personal_data(GWeb *self, const gchar* server, const gchar* username, const gchar* password);
00694 
00703 GWebStatus g_web_delete_personal_data(GWeb *self, const gchar* server, const gchar* username);
00704 
00710 GWebStatus g_web_clear_passwords (GWeb *self);
00711 
00716 void g_web_clear_personal_data (GWeb *self);
00717 
00723 GWebStatus g_web_clear_all_history (GWeb *self);
00724 
00732 GWebStatus g_web_set_remember_password (GWeb *self, gboolean rpassword);
00733 
00740 gboolean g_web_get_remember_password (GWeb *self);
00741 
00749 GWebStatus g_web_set_remember_password_for_forms (GWeb *self, gboolean rpassword);
00750 
00757 gboolean g_web_get_remember_password_for_forms (GWeb *self);
00758 
00765 GWebStatus g_web_set_plugin_enabled (GWeb *self, gchar* name, gboolean enabled);
00766 
00767 GWebStatus g_web_set_oom_cb (GWeb *self, GFunc func);
00768 
00774 gboolean g_web_get_plugin_enabled (GWeb *self, gchar* name);
00775 
00780 GWebStatus g_web_set_plugin_ignore_filepath (GWeb *self);
00781 
00789 #define G_WEB_SIGNAL_MODAL_DIALOG "modal-dialog"
00790 
00802 GWebDialogButton g_web_signal_modal_dialog(GObject *global,
00803                                                                                const gchar* caption,
00804                                                                                                                                                            const gchar* message,
00805                                                                                                                                                            GWebDialogMessageType type,
00806                                                                                                                                                            GWebDialogButton button1,
00807                                                                                                                                                            GWebDialogButton button2,
00808                                                                                                                                                            GWebDialogButton button3);
00809 
00813 #define G_WEB_SIGNAL_ASK_COOKIE "ask-cookie"
00814 
00828 void g_web_signal_ask_cookie(GObject *global,
00829                                                   gpointer context,
00830                                                                                                   gint actions,
00831                                                                                                   const gchar* url,
00832                                                                                                   const gchar* name,
00833                                                                                                   const gchar* value,
00834                                                                                                   const gchar* domain,
00835                                                                                                   const gchar* path,
00836                                                                                                   gboolean illegal_path);
00837 
00841 #define G_WEB_SIGNAL_CERTIFICATE_DIALOG "certificate-dialog"
00842 
00849 gboolean g_web_signal_certificate_dialog (GObject *global, gpointer ctx);
00850 
00854 #define G_WEB_SIGNAL_CERTIFICATE_PASSWORD_DIALOG "certificate-password-dialog"
00855 
00863 void g_web_signal_certificate_password_dialog (GObject *global,
00864                                                                               const gchar* title,
00865                                                                                                                                                           const gchar* text,
00866                                                                                                                                                           gchar** password);
00867                                                                                                                                                           
00871 #define G_WEB_SIGNAL_CERTIFICATE_DETAILS "certificate-details"
00872 
00879 void g_web_signal_certificate_details (GObject *global, gpointer details);
00880 
00884 #define G_WEB_SIGNAL_ON_SELECT "on-submit"
00885 
00892 GWebPasswordAction
00893 g_web_signal_on_submit_cb (GObject *global);
00894 
00898 #define G_WEB_SIGNAL_SELECT_MATCH "select-match"
00899 
00909 gint
00910 g_web_signal_select_match (GObject *global,  gpointer info);
00911 
00912 G_END_DECLS
00913 
00914 #endif /* __GWEB_H__ */

Generated on Tue Sep 25 10:37:04 2007 for browser-eal by  doxygen 1.5.1