1 /*******************************************************************************
2 This file is part of WhiteStork.
4 WhiteStork is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 WhiteStork is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with WhiteStork; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 Copyright 2006 ComArch S.A.
19 *******************************************************************************/
20 #ifndef _WS_GUI_CALLBACKS
21 #define _WS_GUI_CALLBACKS
31 #include <sys/types.h>
37 #define TIMER_START TRUE
38 #define TIMER_STOP FALSE
41 /* added by Dariusz Wiechecki - HISA */
42 void ws_gui_search_home_handler(GError *error, GArray *word, gpointer user_data);
45 /** \brief handle dbus signals
48 void ws_gui_signal_hander (GError *error, GArray *words, gpointer user_data);
50 /** \brief handle signal from dbus and updates progress bar(in order to caching)
53 void ws_dbus_progress_bar(GError *error, GArray *words, gpointer user_data);
55 /** \brief clean words list
58 void ws_gui_clear_list (GtkListStore* list);
60 /** \brief handle dbus signal and transfer words to the words list
63 void ws_gui_dbus_return_words (GError *error,
67 /** \brief handle dbus signal and convert message into readable text
70 void ws_gui_dbus_return_translation (GError *error,
74 /** \brief handle dbus signal and load extracted dictionary
77 void ws_dbus_server_return_extracted_bzip(GError *error,
81 /** \brief is used to free memory, which was allocated
84 void ws_gui_free_memory(gpointer user_data);
86 /** \brief handle keys press signals (hardware keys in device)
89 gboolean hildon_key_press_listener (GtkWidget * widget,
90 GdkEventKey * keyevent,
93 /** \brief allow to hide words list from menu
96 void ws_gui_words_list_hide_from_menu(GtkCheckMenuItem *checkmenuitem,
99 /** \brief allow to hide words list from toolbar
102 void ws_gui_words_list_hide(GtkToggleButton *togglebutton, gpointer user_data);
104 /** \brief add word to the words history
107 void ws_gui_history_add(char *new_word, gpointer user_data);
109 /** \brief display translation of word stored in the history (if available)
112 void ws_gui_history_back(GtkButton *button, gpointer user_data);
114 /** \brief display translation of word stored in the history (if available)
117 void ws_gui_history_next(GtkButton *button, gpointer user_data);
119 /** \brief check history and disable buttons or uncheck checkbuttons
122 void ws_gui_check_history(gpointer user_data);
124 /** \brief creates model and view of words list
127 GtkWidget * create_view_and_model (GArray *words_list, gpointer user_data);
129 /** \brief creates words list and fill it with content
132 GtkTreeModel * create_and_fill_model (GArray *words_list, gpointer user_data);
134 /** \brief switch view between full screen and normal mode
137 void ws_gui_full_screen(GtkMenuItem *menuitem, gpointer user_data);
139 /** \brief search for selected text in a dictionary
142 void ws_gui_popup_search(GtkMenuItem *menuitem, gpointer user_data);
144 /** \brief allows to select whole text in translation (html) area
147 void ws_gui_html_select_all(GtkMenuItem *menuitem, gpointer user_data);
149 /** \brief allows to copy text from translation (html) area into clipboard
152 void ws_gui_html_copy(GtkMenuItem *menuitem, gpointer user_data);
154 /** \brief allows to paste text from the clipboard into find toolbar entry
157 void ws_gui_html_paste(GtkMenuItem *menuitem, gpointer user_data);
159 /** \brief magnify translation (html) area
162 void ws_gui_html_zoom_in(GtkMenuItem *menuitem, gpointer user_data);
164 /** \brief zoom out translation (html) area.
167 void ws_gui_html_zoom_out(GtkMenuItem *menuitem, gpointer user_data);
169 /** \brief start search (sends typed word to the engine)
172 void ws_gui_search(GtkWidget * widget, gpointer user_data);
174 /** \brief abort search
177 void ws_gui_search_stop(GtkButton *button, gpointer user_data);
179 /** \brief used when user closes the application
182 void ws_gui_on_exit (GtkWidget *widget, GdkEvent *event, gpointer user_data);
184 /** \brief used when user closes the application from menu
187 void ws_gui_menu_quit(GtkMenuItem *menuitem, gpointer user_data);
189 /** \brief sets content of translation (html) area
192 void ws_gui_fill_html(char *html_context, gpointer user_data);
194 /** \brief read current adjustment value
197 void ws_gui_read_adjustment(gpointer user_data);
199 /** \brief necessary to load images into translation (html) area
202 void ws_gui_url_requested (GtkHTML *html, const char *url,
203 GtkHTMLStream *stream);
205 /** \brief handles button press event
208 gboolean ws_gui_button_press (GtkWidget *widget,
209 GdkEventButton *event,
212 /** \brief handles button release event
215 gboolean ws_gui_button_release (GtkWidget *widget,
216 GdkEventButton *event,
219 /** \brief shows popup when user clicks and holds
222 guint ws_gui_show_popup(gpointer user_data);
224 /** \brief checks clipboard content
227 void ws_gui_check_clipboard (GtkWidget *widget, gpointer user_data);
229 /** \brief checks dictionaries availablity
232 void ws_gui_dict_availablity(GtkMenuItem *menuitem, gpointer user_data);
234 /** \brief allows to format html content
237 gchar * format_html (gchar * received_string, gpointer user_data);
239 /** \brief sets sensitivity of Bookmarks menu items
242 void ws_gui_set_bookmarks_sensitivity(gpointer user_data);
244 /** \brief sets sensitivity of Bookmarks menu items due to selection made
247 void ws_gui_set_bookmark_menu_items(GtkMenuItem *menuitem, gpointer user_data);
249 /** \brief sets sensitivity of menu items due to dictionary mode
252 void ws_gui_read_active_dictionaries(gpointer user_data);
254 void ws_gui_clear_array(GArray *history);
256 void ws_gui_view_cursor_changed(GtkTreeView *treeview, gpointer user_data);
258 void ws_gui_set_toolbar_avail(gpointer user_data);
260 void ws_refresh_search_results(gpointer user_data);