1 /* Bluefish HTML Editor
2  * file_dialogs.h - file dialogs
3  *
4  * Copyright (C) 2005-2009 Olivier Sessink
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __FILEDIALOGS_H_
21 #define __FILEDIALOGS_H_
22 
23 typedef enum {
24 	close_mode_per_file,
25 	close_mode_close_all,
26 	close_mode_cancel,
27 	close_mode_save_all
28 } Tclose_mode;
29 
30 void file_close_all(Tbfwin * bfwin);
31 void file_new_doc(Tbfwin * bfwin);
32 void file_open_doc(Tbfwin * bfwin);
33 void file_save_all(Tbfwin * bfwin);
34 
35 
36 void files_advanced_win(Tbfwin * bfwin, gchar * basedir);
37 void file_open_advanced_cb(GtkWidget * widget, Tbfwin * bfwin);
38 void file_open_cb(GtkWidget * widget, Tbfwin * bfwin);
39 void file_open_url_cb(GtkAction * action, Tbfwin * bfwin);
40 gchar *ask_new_filename(Tbfwin * bfwin, const gchar * old_curi, const gchar * dialogtext);
41 
42 typedef enum {
43 	docsave_normal,
44 	docsave_saveas,
45 	docsave_move,
46 	docsave_copy
47 } Tdocsave_mode;
48 
49 void doc_save_backend(Tdocument * doc, Tdocsave_mode savemode, gboolean close_doc,
50 					  gboolean close_window);
51 void file_save_cb(GtkWidget * widget, Tbfwin * bfwin);
52 void file_save_as_cb(GtkWidget * widget, Tbfwin * bfwin);
53 void file_move_to_cb(GtkWidget * widget, Tbfwin * bfwin);
54 void file_save_all_cb(GtkWidget * widget, Tbfwin * bfwin);
55 
56 void doc_save_all_close(Tbfwin * bfwin);
57 gint doc_modified_dialog(Tdocument * doc);
58 gint project_not_found_dialog(Tbfwin * bfwin, GFile * uri);
59 Tclose_mode multiple_files_modified_dialog(Tbfwin * bfwin);
60 gboolean choose_per_file(Tbfwin * bfwin, gboolean close_window);
61 
62 gboolean doc_close_single_backend(Tdocument * doc, gboolean delay, gboolean close_window);
63 void file_close_cb(GtkWidget * widget, Tbfwin * bfwin);
64 void doc_close_multiple_backend(Tbfwin * bfwin, gboolean close_window, Tclose_mode close_mode);
65 void file_close_all_cb(GtkWidget * widget, Tbfwin * bfwin);
66 
67 void file_new_cb(GtkWidget * widget, Tbfwin * bfwin);
68 void file_reload_all_modified(Tbfwin * bfwin);
69 
70 void sync_dialog(Tbfwin * bfwin);
71 
72 void modified_on_disk_check_init(void);
73 
74 #endif							/* __FILEDIALOGS_H_ */
75