bakery  2.6
App_WithDoc_Gtk.h
Go to the documentation of this file.
1 /*
2  * Copyright 2000 Murray Cumming
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 
19 #ifndef BAKERY_APP_WITHDOC_GTK_H
20 #define BAKERY_APP_WITHDOC_GTK_H
21 
22 #include <bakery/App/App_WithDoc.h>
23 #include <bakery/App/App_Gtk.h>
25 #include <gtkmm/toolbutton.h>
26 #include <gtkmm/recentmanager.h>
27 
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 extern "C" {
30 typedef struct _EggRecentItem EggRecentItem;
31 }
32 
33 // We do not include gtkmm/recentchooser.h so that this still compiles
34 // with gtkmm-2.6
35 namespace Gtk {
36  class RecentChooser;
37 }
38 #endif // DOXYGEN_SHOULD_SKIP_THIS
39 
40 namespace Bakery
41 {
42 
51  //These are virtual base classes, with shared shared App and sigc::trackable base classes:
52  : public App_WithDoc,
53  public App_Gtk
54 {
55 public:
57  App_WithDoc_Gtk(const Glib::ustring& appname);
58 
60  App_WithDoc_Gtk(BaseObjectType* cobject, const Glib::ustring& appname);
61 
62  virtual ~App_WithDoc_Gtk();
63 
64  virtual void init(); //Unique final overrider.
65 
66 protected:
67  virtual void init_menus_file(); //overridden to add open/save/save as.
68  virtual void init_menus_file_recentfiles(const Glib::ustring& path); // call this in init_menus_file()
69  virtual void init_toolbars(); //overridden to add open/save
70 
71  virtual void document_history_add(const Glib::ustring& file_uri); //overridden.
72  virtual void document_history_remove(const Glib::ustring& file_uri); //overridden.
73 
74  virtual void update_window_title();
75 
76  virtual void ui_warning(const Glib::ustring& text, const Glib::ustring& secondary_text);
77  virtual Glib::ustring ui_file_select_open(const Glib::ustring& starting_folder_uri = Glib::ustring());
78  virtual Glib::ustring ui_file_select_save(const Glib::ustring& old_file_uri);
79  virtual void ui_show_modification_status();
80  virtual enumSaveChanges ui_offer_to_save_changes();
81 
82  void on_recent_files_activate(Gtk::RecentChooser& recent_chooser);
83 
84  //Menu stuff:
85  Glib::RefPtr<Gtk::Action> m_action_save, m_action_saveas;
86 };
87 
88 } //namespace
89 
90 #endif //BAKERY_APP_WITHDOC_GTK_H
Main Window which supports documents.
Definition: App_WithDoc.h:55
Glib::RefPtr< Gtk::Action > m_action_saveas
Definition: App_WithDoc_Gtk.h:85
enumSaveChanges
Definition: App_WithDoc.h:65
void init()
Saves you the trouble of initializing gconfmm and libglademm yourself.
This class implements Bakery::App_WithDoc using gtkmm.
Definition: App_WithDoc_Gtk.h:50
Definition: App.h:29
This class implements Bakery::App using gtkmm.
Definition: App_Gtk.h:46