App_WithDoc_Gtk.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2000 Murray Cumming
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the Free
00016  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 #ifndef BAKERY_APP_WITHDOC_GTK_H
00020 #define BAKERY_APP_WITHDOC_GTK_H
00021 
00022 #include <bakery/App/App_WithDoc.h>
00023 #include <bakery/App/App_Gtk.h>
00024 #include <bakery/Document/Document.h>
00025 #include <gtkmm/toolbutton.h>
00026 
00027 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00028 extern "C" {
00029 typedef struct _EggRecentItem EggRecentItem;
00030 }
00031 
00032 // We do not include gtkmm/recentchooser.h so that this still compiles
00033 // with gtkmm-2.6
00034 namespace Gtk {
00035   class RecentChooser;
00036 }
00037 #endif // DOXYGEN_SHOULD_SKIP_THIS
00038 
00039 namespace Bakery
00040 {
00041 
00049 class App_WithDoc_Gtk
00050     //These are virtual base classes, with shared shared App and sigc::trackable base classes:
00051   : public App_WithDoc, 
00052     public App_Gtk
00053 {
00054 public:
00056   App_WithDoc_Gtk(const Glib::ustring& appname);
00057 
00059   App_WithDoc_Gtk(BaseObjectType* cobject, const Glib::ustring& appname);
00060 
00061   virtual ~App_WithDoc_Gtk();
00062 
00063   virtual void init(); //Unique final overrider.
00064 
00065 protected:
00066   virtual void init_menus_file(); //overridden to add open/save/save as.
00067   virtual void init_menus_file_recentfiles(const Glib::ustring& path); // call this in init_menus_file()
00068   virtual void init_toolbars(); //overridden to add open/save
00069 
00070   virtual void document_history_add(const Glib::ustring& file_uri); //overridden.
00071   virtual void document_history_remove(const Glib::ustring& file_uri); //overridden.
00072 
00073   virtual void update_window_title();
00074 
00075   virtual void ui_warning(const Glib::ustring& text, const Glib::ustring& secondary_text);
00076   virtual Glib::ustring ui_file_select_open(const Glib::ustring& starting_folder_uri = Glib::ustring());
00077   virtual Glib::ustring ui_file_select_save(const Glib::ustring& old_file_uri);
00078   virtual void ui_show_modification_status();
00079   virtual enumSaveChanges ui_offer_to_save_changes();
00080 
00081   void on_recent_files_activate(Gtk::RecentChooser& recent_chooser);
00082 
00083   //Menu stuff:
00084   Glib::RefPtr<Gtk::Action> m_action_save, m_action_saveas;
00085 
00086 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00087   // TODO: We do not need these anymore, but we cannot remove them now if
00088   // we do not want to break ABI
00089   void* m_deprecated_recent_files_model;
00090   typedef sigc::slot<void, EggRecentItem*> SlotDeprecated;
00091   SlotDeprecated m_slot_deprecated;
00092 #endif //DOXYGEN_SHOULD_SKIP_THIS
00093 };
00094 
00095 } //namespace
00096 
00097 #endif //BAKERY_APP_WITHDOC_GTK_H

Generated on Thu Jan 17 07:46:28 2008 for bakery by  doxygen 1.5.4