libgnomeuimm 2.28.0
|
00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGNOMEUIMM_APP_H 00004 #define _LIBGNOMEUIMM_APP_H 00005 00006 00007 #include <glibmm.h> 00008 00009 // -*- C++ -*- 00010 /* $Id: app.hg,v 1.18 2003/08/27 18:03:20 murrayc Exp $ */ 00011 00012 /* app.hg, app.h for libgnomeuimm 00013 * 00014 * Copyright (C) 2000 The Gtk-- Development Team 00015 * Copyright (C) 1998 EMC Capital Management Inc. 00016 * Developed by Havoc Pennington <hp@pobox.com> 00017 * 00018 * Copyright (C) 1999 The Gtk-- Development Team 00019 * 00020 * This library is free software; you can redistribute it and/or 00021 * modify it under the terms of the GNU Lesser General Public 00022 * License as published by the Free Software Foundation; either 00023 * version 2.1 of the License, or (at your option) any later version. 00024 * 00025 * This library is distributed in the hope that it will be useful, 00026 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00027 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00028 * Lesser General Public License for more details. 00029 * 00030 * You should have received a copy of the GNU Lesser General Public 00031 * License along with this library; if not, write to the Free 00032 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00033 */ 00034 00035 #include <gtkmm/window.h> 00036 //#include <bonobomm/widgets/dock.h> 00037 #include <libgnomeuimm/app-helper.h> 00038 #include <libgnomeuimm/types.h> 00039 #include <libgnomeuimm/ui-items-stock.h> 00040 00041 00042 //#include <libgnome/gnome-i18n.h> 00043 #include <libgnomeui/gnome-app.h> 00044 #include <libgnomeui/gnome-app-util.h> 00045 #include <list> 00046 00047 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00048 typedef struct _GnomeApp GnomeApp; 00049 typedef struct _GnomeAppClass GnomeAppClass; 00050 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00051 00052 00053 namespace Gnome 00054 { 00055 00056 namespace UI 00057 { class App_Class; } // namespace UI 00058 00059 } // namespace Gnome 00060 namespace Gtk 00061 { 00062 class MenuBar; 00063 class Toolbar; 00064 } 00065 00066 namespace Gnome 00067 { 00068 00069 namespace UI 00070 { 00071 00072 00073 class App : public Gtk::Window 00074 { 00075 public: 00076 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00077 typedef App CppObjectType; 00078 typedef App_Class CppClassType; 00079 typedef GnomeApp BaseObjectType; 00080 typedef GnomeAppClass BaseClassType; 00081 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00082 00083 virtual ~App(); 00084 00085 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00086 00087 private: 00088 friend class App_Class; 00089 static CppClassType app_class_; 00090 00091 // noncopyable 00092 App(const App&); 00093 App& operator=(const App&); 00094 00095 protected: 00096 explicit App(const Glib::ConstructParams& construct_params); 00097 explicit App(GnomeApp* castitem); 00098 00099 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00100 00101 public: 00102 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00103 static GType get_type() G_GNUC_CONST; 00104 00105 00106 static GType get_base_type() G_GNUC_CONST; 00107 #endif 00108 00110 GnomeApp* gobj() { return reinterpret_cast<GnomeApp*>(gobject_); } 00111 00113 const GnomeApp* gobj() const { return reinterpret_cast<GnomeApp*>(gobject_); } 00114 00115 00116 public: 00117 //C++ methods used to invoke GTK+ virtual functions: 00118 #ifdef GLIBMM_VFUNCS_ENABLED 00119 #endif //GLIBMM_VFUNCS_ENABLED 00120 00121 protected: 00122 //GTK+ Virtual Functions (override these to change behaviour): 00123 #ifdef GLIBMM_VFUNCS_ENABLED 00124 #endif //GLIBMM_VFUNCS_ENABLED 00125 00126 //Default Signal Handlers:: 00127 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00128 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00129 00130 00131 private: 00132 00133 00134 public: 00135 App(const Glib::ustring& name); 00136 00141 App(const Glib::ustring& appname, const Glib::ustring& title); 00142 00143 /*** From gnome-app.h ***/ 00146 void set_menus(Gtk::MenuBar& menubar); 00147 00148 00151 void set_toolbar(Gtk::Toolbar& toolbar); 00152 00153 00154 void set_statusbar(Gtk::Widget& statusbar); 00155 00156 00160 void set_statusbar_custom(Gtk::Container& container, Gtk::Widget& statusbar); 00161 00162 00165 void set_contents(Gtk::Widget& contents); 00166 00167 00168 void add_toolbar(Gtk::Toolbar& toolbar, 00169 const Glib::ustring& name, 00170 BonoboDockItemBehavior behavior, 00171 BonoboDockPlacement placement, 00172 int band_num, 00173 int band_position, 00174 int offset); 00175 00176 00177 Gtk::Widget* add_docked(Gtk::Widget& widget, 00178 const Glib::ustring& name, 00179 BonoboDockItemBehavior behavior, 00180 BonoboDockPlacement placement, 00181 int band_num, 00182 int band_position, 00183 int offset); 00184 //TODO: 00185 00186 void add_dock_item(BonoboDockItem* item, 00187 BonoboDockPlacement placement, 00188 int band_num, 00189 int band_position, 00190 int offset); 00191 00192 00193 void enable_layout_config(gboolean enable); 00194 00195 00196 BonoboDock* get_dock(); 00197 00198 00199 BonoboDockItem* get_dock_item_by_name(const Glib::ustring& name); 00200 00201 00203 Items::Array<Items::SubTree>& create_menus(const Items::Array<Items::SubTree>& info); 00204 00209 Items::Array<Items::Info>& insert_menus(const Glib::ustring& path, const Items::Array<Items::Info>& menuinfo); 00210 00211 00212 void remove_menus(const Glib::ustring& path, int items); 00213 00214 00215 void remove_menu_range(const Glib::ustring& path, int start, int items); 00216 00221 void install_menu_hints(); 00222 00224 Items::Array<Items::Info>& create_toolbar(const Items::Array<Items::Info>& info); 00225 00226 00227 // These are probably not necessary. 00228 // Please tell us if you find any example of their use. 00229 // static void install_appbar_menu_hints (const AppBar& app, 00230 // UIInfoTree& menuinfo); 00231 // static void install_statusbar_menu_hints (const Gtk::Statusbar& bar, 00232 // UIInfoTree& menuinfo); 00233 00234 00235 private: 00240 void add(Gtk::Widget&); 00241 00242 Items::Array<Items::SubTree> menus_; 00243 Items::Array<Items::Info> toolbars_; 00244 00245 //To store dynamically-added Items::Info, 00246 //because GNOME does not make its own copy of some data. 00247 // e.g. see insert_menus(). 00248 std::list< Items::Array<Items::Info> > listUIArray_; 00249 00250 00251 }; 00252 00253 } /* namespace UI */ 00254 } /* namespace Gnome */ 00255 00256 00257 namespace Glib 00258 { 00267 Gnome::UI::App* wrap(GnomeApp* object, bool take_copy = false); 00268 } //namespace Glib 00269 00270 00271 #endif /* _LIBGNOMEUIMM_APP_H */ 00272