00001 /******************************************************************************* 00002 * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved. 00003 * Copyright (c) 2006 PalmSource, Inc (an ACCESS company). All rights reserved. 00004 ******************************************************************************/ 00012 #ifndef ALP_BROWSER_VIEW_H 00013 #define ALP_BROWSER_VIEW_H 00014 00015 #include <gdk/gdk.h> 00016 #include <gtk/gtkvbox.h> 00017 #include <alp/sysclass.h> 00018 #include <alp/types.h> 00019 00020 #ifdef __cplusplus 00021 extern "C" { 00022 #endif /* __cplusplus */ 00023 00028 /* @{ */ 00029 00030 #define ALP_BROWSER_VIEW(obj) GTK_CHECK_CAST (obj, alp_browser_view_get_type (), AlpBrowserView) 00031 #define ALP_BROWSER_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, alp_browser_view_get_type (), AlpBrowserViewClass) 00032 #define ALP_IS_BROWSER_VIEW(obj) GTK_CHECK_TYPE (obj, alp_browser_view_get_type ()) 00033 #define ALP_TYPE_BROWSERVIEW (alp_browser_view_get_type()) 00034 00035 typedef struct _AlpBrowserView AlpBrowserView; 00036 typedef struct _AlpBrowserViewClass AlpBrowserViewClass; 00037 00038 struct _AlpBrowserView 00039 { 00040 GtkVBox vbox; 00041 void *browserView; 00042 void *priv; 00043 }; 00044 00045 struct _AlpBrowserViewClass 00046 { 00047 GtkVBoxClass parent_class; 00048 void (*copy_clipboard)(AlpBrowserView *browserview); 00049 }; 00050 00054 typedef void * AlpBrowserViewContent; 00055 00056 //----------------------------------------------------------------------------------------------------------------- 00063 #define ALP_BROWSERVIEW_ERROR_SUCCESS ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00010000)) 00064 #define ALP_BROWSERVIEW_ERROR_INUSE ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00020000)) 00065 #define ALP_BROWSERVIEW_ERROR_OUTOFMEMORY ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00030000)) 00066 #define ALP_BROWSERVIEW_ERROR_INVALIDPARAM ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00040000)) 00067 #define ALP_BROWSERVIEW_ERROR_NOTFOUND ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00050000)) 00068 #define ALP_BROWSERVIEW_ERROR_NOTINITIALIZED ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00060000)) 00069 #define ALP_BROWSERVIEW_ERROR_CANTOPEN ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00070000)) 00070 #define ALP_BROWSERVIEW_ERROR_GENERIC ((alp_status_t) (ALP_CLASS_BROWSERVIEW | 0x00080000)) 00071 00072 00073 //----------------------------------------------------------------------------------------------------------------- 00080 typedef guint AlpBrowserViewDisplayMode; 00081 #define ALP_BROWSER_VIEW_DISPLAY_MODE_DESKTOP 1 /* Standard, as with Desktop browsers. Default */ 00082 #define ALP_BROWSER_VIEW_DISPLAY_MODE_TEXT 2 /* Text only, no graphic */ 00083 #define ALP_BROWSER_VIEW_DISPLAY_MODE_SMART_FIT 3 /* Smart-Fit, optimized for handheld */ 00084 00085 00086 //----------------------------------------------------------------------------------------------------------------- 00094 typedef guint AlpBrowserViewProgressStatus; 00095 #define AlpBrowserViewProgressDone 1 00096 #define AlpBrowserViewProgressBusy 2 00097 #define AlpBrowserViewProgressOutOfMemory 3 00098 #define AlpBrowserViewProgressError 4 00099 #define AlpBrowserViewProgressAuthenticationStart 5 00100 #define AlpBrowserViewProgressAuthenticationFailed 6 00101 #define AlpBrowserViewProgressAuthenticationDone 7 00102 #define AlpBrowserViewInputFormatCheckFailed 8 00103 #define AlpBrowserViewProgressHTTPError 9 00104 #define AlpBrowserViewProgressFileOperationError 10 00105 00106 00107 //----------------------------------------------------------------------------------------------------------------- 00114 typedef guint AlpBrowserViewSubmitFormMethod; 00115 #define AlpBrowserViewHttpMethodGet 1 00116 #define AlpBrowserViewHttpMethodPost 2 00117 00118 00119 //----------------------------------------------------------------------------------------------------------------- 00126 typedef guint AlpBrowserViewScrollDirection; 00127 #define AlpBrowserViewDirLeft 1 00128 #define AlpBrowserViewDirRight 2 00129 #define AlpBrowserViewDirUp 3 00130 #define AlpBrowserViewDirDown 4 00131 00132 00133 //----------------------------------------------------------------------------------------------------------------- 00140 enum{ 00141 AlpBrowserViewFocusMoveOutLeft = 1, /* focus should be moved out of browser view to the left widget when necessary */ 00142 AlpBrowserViewFocusMoveOutRight = 2, /* focus should be moved out of browser view to the right widget when necessary */ 00143 AlpBrowserViewFocusMoveOutUp = 4, /* focus should be moved out of browser view to the above widget when necessary */ 00144 AlpBrowserViewFocusMoveOutDown = 8 /* focus should be moved out of browser view to the bottom widget when necessary */ 00145 }; 00147 00148 //----------------------------------------------------------------------------------------------------------------- 00156 typedef guint AlpBrowserViewFocusTargetType; 00157 #define ALP_BROWSER_VIEW_TARGET_ANCHO_HTTP 1 00158 #define ALP_BROWSER_VIEW_TARGET_ANCHO_TEL 2 00159 #define ALP_BROWSER_VIEW_TARGET_ANCHO_TELAV 3 00160 #define ALP_BROWSER_VIEW_TARGET_IMAGE 4 00161 #define ALP_BROWSER_VIEW_TARGET_INPUT_BUTTON 5 00162 #define ALP_BROWSER_VIEW_TARGET_INPUT_CHECKBOX 6 00163 #define ALP_BROWSER_VIEW_TARGET_INPUT_FILE 7 00164 #define ALP_BROWSER_VIEW_TARGET_INPUT_PASSWORD 8 00165 #define ALP_BROWSER_VIEW_TARGET_INPUT_RADIO 9 00166 #define ALP_BROWSER_VIEW_TARGET_INPUT_RESET 10 00167 #define ALP_BROWSER_VIEW_TARGET_INPUT_SELECT 11 00168 #define ALP_BROWSER_VIEW_TARGET_INPUT_SUBMIT 12 00169 #define ALP_BROWSER_VIEW_TARGET_INPUT_TEXT 13 00170 #define ALP_BROWSER_VIEW_TARGET_INPUT_TEXTAREA 14 00171 #define ALP_BROWSER_VIEW_TARGET_ANCHO_MAILTO 15 00172 #define ALP_BROWSER_VIEW_TARGET_IFRAME 16 00173 00174 00175 //----------------------------------------------------------------------------------------------------------------- 00182 typedef guint AlpBrowserViewFontSize; 00183 #define AlpBrowserViewFontSizeSmall 1 00184 #define AlpBrowserViewFontSizeNormal 2 /* default */ 00185 #define AlpBrowserViewFontSizeLarge 3 00186 00187 00198 typedef gboolean alp_browser_view_link_selection_callback(GtkWidget *widget, gchar *url, void *callBackData); 00199 00211 typedef gboolean alp_browser_view_submit_form_callback(GtkWidget *widget, gchar *url, AlpBrowserViewSubmitFormMethod method, gchar *postData, void *callBackData); 00212 00237 typedef gboolean alp_browser_view_scan_hyperlink_callback(GtkWidget *widget, gchar *buffer, guint length, guint *patternStart, gint *patternEnd, gint *patternType); 00238 00248 typedef void alp_browser_view_progress_callback(GtkWidget *widget, gchar *url, AlpBrowserViewProgressStatus status); 00249 00260 typedef gboolean alp_browser_view_authenticate_callback(GtkWidget *widget, gchar *url, gchar **userName, gchar **password); 00261 00268 typedef struct { 00269 AlpBrowserViewFocusTargetType type; 00270 gchar *url; /* where applicable, the URL of the focused item */ 00271 gint urlLen; 00272 gchar *nameStr; /*where applicable, the name of the focused target */ 00273 gint nameStrLen; 00274 gchar *valueStr; /* where applicable ,the value of the focused input controls */ 00275 gint valueStrLen; 00276 } AlpBrowserViewFocusTargetInfo; 00277 00281 GType alp_browser_view_get_type(); 00282 00296 GtkWidget *alp_browser_view_new(GtkAllocation *rect, AlpBrowserViewDisplayMode mode, gchar *url, alp_status_t *err); 00297 00314 alp_status_t alp_browser_view_destroy(GtkWidget *widget); 00315 00329 alp_status_t alp_browser_view_set_link_selection_callback(GtkWidget *widget, alp_browser_view_link_selection_callback *callBack, void *callBackData); 00330 00342 alp_status_t alp_browser_view_set_submit_callback(GtkWidget *widget, alp_browser_view_submit_form_callback *callBack, void *callBackData); 00343 00354 alp_status_t alp_browser_view_set_progress_callback(GtkWidget *widget, alp_browser_view_progress_callback *notifyCallBack); 00355 00370 alp_status_t alp_browser_view_find_text(GtkWidget *widget, gchar *searchString, gboolean wrapSearch, gint searchDirection); 00371 00383 alp_status_t alp_browser_view_get_text_selection(GtkWidget *widget, gchar **selectedText); 00384 00392 alp_status_t alp_browser_view_select_all_text(GtkWidget *widget); 00393 00403 alp_status_t alp_browser_view_clear_screen(GtkWidget *widget); 00404 00415 alp_status_t alp_browser_view_create_content_object(GtkWidget *widget, AlpBrowserViewContent **content); 00416 00431 alp_status_t alp_browser_view_destroy_content_object(GtkWidget *widget, AlpBrowserViewContent *content); 00432 00451 alp_status_t alp_browser_view_add_text_data(GtkWidget *widget, AlpBrowserViewContent *content, gchar *url, gchar *mimeType, gchar *charset, void *data, guint dataSize); 00452 00468 alp_status_t alp_browser_view_add_binary_data(GtkWidget *widget, AlpBrowserViewContent *content, gchar *url, gchar *mimeType, void *data, guint dataSize); 00469 00479 alp_status_t alp_browser_view_render_data(GtkWidget *widget, AlpBrowserViewContent *content); 00480 00488 alp_status_t alp_browser_view_redraw_screen(GtkWidget *widget); 00489 00498 alp_status_t alp_browser_view_abort(GtkWidget *widget); 00499 00509 alp_status_t alp_browser_view_get_vertical_scroll_position(GtkWidget *widget, guint *position); 00510 00520 alp_status_t alp_browser_view_set_vertical_scroll_position(GtkWidget *widget, guint newPosition); 00521 00533 alp_status_t alp_browser_view_can_scroll(GtkWidget *widget, AlpBrowserViewScrollDirection direction, gboolean *canScroll); 00534 00544 alp_status_t alp_browser_view_set_font_size(GtkWidget *widget, AlpBrowserViewFontSize value); 00545 00556 alp_status_t alp_browser_view_get_target_info(GtkWidget *widget, AlpBrowserViewFocusTargetInfo *targetInfo); 00557 00567 alp_status_t alp_browser_view_set_hyperlink_scan_callback(GtkWidget *widget, alp_browser_view_scan_hyperlink_callback *callBack); 00568 00578 alp_status_t alp_browser_view_set_authenticate_callback(GtkWidget *widget, alp_browser_view_authenticate_callback *callBack); 00579 00601 alp_status_t alp_browser_view_set_focus_move_out_flag(GtkWidget *widget, gint flag); 00602 00611 alp_status_t alp_browser_view_refresh(GtkWidget *widget); 00612 00621 alp_status_t alp_browser_view_library_initialize(void); 00622 00630 alp_status_t alp_browser_view_library_finalize(void); 00631 00642 alp_status_t alp_browser_view_library_set_cnc_profile(const gchar *profile_name); 00643 00644 /* @} */ 00645 00646 #ifdef __cplusplus 00647 } 00648 #endif /* __cplusplus */ 00649 #endif /* ALP_BROWSER_VIEW_H */ 00650 00651
Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.