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 #include <iostream>
25 #include <fstream>
26 #include <glibmm/i18n.h>
28 #include "uri.h"
29 #include "streams-webdav.h"
31 struct SPDesktop;
32 struct Document;
34 namespace Inkscape {
35 namespace Extension {
36 struct Extension;
37 }
38 }
40 /*######################
41 ## N E W
42 ######################*/
44 /**
45 * Creates a new Inkscape document and window.
46 * Return value is a pointer to the newly created desktop.
47 */
48 SPDesktop* sp_file_new (const Glib::ustring &templ);
49 SPDesktop* sp_file_new_default (void);
51 /*######################
52 ## D E L E T E
53 ######################*/
55 /**
56 * Close the document/view
57 */
58 void sp_file_exit (void);
60 /*######################
61 ## O P E N
62 ######################*/
64 /**
65 * Opens a new file and window from the given URI
66 */
67 bool sp_file_open(
68 const Glib::ustring &uri,
69 Inkscape::Extension::Extension *key,
70 bool add_to_recent = true,
71 bool replace_empty = true
72 );
74 //NOTE1
75 /*
76 * Opens a new file and window from the given URI (class)
77 */
78 bool sp_file_open_uri(
79 const Inkscape::URI &uri,
80 Inkscape::Extension::Extension *key,
81 bool add_to_recent = true,
82 bool replace_empty = true
83 );
85 /**
86 * Displays a file open dialog. Calls sp_file_open on
87 * an OK.
88 */
89 void sp_file_open_dialog (Gtk::Window &parentWindow, gpointer object, gpointer data);
91 /**
92 * Reverts file to disk-copy on "YES"
93 */
94 void sp_file_revert_dialog ();
96 /*######################
97 ## S A V E
98 ######################*/
100 /*
101 * Added to make only the remote savings.
102 */
104 bool file_save_remote(Document *doc, const Glib::ustring &uri,
105 Inkscape::Extension::Extension *key, bool saveas, bool official);
107 /**
108 *
109 */
110 bool sp_file_save (Gtk::Window &parentWindow, gpointer object, gpointer data);
112 /**
113 * Saves the given document. Displays a file select dialog
114 * to choose the new name.
115 */
116 bool sp_file_save_as (Gtk::Window &parentWindow, gpointer object, gpointer data);
118 /**
119 * Saves a copy of the given document. Displays a file select dialog
120 * to choose a name for the copy.
121 */
122 bool sp_file_save_a_copy (Gtk::Window &parentWindow, gpointer object, gpointer data);
125 /**
126 * Saves the given document. Displays a file select dialog
127 * if needed.
128 */
129 bool sp_file_save_document (Gtk::Window &parentWindow, Document *document);
131 /* Do the saveas dialog with a document as the parameter */
132 bool sp_file_save_dialog (Gtk::Window &parentWindow, Document *doc, bool bAsCopy = FALSE);
135 /*######################
136 ## I M P O R T
137 ######################*/
139 /**
140 * Displays a file selector dialog, to allow the
141 * user to import data into the current document.
142 */
143 void sp_file_import (Gtk::Window &parentWindow);
145 /**
146 * Imports a resource
147 */
148 void file_import(Document *in_doc, const Glib::ustring &uri,
149 Inkscape::Extension::Extension *key);
151 /*######################
152 ## E X P O R T
153 ######################*/
155 /**
156 * Displays a FileExportDialog for the user, with an
157 * additional type selection, to allow the user to export
158 * the a document as a given type.
159 */
160 bool sp_file_export_dialog (void *widget);
163 /*######################
164 ## E X P O R T T O O C A L
165 ######################*/
167 /**
168 * Export the current document to OCAL
169 */
170 void sp_file_export_to_ocal (Gtk::Window &parentWindow );
173 /**
174 * Export the current document to OCAL
175 */
176 bool sp_file_export_to_ocal_dialog (void *widget);
179 /*######################
180 ## I M P O R T F R O M O C A L
181 ######################*/
183 /**
184 * Import a document from OCAL
185 */
186 void sp_file_import_from_ocal (Gtk::Window &parentWindow );
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 (Gtk::Window& parentWindow);
202 /**
203 *
204 */
205 void sp_file_print_preview (gpointer object, gpointer data);
207 /*#####################
208 ## U T I L I T Y
209 #####################*/
211 /**
212 * clean unused defs out of file
213 */
214 void sp_file_vacuum ();
217 #endif
220 //namespace Inkscape {
221 //namespace Net {
225 //}
226 //}
227 // #endif
229 /*
230 Local Variables:
231 mode:c++
232 c-file-style:"stroustrup"
233 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
234 indent-tabs-mode:nil
235 fill-column:99
236 End:
237 */
238 // vi: set autoindent shiftwidth=4 tabstop=8 filetype=cpp expandtab softtabstop=4 encoding=utf-8 textwidth=99 :