X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fui%2Fdialog%2Focaldialogs.h;h=0953e76bc98136772c4585a08e9570836bea4e6e;hb=fb2c6b206989f303ea4a7e97876eaebf674aa07d;hp=5a06ba4f534e744361b287989644582e6d8fd7d5;hpb=0f5aa157f7c7947699cb72b896da454a43145e36;p=inkscape.git diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index 5a06ba4f5..0953e76bc 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -64,170 +64,6 @@ namespace UI 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, - const Glib::ustring &default_key); - - - /** - * 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; - - /** - * 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 void setSelectionType( Inkscape::Extension::Extension * key ) = 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 #########################################################################*/ @@ -240,12 +76,13 @@ class FileDialogOCALBase : public Gtk::Dialog 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() {} @@ -253,7 +90,6 @@ public: protected: void cleanup( bool showConfirmed ); - //Glib::ustring preferenceBase; /** * What type of 'open' are we? (open, import, place, etc) */ @@ -268,33 +104,44 @@ protected: //######################################################################## - /** * 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, - const Glib::ustring &default_key); + 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(); - Inkscape::Extension::Extension *getSelectionType(); - virtual void setSelectionType( Inkscape::Extension::Extension * key ); - Glib::ustring getFilename(); Glib::ustring myFilename; + /** + * Change the window title. + */ void change_title(const Glib::ustring& title); - void updateNameAndExtension(); - + private: /** @@ -302,13 +149,6 @@ private: */ Gtk::Entry *fileNameEntry; - - /** - * Allow the specification of the output file type - */ - Gtk::ComboBoxText fileTypeComboBox; - - /** * Data mirror of the combo box */ @@ -319,19 +159,6 @@ private: Gtk::VBox checksBox; Gtk::HBox fileBox; - Gtk::CheckButton fileTypeCheckbox; - - /** - * Callback for user choose a fileType - */ - void fileTypeChangedCallback(); - - /** - * Create a filter menu for this type of dialog - */ - void createFileTypeMenu(); - - /** * The extension to use to write this file */ @@ -346,7 +173,8 @@ private: * List of known file extensions. */ std::set knownExtensions; -}; + +}; //FileExportToOCAL //######################################################################## @@ -357,25 +185,40 @@ private: /** * 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: /** @@ -389,8 +232,7 @@ private: Gtk::HBox userBox; Gtk::HBox passBox; -}; - +}; //FileExportToOCALPassword @@ -404,34 +246,58 @@ private: class FileListViewText : public Gtk::ListViewText { public: - FileListViewText(guint columns_count, SVGPreview& filesPreview):ListViewText(columns_count) + FileListViewText(guint columns_count, SVGPreview& filesPreview, Gtk::Label& description, Gtk::Button& okButton) + :ListViewText(columns_count) { myPreview = &filesPreview; + myLabel = &description; + myButton = &okButton; } Glib::ustring getFilename(); protected: void on_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); + void on_cursor_changed(); private: Glib::ustring myFilename; SVGPreview *myPreview; + Gtk::Label *myLabel; + Gtk::Button *myButton; }; /** * 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(); @@ -445,11 +311,15 @@ private: FileListViewText *filesList; SVGPreview *filesPreview; Gtk::Label *notFoundLabel; + Gtk::Label *descriptionLabel; + Gtk::Button *searchButton; + Gtk::Button *okButton; // Child widgets Gtk::HBox tagBox; Gtk::HBox filesBox; Gtk::HBox messageBox; + Gtk::HBox descriptionBox; Gtk::ScrolledWindow listScrolledWindow; Glib::RefPtr selection; @@ -469,9 +339,8 @@ private: * The extension to use to write this file */ Inkscape::Extension::Extension *extension; -}; - +}; //FileImportFromOCALDialog } //namespace Dialog