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