Code

Committed a great patch which adds a Save A Copy menu function. This is the first...
[inkscape.git] / src / file.h
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 a copy of the given document.  Displays a file select dialog
94  *  to choose a name for the copy.
95  */
96 bool sp_file_save_a_copy (gpointer object, gpointer data);
99 /**
100  *  Saves the given document.  Displays a file select dialog
101  *  if needed.
102  */
103 bool sp_file_save_document (SPDocument *document);
105 /* Do the saveas dialog with a document as the parameter */
106 bool sp_file_save_dialog (SPDocument *doc, bool bAsCopy = FALSE);
109 /*######################
110 ## I M P O R T
111 ######################*/
113 /**
114  * Displays a file selector dialog, to allow the
115  * user to import data into the current document.
116  */
117 void sp_file_import (GtkWidget * widget);
119 /**
120  * Imports a resource
121  */
122 void file_import(SPDocument *in_doc, const Glib::ustring &uri,
123                  Inkscape::Extension::Extension *key);
125 /*######################
126 ## E X P O R T
127 ######################*/
129 /**
130  * Displays a FileExportDialog for the user, with an
131  * additional type selection, to allow the user to export
132  * the a document as a given type.
133  */
134 bool sp_file_export_dialog (void *widget);
138 /*######################
139 ## P R I N T
140 ######################*/
142 /* These functions are redundant now, but
143 would be useful as instance methods
144 */
146 /**
147  *
148  */
149 void sp_file_print (void);
151 /**
152  *
153  */
154 void sp_file_print_direct (void);
156 /**
157  *
158  */
159 void sp_file_print_preview (gpointer object, gpointer data);
161 /*#####################
162 ## U T I L I T Y
163 #####################*/
165 /**
166  * clean unused defs out of file
167  */
168 void sp_file_vacuum ();
171 namespace Inkscape {
172 namespace IO {
174 void fixupHrefs( SPDocument *doc, const gchar *uri, gboolean spns );
180 #endif