some bugs have been killed:
[mdictionary] / src / gui / include / ws_gui_callbacks.h
1 /*******************************************************************************
2 This file is part of WhiteStork.
3
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.
8
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.
13
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
17
18 Copyright 2006 ComArch S.A.
19 *******************************************************************************/
20 #ifndef _WS_GUI_CALLBACKS
21 #define _WS_GUI_CALLBACKS 
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27
28 #include <ws_gui.h>
29
30
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 #include <sys/time.h>
34 #include <fcntl.h>     
35 #include <unistd.h>   
36
37 #define TIMER_START TRUE
38 #define TIMER_STOP  FALSE
39
40
41 /* added by Dariusz Wiechecki - HISA */
42 void ws_gui_search_home_handler(GError *error, GArray *word, gpointer user_data);
43
44 /*do dbusa*/
45 /** \brief handle dbus signals
46  *
47  */
48 void ws_gui_signal_hander (GError *error, GArray *words, gpointer user_data);
49
50 /** \brief handle signal from dbus and updates progress bar(in order to caching)
51  *
52  */
53 void ws_dbus_progress_bar(GError *error, GArray *words, gpointer user_data);
54
55 /** \brief clean words list
56  *
57  */
58 void ws_gui_clear_list (GtkListStore* list);
59
60 /** \brief handle dbus signal and transfer words to the words list
61  *
62  */
63 void ws_gui_dbus_return_words (GError *error, 
64                                GArray *words, 
65                                gpointer user_data);
66
67 /** \brief handle dbus signal and convert message into readable text 
68  *
69  */
70 void ws_gui_dbus_return_translation (GError *error, 
71                                      GArray *words,
72                                      gpointer user_data);
73
74 /** \brief handle dbus signal and load extracted dictionary 
75  *
76  */
77 void ws_dbus_server_return_extracted_bzip(GError *error, 
78                                           GArray *words, 
79                                           gpointer user_data);
80
81 /**  \brief is used to free memory, which was allocated
82 *
83 */
84 void ws_gui_free_memory(gpointer user_data);
85
86 /**  \brief handle keys press signals (hardware keys in device)
87 *
88 */
89 gboolean hildon_key_press_listener (GtkWidget * widget,
90                                     GdkEventKey * keyevent,
91                                     gpointer user_data);
92
93 /**  \brief allow to hide words list from menu
94 *
95 */
96 void ws_gui_words_list_hide_from_menu(GtkCheckMenuItem *checkmenuitem,
97                                       gpointer user_data);
98
99 /**  \brief allow to hide words list from toolbar
100 *
101 */
102 void ws_gui_words_list_hide(GtkToggleButton *togglebutton, gpointer user_data);
103
104 /**  \brief add word to the words history
105 *
106 */
107 void ws_gui_history_add(char *new_word, gpointer user_data);
108
109 /**  \brief display translation of word stored in the history (if available)
110 *
111 */
112 void ws_gui_history_back(GtkButton *button, gpointer user_data);
113
114 /**  \brief display translation of word stored in the history (if available)
115 *
116 */
117 void ws_gui_history_next(GtkButton *button, gpointer user_data);
118
119 /** \brief check history and disable buttons or uncheck checkbuttons 
120  *
121  */
122 void ws_gui_check_history(gpointer user_data);
123
124 /** \brief creates model and view of words list
125  *
126  */
127 GtkWidget * create_view_and_model (GArray *words_list, gpointer user_data);
128
129 /** \brief creates words list and fill it with content
130  *
131  */
132 GtkTreeModel * create_and_fill_model (GArray *words_list, gpointer user_data);
133
134 /**  \brief switch view between full screen and normal mode 
135 *
136 */
137 void ws_gui_full_screen(GtkMenuItem *menuitem, gpointer user_data);
138
139 /**  \brief search for selected text in a dictionary
140 *
141 */
142 void ws_gui_popup_search(GtkMenuItem *menuitem, gpointer user_data);
143
144 /**  \brief allows to select whole text in translation (html) area
145 *
146 */
147 void ws_gui_html_select_all(GtkMenuItem *menuitem, gpointer user_data);
148
149 /**  \brief allows to copy text from translation (html) area into clipboard
150 *
151 */
152 void ws_gui_html_copy(GtkMenuItem *menuitem, gpointer user_data);
153
154 /**  \brief allows to paste text from the clipboard into find toolbar entry
155 *
156 */
157 void ws_gui_html_paste(GtkMenuItem *menuitem, gpointer user_data);
158
159 /**  \brief magnify translation (html) area
160 *
161 */
162 void ws_gui_html_zoom_in(GtkMenuItem *menuitem, gpointer user_data);
163
164 /**  \brief zoom out translation (html) area.
165 *
166 */
167 void ws_gui_html_zoom_out(GtkMenuItem *menuitem, gpointer user_data);
168
169 /**  \brief start search (sends typed word to the engine)
170 *
171 */
172 void ws_gui_search(GtkWidget * widget, gpointer user_data);
173
174 /**  \brief  abort search
175 *
176 */
177 void ws_gui_search_stop(GtkButton *button, gpointer user_data);
178
179 /**  \brief used when user closes the application
180 *
181 */
182 void ws_gui_on_exit (GtkWidget *widget, GdkEvent *event, gpointer user_data);
183
184 /**  \brief used when user closes the application from menu
185 *
186 */
187 void ws_gui_menu_quit(GtkMenuItem *menuitem, gpointer user_data);
188
189 /**  \brief sets content of translation (html) area
190 *
191 */
192 void ws_gui_fill_html(char *html_context, gpointer user_data);
193
194 /** \brief read current adjustment value
195  *
196  */
197 void ws_gui_read_adjustment(gpointer user_data);
198
199 /** \brief necessary to load images into translation (html) area
200  *
201  */
202 void ws_gui_url_requested (GtkHTML *html, const char *url,
203                            GtkHTMLStream *stream);
204
205 /** \brief handles button press event
206  *
207  */
208 gboolean ws_gui_button_press (GtkWidget *widget,
209                               GdkEventButton *event,
210                               gpointer user_data);
211
212 /** \brief handles button release event
213  *
214  */
215 gboolean ws_gui_button_release (GtkWidget *widget,
216                                 GdkEventButton *event,
217                                 gpointer user_data);
218
219 /** \brief shows popup when user clicks and holds
220  *
221  */
222 guint ws_gui_show_popup(gpointer user_data);
223
224 /** \brief checks clipboard content
225  *
226  */
227 void ws_gui_check_clipboard (GtkWidget *widget, gpointer user_data);
228
229 /** \brief checks dictionaries availablity
230  *
231  */
232 void ws_gui_dict_availablity(GtkMenuItem *menuitem, gpointer user_data);
233
234 /** \brief allows to format html content
235  *
236  */
237 gchar * format_html (gchar * received_string, gpointer user_data);
238
239 /** \brief sets sensitivity of Bookmarks menu items
240  *
241  */
242 void ws_gui_set_bookmarks_sensitivity(gpointer user_data);
243
244 /** \brief sets sensitivity of Bookmarks menu items due to selection made
245  *
246  */
247 void ws_gui_set_bookmark_menu_items(GtkMenuItem *menuitem, gpointer user_data);
248
249 /** \brief sets sensitivity of menu items due to dictionary mode 
250  *
251  */
252 void ws_gui_read_active_dictionaries(gpointer user_data);
253
254 void ws_gui_clear_array(GArray *history);
255
256 void ws_gui_view_cursor_changed(GtkTreeView *treeview, gpointer user_data);
257
258 void ws_gui_set_toolbar_avail(gpointer user_data);
259
260 void ws_refresh_search_results(gpointer user_data);
261
262 #ifdef __cplusplus
263 }
264 #endif
265
266 #endif