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) 1999-2002 Authors
12 * Copyright (C) 2001-2002 Ximian, Inc.
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
17 #include <gtkmm.h>
18 #include <glib/gslist.h>
19 #include <gtk/gtkwidget.h>
21 #include "extension/extension-forward.h"
23 struct SPDesktop;
24 struct SPDocument;
26 namespace Inkscape {
27 namespace Extension {
28 struct Extension;
29 }
30 }
32 /*######################
33 ## N E W
34 ######################*/
36 /**
37 * Creates a new Inkscape document and window.
38 * Return value is a pointer to the newly created desktop.
39 */
40 SPDesktop* sp_file_new (const Glib::ustring &templ);
41 SPDesktop* sp_file_new_default (void);
43 /*######################
44 ## D E L E T E
45 ######################*/
47 /**
48 * Close the document/view
49 */
50 void sp_file_exit (void);
52 /*######################
53 ## O P E N
54 ######################*/
56 /**
57 * Opens a new file and window from the given URI
58 */
59 bool sp_file_open(
60 const Glib::ustring &uri,
61 Inkscape::Extension::Extension *key,
62 bool add_to_recent = true,
63 bool replace_empty = true
64 );
66 /**
67 * Displays a file open dialog. Calls sp_file_open on
68 * an OK.
69 */
70 void sp_file_open_dialog (gpointer object, gpointer data);
72 /**
73 * Reverts file to disk-copy on "YES"
74 */
75 void sp_file_revert_dialog ();
77 /*######################
78 ## S A V E
79 ######################*/
81 /**
82 *
83 */
84 bool sp_file_save (gpointer object, gpointer data);
86 /**
87 * Saves the given document. Displays a file select dialog
88 * to choose the new name.
89 */
90 bool sp_file_save_as (gpointer object, gpointer data);
92 /**
93 * Saves the given document. Displays a file select dialog
94 * if needed.
95 */
96 bool sp_file_save_document (SPDocument *document);
98 /* Do the saveas dialog with a document as the parameter */
99 bool sp_file_save_dialog (SPDocument *doc);
102 /*######################
103 ## I M P O R T
104 ######################*/
106 /**
107 * Displays a file selector dialog, to allow the
108 * user to import data into the current document.
109 */
110 void sp_file_import (GtkWidget * widget);
112 /**
113 * Imports a resource
114 */
115 void file_import(SPDocument *in_doc, const Glib::ustring &uri,
116 Inkscape::Extension::Extension *key);
118 /*######################
119 ## E X P O R T
120 ######################*/
122 /**
123 * Displays a FileExportDialog for the user, with an
124 * additional type selection, to allow the user to export
125 * the a document as a given type.
126 */
127 bool sp_file_export_dialog (void *widget);
131 /*######################
132 ## P R I N T
133 ######################*/
135 /* These functions are redundant now, but
136 would be useful as instance methods
137 */
139 /**
140 *
141 */
142 void sp_file_print (void);
144 /**
145 *
146 */
147 void sp_file_print_direct (void);
149 /**
150 *
151 */
152 void sp_file_print_preview (gpointer object, gpointer data);
154 /*#####################
155 ## U T I L I T Y
156 #####################*/
158 /**
159 * clean unused defs out of file
160 */
161 void sp_file_vacuum ();
164 namespace Inkscape {
165 namespace IO {
167 void fixupHrefs( SPDocument *doc, const gchar *uri, gboolean spns );
169 }
170 }
173 #endif