index c7c8009de6c34f518cc07620bd7e8ab36bab73bc..0953e76bc98136772c4585a08e9570836bea4e6e 100644 (file)
namespace Dialog
{
-
-/**
- * This class provides an implementation-independent API for
- * file "ExportToOCAL" dialogs.
- */
-class FileExportToOCALDialog
-{
-public:
-
- /**
- * Constructor. Do not call directly . Use the factory.
- * @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
- */
- FileExportToOCALDialog ()
- {};
-
- /**
- * Factory.
- * @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
- */
- static FileExportToOCALDialog *create(Gtk::Window& parentWindow,
- FileDialogType fileTypes,
- const Glib::ustring &title);
-
-
- /**
- * Destructor.
- * Perform any necessary cleanups.
- */
- virtual ~FileExportToOCALDialog() {};
-
-
- /**
- * Show an SaveAs file selector.
- * @return the selected path if user selected one, else NULL
- */
- virtual bool show() =0;
-
- virtual Glib::ustring getFilename () =0;
-
- /**
- * Change the window title.
- */
- virtual void change_title(const Glib::ustring& title) =0;
-
-
-}; //FileExportToOCAL
-
-/**
- * This class provides an implementation-independent API for
- * file "ExportToOCALPassword" dialogs.
- */
-class FileExportToOCALPasswordDialog
-{
-public:
-
- /**
- * Constructor. Do not call directly . Use the factory.
- * @param title the title of the dialog
- */
- FileExportToOCALPasswordDialog ()
- {};
-
- /**
- * Factory.
- * @param title the title of the dialog
- */
- static FileExportToOCALPasswordDialog *create(Gtk::Window& parentWindow,
- const Glib::ustring &title);
-
-
- /**
- * Destructor.
- * Perform any necessary cleanups.
- */
- virtual ~FileExportToOCALPasswordDialog() {};
-
-
- /**
- * Show 2 entry to input username and password.
- */
- virtual bool show() =0;
-
- virtual Glib::ustring getUsername () =0;
- virtual Glib::ustring getPassword () =0;
-
- /**
- * Change the window title.
- */
- virtual void change_title(const Glib::ustring& title) =0;
-
-
-}; //FileExportToOCALPassword
-
-
-
-/**
- * This class provides an implementation-independent API for
- * file "ImportFromOCAL" dialogs.
- */
-class FileImportFromOCALDialog
-{
-public:
-
-
- /**
- * 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
- */
- FileImportFromOCALDialog()
- {};
-
- /**
- * Factory.
- * @param path the directory where to start searching
- * @param fileTypes one of FileDialogTypes
- * @param title the title of the dialog
- */
- static FileImportFromOCALDialog *create(Gtk::Window& parentWindow,
- const Glib::ustring &path,
- FileDialogType fileTypes,
- const Glib::ustring &title);
-
-
- /**
- * Destructor.
- * Perform any necessary cleanups.
- */
- virtual ~FileImportFromOCALDialog() {};
-
- /**
- * Show an OpenFile file selector.
- * @return the selected path if user selected one, else NULL
- */
- virtual bool show() =0;
-
- /**
- * 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.
- */
- virtual Inkscape::Extension::Extension * getSelectionType() = 0;
-
- virtual Glib::ustring getFilename () =0;
-
-}; //FileImportFromOCALDialog
-
-
/*#########################################################################
### F I L E D I A L O G O C A L B A S E C L A S S
#########################################################################*/
public:
/**
- *
+ * Constructor
*/
- FileDialogOCALBase(const Glib::ustring &title) : Gtk::Dialog(title,true)
+ FileDialogOCALBase(const Glib::ustring &title, Gtk::Window& parent) : Gtk::Dialog(title, parent, true)
{}
+
/*
- *
+ * Destructor
*/
virtual ~FileDialogOCALBase()
{}
protected:
void cleanup( bool showConfirmed );
- //Glib::ustring preferenceBase;
/**
* What type of 'open' are we? (open, import, place, etc)
*/
//########################################################################
-
/**
* Our implementation of the FileExportToOCALDialog interface.
*/
-class FileExportToOCALDialogImpl : public FileExportToOCALDialog, public FileDialogOCALBase
+class FileExportToOCALDialog : public FileDialogOCALBase
{
public:
- FileExportToOCALDialogImpl(Gtk::Window& parentWindow,
+ /**
+ * Constructor
+ * @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
+ */
+ FileExportToOCALDialog(Gtk::Window& parentWindow,
FileDialogType fileTypes,
const Glib::ustring &title);
- virtual ~FileExportToOCALDialogImpl();
+ /**
+ * Destructor.
+ * Perform any necessary cleanups.
+ */
+ ~FileExportToOCALDialog();
+ /**
+ * Show an SaveAs file selector.
+ * @return the selected path if user selected one, else NULL
+ */
bool show();
Glib::ustring getFilename();
Glib::ustring myFilename;
+ /**
+ * Change the window title.
+ */
void change_title(const Glib::ustring& title);
-
+
private:
/**
* List of known file extensions.
*/
std::set<Glib::ustring> knownExtensions;
-};
+
+}; //FileExportToOCAL
//########################################################################
/**
* Our implementation of the FileExportToOCALPasswordDialog interface.
*/
-class FileExportToOCALPasswordDialogImpl : public FileExportToOCALPasswordDialog, public FileDialogOCALBase
+class FileExportToOCALPasswordDialog : public FileDialogOCALBase
{
public:
- FileExportToOCALPasswordDialogImpl(Gtk::Window& parentWindow,
+ /**
+ * Constructor
+ * @param title the title of the dialog
+ */
+ FileExportToOCALPasswordDialog(Gtk::Window& parentWindow,
const Glib::ustring &title);
- virtual ~FileExportToOCALPasswordDialogImpl();
+ /**
+ * Destructor.
+ * Perform any necessary cleanups.
+ */
+ ~FileExportToOCALPasswordDialog();
+
+ /**
+ * Show 2 entry to input username and password.
+ */
bool show();
Glib::ustring getUsername();
Glib::ustring getPassword();
+ /**
+ * Change the window title.
+ */
+ void change_title(const Glib::ustring& title);
+
Glib::ustring myUsername;
Glib::ustring myPassword;
- void change_title(const Glib::ustring& title);
-
private:
/**
Gtk::HBox userBox;
Gtk::HBox passBox;
-};
-
+}; //FileExportToOCALPassword
/**
* Our implementation class for the FileImportFromOCALDialog interface..
*/
-class FileImportFromOCALDialogImplGtk : public FileImportFromOCALDialog, public FileDialogOCALBase
+class FileImportFromOCALDialog : public FileDialogOCALBase
{
public:
-
- FileImportFromOCALDialogImplGtk(Gtk::Window& parentWindow,
+ /**
+ * Constructor
+ * @param path the directory where to start searching
+ * @param fileTypes one of FileDialogTypes
+ * @param title the title of the dialog
+ */
+ FileImportFromOCALDialog(Gtk::Window& parentWindow,
const Glib::ustring &dir,
FileDialogType fileTypes,
const Glib::ustring &title);
- virtual ~FileImportFromOCALDialogImplGtk();
+ /**
+ * Destructor.
+ * Perform any necessary cleanups.
+ */
+ ~FileImportFromOCALDialog();
+ /**
+ * Show an OpenFile file selector.
+ * @return the selected path if user selected one, else NULL
+ */
bool show();
+ /**
+ * 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.
+ */
Inkscape::Extension::Extension *getSelectionType();
Glib::ustring getFilename();
* The extension to use to write this file
*/
Inkscape::Extension::Extension *extension;
-};
-
+}; //FileImportFromOCALDialog
} //namespace Dialog