1 #ifndef __SP_FILE_H__
2 #define __SP_FILE_H__
4 /*
5 * File/Print operations
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 * Chema Celorio <chema@celorio.com>
10 *
11 * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
12 * Copyright (C) 2001-2002 Ximian, Inc.
13 * Copyright (C) 1999-2002 Authors
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include <gtkmm.h>
19 #include <glib/gslist.h>
20 #include <gtk/gtkwidget.h>
22 #include "extension/extension-forward.h"
24 struct SPDesktop;
25 struct SPDocument;
27 namespace Inkscape {
28 namespace Extension {
29 struct Extension;
30 }
31 }
33 /*######################
34 ## N E W
35 ######################*/
37 /**
38 * Creates a new Inkscape document and window.
39 * Return value is a pointer to the newly created desktop.
40 */
41 SPDesktop* sp_file_new (const Glib::ustring &templ);
42 SPDesktop* sp_file_new_default (void);
44 /*######################
45 ## D E L E T E
46 ######################*/
48 /**
49 * Close the document/view
50 */
51 void sp_file_exit (void);
53 /*######################
54 ## O P E N
55 ######################*/
57 /**
58 * Opens a new file and window from the given URI
59 */
60 bool sp_file_open(
61 const Glib::ustring &uri,
62 Inkscape::Extension::Extension *key,
63 bool add_to_recent = true,
64 bool replace_empty = true
65 );
67 /**
68 * Displays a file open dialog. Calls sp_file_open on
69 * an OK.
70 */
71 void sp_file_open_dialog (Gtk::Window &parentWindow, gpointer object, gpointer data);
73 /**
74 * Reverts file to disk-copy on "YES"
75 */
76 void sp_file_revert_dialog ();
78 /*######################
79 ## S A V E
80 ######################*/
82 /*
83 * Added to make only the local savings.
84 */
86 bool file_save_local(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri,
87 Inkscape::Extension::Extension *key, bool saveas, bool official);
90 /*
91 * Added to make only the remote savings.
92 */
94 bool file_save_remote(SPDocument *doc, const Glib::ustring &uri,
95 Inkscape::Extension::Extension *key, bool saveas, bool official);
99 /**
100 *
101 */
102 bool sp_file_save (Gtk::Window &parentWindow, gpointer object, gpointer data);
104 /**
105 * Saves the given document. Displays a file select dialog
106 * to choose the new name.
107 */
108 bool sp_file_save_as (Gtk::Window &parentWindow, gpointer object, gpointer data);
110 /**
111 * Saves a copy of the given document. Displays a file select dialog
112 * to choose a name for the copy.
113 */
114 bool sp_file_save_a_copy (Gtk::Window &parentWindow, gpointer object, gpointer data);
117 /**
118 * Saves the given document. Displays a file select dialog
119 * if needed.
120 */
121 bool sp_file_save_document (Gtk::Window &parentWindow, SPDocument *document);
123 /* Do the saveas dialog with a document as the parameter */
124 bool sp_file_save_dialog (Gtk::Window &parentWindow, SPDocument *doc, bool bAsCopy = FALSE);
127 /*######################
128 ## I M P O R T
129 ######################*/
131 /**
132 * Displays a file selector dialog, to allow the
133 * user to import data into the current document.
134 */
135 void sp_file_import (Gtk::Window &parentWindow);
137 /**
138 * Imports a resource
139 */
140 void file_import(SPDocument *in_doc, const Glib::ustring &uri,
141 Inkscape::Extension::Extension *key);
143 /*######################
144 ## E X P O R T
145 ######################*/
147 /**
148 * Displays a FileExportDialog for the user, with an
149 * additional type selection, to allow the user to export
150 * the a document as a given type.
151 */
152 bool sp_file_export_dialog (void *widget);
155 /*######################
156 ## E X P O R T T O O C A L
157 ######################*/
159 /**
160 * Export the current document to OCAL
161 */
162 void sp_file_export_to_ocal (Gtk::Window &parentWindow );
165 /**
166 * Export the current document to OCAL
167 */
168 bool sp_file_export_to_ocal_dialog (void *widget);
171 /*######################
172 ## I M P O R T F R O M O C A L
173 ######################*/
175 /**
176 * Import a document from OCAL
177 */
178 void sp_file_import_from_ocal (Gtk::Window &parentWindow );
181 /**
182 * Import a document from OCAL
183 */
184 //bool sp_file_import_from_ocal_dialog (void *widget);
189 /*######################
190 ## P R I N T
191 ######################*/
193 /* These functions are redundant now, but
194 would be useful as instance methods
195 */
197 /**
198 *
199 */
200 void sp_file_print (void);
202 /**
203 *
204 */
205 void sp_file_print_direct (void);
207 /**
208 *
209 */
210 void sp_file_print_preview (gpointer object, gpointer data);
212 /*#####################
213 ## U T I L I T Y
214 #####################*/
216 /**
217 * clean unused defs out of file
218 */
219 void sp_file_vacuum ();
222 namespace Inkscape {
223 namespace IO {
225 void fixupHrefs( SPDocument *doc, const gchar *uri, gboolean spns );
227 }
228 }
231 #endif