Code

peeled back the gboolean code as it hit on some complexity theory principles...
[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) 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 (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  *
84  */
85 bool sp_file_save (gpointer object, gpointer data);
87 /**
88  *  Saves the given document.  Displays a file select dialog
89  *  to choose the new name.
90  */
91 bool sp_file_save_as (gpointer object, gpointer data);
93 /**
94  *  Saves a copy of the given document.  Displays a file select dialog
95  *  to choose a name for the copy.
96  */
97 bool sp_file_save_a_copy (gpointer object, gpointer data);
100 /**
101  *  Saves the given document.  Displays a file select dialog
102  *  if needed.
103  */
104 bool sp_file_save_document (SPDocument *document);
106 /* Do the saveas dialog with a document as the parameter */
107 bool sp_file_save_dialog (SPDocument *doc, bool bAsCopy = FALSE);
110 /*######################
111 ## I M P O R T
112 ######################*/
114 /**
115  * Displays a file selector dialog, to allow the
116  * user to import data into the current document.
117  */
118 void sp_file_import (GtkWidget * widget);
120 /**
121  * Imports a resource
122  */
123 void file_import(SPDocument *in_doc, const Glib::ustring &uri,
124                  Inkscape::Extension::Extension *key);
126 /*######################
127 ## E X P O R T
128 ######################*/
130 /**
131  * Displays a FileExportDialog for the user, with an
132  * additional type selection, to allow the user to export
133  * the a document as a given type.
134  */
135 bool sp_file_export_dialog (void *widget);
139 /*######################
140 ## P R I N T
141 ######################*/
143 /* These functions are redundant now, but
144 would be useful as instance methods
145 */
147 /**
148  *
149  */
150 void sp_file_print (void);
152 /**
153  *
154  */
155 void sp_file_print_direct (void);
157 /**
158  *
159  */
160 void sp_file_print_preview (gpointer object, gpointer data);
162 /*#####################
163 ## U T I L I T Y
164 #####################*/
166 /**
167  * clean unused defs out of file
168  */
169 void sp_file_vacuum ();
172 namespace Inkscape {
173 namespace IO {
175 void fixupHrefs( SPDocument *doc, const gchar *uri, gboolean spns );
181 #endif