Code

User message context in extensions
[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"
23 #include "extension/system.h"
25 struct SPDesktop;
26 struct SPDocument;
28 namespace Inkscape {
29     namespace Extension {
30         struct Extension;
31     }
32 }
35 /*######################
36 ## N E W
37 ######################*/
39 /**
40  * Creates a new Inkscape document and window.
41  * Return value is a pointer to the newly created desktop.
42  */
43 SPDesktop* sp_file_new (const Glib::ustring &templ);
44 SPDesktop* sp_file_new_default (void);
46 /*######################
47 ## D E L E T E
48 ######################*/
50 /**
51  * Close the document/view
52  */
53 void sp_file_exit (void);
55 /*######################
56 ## O P E N
57 ######################*/
59 /**
60  * Opens a new file and window from the given URI
61  */
62 bool sp_file_open(
63     const Glib::ustring &uri,
64     Inkscape::Extension::Extension *key,
65     bool add_to_recent = true,
66     bool replace_empty = true
67     );
69 /**
70  * Displays a file open dialog. Calls sp_file_open on
71  * an OK.
72  */
73 void sp_file_open_dialog (Gtk::Window &parentWindow, gpointer object, gpointer data);
75 /**
76  * Reverts file to disk-copy on "YES"
77  */
78 void sp_file_revert_dialog ();
80 /*######################
81 ## S A V E
82 ######################*/
84 /*
85  * Added to make only the remote savings.
86  */
88 bool file_save_remote(SPDocument *doc, const Glib::ustring &uri,
89                  Inkscape::Extension::Extension *key, bool saveas, bool official);
91 /**
92  *
93  */
94 bool sp_file_save (Gtk::Window &parentWindow, gpointer object, gpointer data);
96 /**
97  *  Saves the given document.  Displays a file select dialog
98  *  to choose the new name.
99  */
100 bool sp_file_save_as (Gtk::Window &parentWindow, gpointer object, gpointer data);
102 /**
103  *  Saves a copy of the given document.  Displays a file select dialog
104  *  to choose a name for the copy.
105  */
106 bool sp_file_save_a_copy (Gtk::Window &parentWindow, gpointer object, gpointer data);
109 /**
110  *  Saves the given document.  Displays a file select dialog
111  *  if needed.
112  */
113 bool sp_file_save_document (Gtk::Window &parentWindow, SPDocument *document);
115 /* Do the saveas dialog with a document as the parameter */
116 bool sp_file_save_dialog (Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extension::FileSaveMethod save_method);
119 /*######################
120 ## I M P O R T
121 ######################*/
123 /**
124  * Displays a file selector dialog, to allow the
125  * user to import data into the current document.
126  */
127 void sp_file_import (Gtk::Window &parentWindow);
129 /**
130  * Imports a resource
131  */
132 void file_import(SPDocument *in_doc, const Glib::ustring &uri,
133                  Inkscape::Extension::Extension *key);
135 /*######################
136 ## E X P O R T
137 ######################*/
139 /**
140  * Displays a FileExportDialog for the user, with an
141  * additional type selection, to allow the user to export
142  * the a document as a given type.
143  */
144 bool sp_file_export_dialog (Gtk::Window &parentWindow);
147 /*######################
148 ## E X P O R T  T O  O C A L
149 ######################*/
151 /**
152  * Export the current document to OCAL
153  */
154 //void sp_file_export_to_ocal (Gtk::Window &parentWindow );
157 /**
158  * Export the current document to OCAL
159  */
160 //bool sp_file_export_to_ocal_dialog (void *widget);
163 /*######################
164 ## I M P O R T  F R O M  O C A L
165 ######################*/
167 /**
168  * Import a document from OCAL
169  */
170 void sp_file_import_from_ocal (Gtk::Window &parentWindow );
173 /*######################
174 ## P R I N T
175 ######################*/
177 /* These functions are redundant now, but
178 would be useful as instance methods
179 */
181 /**
182  *
183  */
184 void sp_file_print (Gtk::Window& parentWindow);
186 /**
187  *
188  */
189 void sp_file_print_preview (gpointer object, gpointer data);
191 /*#####################
192 ## U T I L I T Y
193 #####################*/
195 /**
196  * clean unused defs out of file
197  */
198 void sp_file_vacuum ();
201 #endif
204 /*
205   Local Variables:
206   mode:c++
207   c-file-style:"stroustrup"
208   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
209   indent-tabs-mode:nil
210   fill-column:99
211   End:
212 */
213 // vi: set autoindent shiftwidth=4 tabstop=8 filetype=cpp expandtab softtabstop=4 encoding=utf-8 textwidth=99 :