GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

uimanager.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program 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 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GTK_UI_MANAGER_HH 00025 #define GFC_GTK_UI_MANAGER_HH 00026 00027 #ifndef GFC_G_OBJECT_HH 00028 #include <gfc/glib/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_ACTION_GROUP_H 00032 #include <gfc/gtk/actiongroup.hh> 00033 #endif 00034 00035 #ifndef __GTK_UI_MANAGER_H__ 00036 #include <gtk/gtkuimanager.h> 00037 #endif 00038 00039 #ifndef _CPP_VECTOR 00040 #include <vector> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace G { 00046 class Error; 00047 } 00048 00049 namespace Gtk { 00050 00051 class AccelGroup; 00052 class Widget; 00053 00056 00057 enum UIManagerItemType 00058 { 00059 UI_MANAGER_AUTO = GTK_UI_MANAGER_AUTO, 00060 UI_MANAGER_MENUBAR = GTK_UI_MANAGER_MENUBAR, 00061 UI_MANAGER_MENU = GTK_UI_MANAGER_MENU, 00062 UI_MANAGER_TOOLBAR = GTK_UI_MANAGER_TOOLBAR, 00063 UI_MANAGER_PLACEHOLDER = GTK_UI_MANAGER_PLACEHOLDER, 00064 UI_MANAGER_POPUP = GTK_UI_MANAGER_POPUP, 00065 UI_MANAGER_MENUITEM = GTK_UI_MANAGER_MENUITEM, 00066 UI_MANAGER_TOOLITEM = GTK_UI_MANAGER_TOOLITEM, 00067 UI_MANAGER_SEPARATOR = GTK_UI_MANAGER_SEPARATOR, 00068 UI_MANAGER_ACCELERATOR = GTK_UI_MANAGER_ACCELERATOR 00069 }; 00070 00072 00073 typedef unsigned int UIManagerItemTypeField; 00074 00205 00206 class UIManager : public G::Object 00207 { 00208 friend class G::Object; 00209 00210 UIManager(const UIManager&); 00211 UIManager& operator=(const UIManager&); 00212 00213 protected: 00216 00217 explicit UIManager(GtkUIManager *ui_manager, bool owns_reference = true); 00224 00227 00228 typedef G::Signal<void, Widget&> AddWidgetSignalType; 00229 typedef G::SignalProxy<TypeInstance, AddWidgetSignalType> AddWidgetSignalProxy; 00230 static const AddWidgetSignalType add_widget_signal; 00236 00237 typedef G::Signal<void> ActionsChangedSignalType; 00238 typedef G::SignalProxy<TypeInstance, ActionsChangedSignalType> ActionsChangedSignalProxy; 00239 static const ActionsChangedSignalType actions_changed_signal; 00244 00245 typedef G::Signal<void, Action&, Widget&> ConnectProxySignalType; 00246 typedef G::SignalProxy<TypeInstance, ConnectProxySignalType> ConnectProxySignalProxy; 00247 static const ConnectProxySignalType connect_proxy_signal; 00254 00255 typedef G::Signal<void, Action&, Widget&> DisconnectProxySignalType; 00256 typedef G::SignalProxy<TypeInstance, DisconnectProxySignalType> DisconnectProxySignalProxy; 00257 static const DisconnectProxySignalType disconnect_proxy_signal; 00264 00265 typedef G::Signal<void, Action&> PreActivateSignalType; 00266 typedef G::SignalProxy<TypeInstance, PreActivateSignalType> PreActivateSignalProxy; 00267 static const PreActivateSignalType pre_activate_signal; 00273 00274 typedef G::Signal<void, Action&> PostActivateSignalType; 00275 typedef G::SignalProxy<TypeInstance, PostActivateSignalType> PostActivateSignalProxy; 00276 static const PostActivateSignalType post_activate_signal; 00282 00284 00285 public: 00288 00289 UIManager(); 00291 00292 virtual ~UIManager(); 00294 00298 00299 GtkUIManager* gtk_ui_manager() const; 00301 00302 operator GtkUIManager* () const; 00304 00305 bool get_add_tearoffs() const; 00308 00309 bool get_action_groups(std::vector<ActionGroup*>& action_groups) const; 00313 00314 AccelGroup* get_accel_group() const; 00317 00318 Widget* get_widget(const char *path) const; 00319 Widget* get_widget(const String& path) const; 00331 00332 bool get_toplevels(std::vector<Widget*>& toplevels, UIManagerItemTypeField types) const; 00339 00340 Action* get_action(const char *path) const; 00344 00345 String get_ui() const; 00348 00352 00353 void set_add_tearoffs(bool add_tearoffs); 00359 00360 void insert_action_group(ActionGroup& action_group, int pos = 0); 00366 00367 void remove_action_group(ActionGroup& action_group); 00370 00371 unsigned int add_ui_from_string(const char *buffer, int length = -1, G::Error *error = 0); 00380 00381 unsigned int add_ui_from_string(const String& buffer, G::Error *error = 0); 00389 00390 unsigned int add_ui_from_file(const char *filename, G::Error *error = 0); 00391 unsigned int add_ui_from_file(const String& filename, G::Error *error = 0); 00399 00400 void add_ui(unsigned int merge_id, const char *path, const char *name, const char *action, 00401 UIManagerItemType type = UI_MANAGER_AUTO, bool top = false); 00402 void add_ui(unsigned int merge_id, const String& path, const String& name, const String& action, 00403 UIManagerItemType type = UI_MANAGER_AUTO, bool top = false); 00418 00419 void add_ui_separator(unsigned int merge_id, const char *path, const char *name, bool top = false); 00420 void add_ui_separator(unsigned int merge_id, const String& path, const String& name, bool top = false); 00426 00427 void remove_ui(unsigned int merge_id); 00430 00431 void ensure_update(); 00444 00445 unsigned int new_merge_id(); 00448 00452 00453 const AddWidgetSignalProxy sig_add_widget(); 00455 00456 const ActionsChangedSignalProxy sig_actions_changed(); 00458 00459 const ConnectProxySignalProxy sig_connect_proxy(); 00461 00462 const DisconnectProxySignalProxy sig_disconnect_proxy(); 00464 00465 const PreActivateSignalProxy sig_pre_activate(); 00467 00468 const PostActivateSignalProxy sig_post_activate(); 00470 00472 }; 00473 00474 } // namespace Gtk 00475 00476 } // namespace GFC 00477 00478 #include <gfc/gtk/inline/uimanager.inl> 00479 00480 #endif // GFC_GTK_UI_MANAGER_HH 00481

Generated on Tue Aug 24 00:34:32 2004 for GFC-UI by doxygen 1.3.8