1
#ifndef __FILE_DIALOG_H__
2
#define __FILE_DIALOG_H__
4
/** \file Defines classes FileOpenDialog, FileSaveDialog,
5
* and enums FileDialogType, FileDialogSelectionType. */
7
#include <glib/gtypes.h>
8
#include <glibmm/slisthandle.h>
21
* Used for setting filters and options, and
22
* reading them back from user selections.
31
* Used for returning the type selected in a SaveAs
35
SVG_NAMESPACE_WITH_EXTENSIONS
36
} FileDialogSelectionType;
39
* Architecture-specific data
41
typedef struct FileOpenNativeData_def FileOpenNativeData;
45
* This class provides an implementation-independent API for
46
* file "Open" dialogs. Using a standard interface obviates the need
47
* for ugly #ifdefs in file open code
55
* Constructor .. do not call directly
56
* @param path the directory where to start searching
57
* @param fileTypes one of FileDialogTypes
58
* @param title the title of the dialog
65
* @param path the directory where to start searching
66
* @param fileTypes one of FileDialogTypes
67
* @param title the title of the dialog
69
static FileOpenDialog *create(const char *path, FileDialogType fileTypes, const char *title);
74
* Perform any necessary cleanups.
76
virtual ~FileOpenDialog() {};
79
* Show an OpenFile file selector.
80
* @return the selected path if user selected one, else NULL
82
virtual bool show() =0;
85
* Return the 'key' (filetype) of the selection, if any
86
* @return a pointer to a string if successful (which must
87
* be later freed with g_free(), else NULL.
89
virtual Inkscape::Extension::Extension * getSelectionType() = 0;
91
virtual gchar * getFilename () =0;
93
virtual Glib::SListHandle<Glib::ustring> getFilenames () = 0;
103
* This class provides an implementation-independent API for
104
* file "Save" dialogs.
111
* Constructor. Do not call directly . Use the factory.
112
* @param path the directory where to start searching
113
* @param fileTypes one of FileDialogTypes
114
* @param title the title of the dialog
115
* @param key a list of file types from which the user can select
122
* @param path the directory where to start searching
123
* @param fileTypes one of FileDialogTypes
124
* @param title the title of the dialog
125
* @param key a list of file types from which the user can select
127
static FileSaveDialog *create(const char *path, FileDialogType fileTypes, const char *title, const char * default_key);
132
* Perform any necessary cleanups.
134
virtual ~FileSaveDialog() {};
138
* Show an SaveAs file selector.
139
* @return the selected path if user selected one, else NULL
141
virtual bool show() =0;
144
* Return the 'key' (filetype) of the selection, if any
145
* @return a pointer to a string if successful (which must
146
* be later freed with g_free(), else NULL.
148
virtual Inkscape::Extension::Extension * getSelectionType() = 0;
150
virtual gchar * getFilename () =0;
156
} //namespace Dialogs
158
} //namespace Inkscape
161
#endif /* __FILE_DIALOG_H__ */
166
c-file-style:"stroustrup"
167
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
172
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :