00001 /* variablesmap.h 00002 * 00003 * Copyright (C) 2002 The libglademm Development Team 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public 00016 * License along with this library; if not, write to the Free 00017 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef _LIBGLADEMM_VARIABLESMAP_H 00021 #define _LIBGLADEMM_VARIABLESMAP_H 00022 00023 #include <libglademm/xml.h> 00024 #include <map> 00025 00026 namespace Gnome 00027 { 00028 00029 namespace Glade 00030 { 00031 00032 00039 class VariablesMap 00040 { 00041 public: 00042 explicit VariablesMap(const Glib::RefPtr<Glade::Xml>& glade); 00043 virtual ~VariablesMap(); 00044 00046 virtual void connect_widget(const Glib::ustring& widget_name, bool& variable); 00047 00049 virtual void connect_widget(const Glib::ustring& widget_name, Glib::ustring& variable); 00050 00052 virtual void transfer_widgets_to_variables(); 00053 00055 virtual void transfer_variables_to_widgets(); 00056 00057 protected: 00058 00062 virtual bool validate_widgets(); 00063 00064 virtual void transfer_one_widget(Gtk::Widget* pWidget, bool to_variable); 00065 00066 typedef std::map<Gtk::Widget*, void*> type_mapWidgetsToVariables; 00067 type_mapWidgetsToVariables m_mapWidgetsToVariables; 00068 00069 Glib::RefPtr<Glade::Xml> m_refGlade; 00070 }; 00071 00072 } /* namespace Glade */ 00073 } /* namespace Gnome */ 00074 00075 00076 00077 00078 #endif /* _LIBGLADEMM_VARIABLESMAP_H */ 00079 00080