filedialog.h revision 4325c73c705ad4c09590f8d4f1e62d849eeda096
/** @file
* @brief Virtual base definitions for native file dialogs
*/
/* Authors:
* Bob Jamison <rwjj@earthlink.net>
* Joel Holdsworth
* Inkscape Guys
*
* Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) 2007-2008 Joel Holdsworth
* Copyright (C) 2004-2008, Inkscape Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef __FILE_DIALOG_H__
#define __FILE_DIALOG_H__
#include <glibmm.h>
#include <vector>
#include <set>
#include <gtkmm.h>
}
}
{
{
{
/**
* Used for setting filters and options, and
* reading them back from user selections.
*/
typedef enum {
/**
* Used for returning the type selected in a SaveAs
*/
typedef enum {
/**
* Return true if the string ends with the given suffix
*/
/**
* Return true if the image is loadable by Gdk, else false
*/
/**
* This class provides an implementation-independent API for
* file "Open" dialogs. Using a standard interface obviates the need
* for ugly #ifdefs in file open code
*/
{
/**
* Constructor .. do not call directly
* @param path the directory where to start searching
* @param fileTypes one of FileDialogTypes
* @param title the title of the dialog
*/
{};
/**
* Factory.
* @param path the directory where to start searching
* @param fileTypes one of FileDialogTypes
* @param title the title of the dialog
*/
const char *title);
/**
* Destructor.
* Perform any necessary cleanups.
*/
virtual ~FileOpenDialog() {};
/**
* Show an OpenFile file selector.
* @return the selected path if user selected one, else NULL
*/
/**
* Return the 'key' (filetype) of the selection, if any
* @return a pointer to a string if successful (which must
* be later freed with g_free(), else NULL.
*/
/**
* Filename that was given
*/
}; //FileOpenDialog
/**
* This class provides an implementation-independent API for
* file "Save" dialogs.
*/
{
/**
* Constructor. Do not call directly . Use the factory.
* @param path the directory where to start searching
* @param fileTypes one of FileDialogTypes
* @param title the title of the dialog
* @param key a list of file types from which the user can select
*/
{};
/**
* Factory.
* @param path the directory where to start searching
* @param fileTypes one of FileDialogTypes
* @param title the title of the dialog
* @param key a list of file types from which the user can select
*/
const char *title,
const bool save_copy);
/**
* Destructor.
* Perform any necessary cleanups.
*/
virtual ~FileSaveDialog() {};
/**
* Show an SaveAs file selector.
* @return the selected path if user selected one, else NULL
*/
/**
* Return the 'key' (filetype) of the selection, if any
* @return a pointer to a string if successful (which must
* be later freed with g_free(), else NULL.
*/
/**
* Get the file name chosen by the user. Valid after an [OK]
*/
/**
* Get the document title chosen by the user. Valid after an [OK]
*/
/**
* Filename that was given
*/
/**
* Doc Title that was given
*/
/**
* List of known file extensions.
*/
}; //FileSaveDialog
/**
* This class provides an implementation-independent API for
* file "Export" dialogs. Saving as these types will not affect
* the original file.
*/
{
typedef enum
{
} ScopeType;
/**
* Constructor. Do not call directly . Use the factory.
* @param path the directory where to start searching
* @param fileTypes one of FileDialogTypes
* @param title the title of the dialog
* @param key a list of file types from which the user can select
*/
{}
/**
* Factory.
* @param path the directory where to start searching
* @param fileTypes one of FileDialogTypes
* @param title the title of the dialog
* @param key a list of file types from which the user can select
*/
const char *title,
/**
* Destructor.
* Perform any necessary cleanups.
*/
virtual ~FileExportDialog () {};
/**
* Show an SaveAs file selector.
* @return the selected path if user selected one, else NULL
*/
/**
* Return the 'key' (filetype) of the selection, if any
* @return a pointer to a string if successful (which must
* be later freed with g_free(), else NULL.
*/
/**
* Return the selected filename, if any. If not, return ""
*/
/**
* Return the scope of the export. One of the enumerated types
* in ScopeType
*/
/**
* Return left side of the exported region
*/
virtual double getSourceX() = 0;
/**
* Return the top of the exported region
*/
virtual double getSourceY() = 0;
/**
* Return the width of the exported region
*/
virtual double getSourceWidth() = 0;
/**
* Return the height of the exported region
*/
virtual double getSourceHeight() = 0;
/**
* Return the units of the coordinates of exported region
*/
/**
* Return the width of the destination document
*/
virtual double getDestinationWidth() = 0;
/**
* Return the height of the destination document
*/
virtual double getDestinationHeight() = 0;
/**
* Return the height of the exported region
*/
/**
* Return the destination DPI image resulution, if bitmap
*/
virtual double getDestinationDPI() = 0;
/**
* Return whether we should use Cairo for rendering
*/
virtual bool getUseCairo() = 0;
/**
* Return whether we should use antialiasing
*/
virtual bool getUseAntialias() = 0;
/**
* Return the background color for exporting
*/
virtual unsigned long getBackground() = 0;
}; //FileExportDialog
} //namespace Dialog
} //namespace UI
} //namespace Inkscape
#endif /* __FILE_DIALOG_H__ */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :