Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

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 extern "C" {
00028 typedef struct _EggRecentItem EggRecentItem;
00029 typedef struct _EggRecentModel EggRecentModel;
00030 }
00031 
00032 namespace Bakery
00033 {
00034 
00038 class App_WithDoc_Gtk
00039     //These are virtual base classes, with shared shared App and sigc::trackable base classes:
00040   : public App_WithDoc, 
00041     public App_Gtk
00042 {
00043 public:
00045   App_WithDoc_Gtk(const Glib::ustring& appname);
00046 
00048   App_WithDoc_Gtk(BaseObjectType* cobject, const Glib::ustring& appname);
00049 
00050   virtual ~App_WithDoc_Gtk();
00051 
00052   virtual void init(); //Unique final overrider.
00053 
00054   typedef sigc::slot<void, EggRecentItem*> RecentFileSlot;
00055 
00056 protected:
00057   virtual void init_menus_file(); //overridden to add open/save/save as.
00058   virtual void init_menus_file_recentfiles(const Glib::ustring& path); // call this in init_menus_file()
00059   virtual void init_toolbars(); //overridden to add open/save
00060   
00061   virtual void document_history_add(const Glib::ustring& strFilepath); //overridden.
00062   virtual void document_history_remove(const Glib::ustring& strFilepath); //overridden.
00063 
00064   virtual void update_window_title();
00065 
00066   virtual void ui_warning(const Glib::ustring& text);
00067   virtual Glib::ustring ui_file_select_open();
00068   virtual Glib::ustring ui_file_select_save(const Glib::ustring& old_filepath);
00069   virtual void ui_show_modification_status();
00070   virtual enumSaveChanges ui_offer_to_save_changes();
00071   virtual bool ui_ask_overwrite(const std::string& filepath);
00072 
00073 
00074   void on_recent_files_activate(EggRecentItem* item);
00075   
00076   //Menu stuff:
00077   Glib::RefPtr<Gtk::Action> m_action_save, m_action_saveas;
00078   EggRecentModel* m_recent_files_model;
00079   RecentFileSlot m_slot_recent_files_activate;
00080 };
00081 
00082 } //namespace
00083 
00084 #endif //BAKERY_APP_WITHDOC_GTK_H

Generated on Fri May 7 00:24:32 2004 for bakery by doxygen 1.3.6-20040222