Code

convert almost all libnrtype to Geom::
[inkscape.git] / src / ui / dialog / filedialogimpl-gtkmm.h
index e5058d0c207f6f2def2584381753bd7ff2b26c94..5137b8481add3fbe9865b48033e1c33c6c32c247 100644 (file)
  *
  * Copyright (C) 2004-2007 Bob Jamison
  * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
+ * Copyright (C) 2007-2008 Joel Holdsworth
  * Copyright (C) 2004-2007 The Inkscape Organization
- * Copyright (C) 2007 Joel Holdsworth
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
+
 #include "filedialog.h"
+
 //General includes
 #include <unistd.h>
 #include <sys/stat.h>
 #include <errno.h>
-#include <set>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
@@ -55,7 +54,7 @@
 
 //For export dialog
 #include "ui/widget/scalar-unit.h"
+
 namespace Inkscape
 {
 namespace UI
@@ -164,10 +163,10 @@ public:
      *
      */
     FileDialogBaseGtk(Gtk::Window& parentWindow, const Glib::ustring &title,
-               FileDialogType type, gchar const* preferenceBase) :
-        Gtk::FileChooserDialog(parentWindow, title),
+               Gtk::FileChooserAction dialogType, FileDialogType type, gchar const* preferenceBase) :
+        Gtk::FileChooserDialog(parentWindow, title, dialogType),
         preferenceBase(preferenceBase ? preferenceBase : "unknown"),
-        dialogType(type)
+        _dialogType(type)
     {
         internalSetup();
     }
@@ -175,11 +174,11 @@ public:
     /**
      *
      */
-    FileDialogBaseGtk(Gtk::Window& parentWindow, const Glib::ustring &title,
+    FileDialogBaseGtk(Gtk::Window& parentWindow, const char *title,
                    Gtk::FileChooserAction dialogType, FileDialogType type, gchar const* preferenceBase) :
         Gtk::FileChooserDialog(parentWindow, title, dialogType),
         preferenceBase(preferenceBase ? preferenceBase : "unknown"),
-        dialogType(type)
+        _dialogType(type)
     {
         internalSetup();
     }
@@ -197,14 +196,16 @@ protected:
     /**
      * What type of 'open' are we? (open, import, place, etc)
      */
-    FileDialogType dialogType;
+    FileDialogType _dialogType;
 
     /**
      * Our svg preview widget
      */
     SVGPreview svgPreview;
 
-    //# Child widgets
+    /**
+        * Child widgets
+        */
     Gtk::CheckButton previewCheckbox;
 
 private:
@@ -248,7 +249,9 @@ public:
 
     Glib::ustring getFilename();
 
-    std::vector<Glib::ustring> getFilenames ();
+    std::vector<Glib::ustring> getFilenames();
+
+       Glib::ustring getCurrentDirectory();
 
 private:
 
@@ -267,11 +270,6 @@ private:
      */
     Inkscape::Extension::Extension *extension;
 
-    /**
-     * Filename that was given
-     */
-    Glib::ustring myFilename;
-
 };
 
 
@@ -287,11 +285,12 @@ class FileSaveDialogImplGtk : public FileSaveDialog, public FileDialogBaseGtk
 {
 
 public:
-    FileSaveDialogImplGtk(Gtk::Window &parentWindow, 
+    FileSaveDialogImplGtk(Gtk::Window &parentWindow,
                           const Glib::ustring &dir,
                        FileDialogType fileTypes,
                        const Glib::ustring &title,
-                       const Glib::ustring &default_key);
+                       const Glib::ustring &default_key,
+                       const gchar* docTitle);
 
     virtual ~FileSaveDialogImplGtk();
 
@@ -300,14 +299,13 @@ public:
     Inkscape::Extension::Extension *getSelectionType();
     virtual void setSelectionType( Inkscape::Extension::Extension * key );
 
-    Glib::ustring getFilename();
+       Glib::ustring getCurrentDirectory();
 
-    void change_title(const Glib::ustring& title);
+private:
+    //void change_title(const Glib::ustring& title);
     void change_path(const Glib::ustring& path);
     void updateNameAndExtension();
 
-private:
-
     /**
      * Fix to allow the user to type the file name
      */
@@ -351,16 +349,6 @@ private:
      * Callback for user input into fileNameEntry
      */
     void fileNameEntryChangedCallback();
-
-    /**
-     * Filename that was given
-     */
-    Glib::ustring myFilename;
-
-    /**
-     * List of known file extensions.
-     */
-    std::set<Glib::ustring> knownExtensions;
 };
 
 
@@ -394,10 +382,10 @@ public:
 
     /**
      * Return the scope of the export.  One of the enumerated types
-     * in ScopeType     
+     * in ScopeType
      */
     ScopeType getScope()
-        { 
+        {
         if (pageButton.get_active())
             return SCOPE_PAGE;
         else if (selectionButton.get_active())
@@ -408,25 +396,25 @@ public:
             return SCOPE_DOCUMENT;
 
         }
-    
+
     /**
      * Return left side of the exported region
      */
     double getSourceX()
         { return sourceX0Spinner.getValue(); }
-    
+
     /**
      * Return the top of the exported region
      */
     double getSourceY()
         { return sourceY1Spinner.getValue(); }
-    
+
     /**
      * Return the width of the exported region
      */
     double getSourceWidth()
         { return sourceWidthSpinner.getValue(); }
-    
+
     /**
      * Return the height of the exported region
      */