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 00049 class VariablesMap 00050 { 00051 public: 00052 explicit VariablesMap(const Glib::RefPtr<Glade::Xml>& glade); 00053 virtual ~VariablesMap(); 00054 00056 virtual void connect_widget(const Glib::ustring& widget_name, bool& variable); 00057 00059 virtual void connect_widget(const Glib::ustring& widget_name, Glib::ustring& variable); 00060 00062 virtual void connect_widget(const Glib::ustring& widget_name, double& variable); 00063 00065 virtual void connect_widget(const Glib::ustring& widget_name, Glib::Date& variable); 00066 00068 virtual void transfer_widgets_to_variables(); 00069 00071 virtual void transfer_variables_to_widgets(); 00072 00073 protected: 00074 00078 virtual bool validate_widgets(); 00079 00080 virtual void transfer_one_widget(Gtk::Widget* pWidget, bool to_variable); 00081 00082 typedef std::map<Gtk::Widget*, void*> type_mapWidgetsToVariables; 00083 type_mapWidgetsToVariables m_mapWidgetsToVariables; 00084 00085 Glib::RefPtr<Glade::Xml> m_refGlade; 00086 }; 00087 00088 } /* namespace Glade */ 00089 } /* namespace Gnome */ 00090 00091 00092 00093 00094 #endif /* _LIBGLADEMM_VARIABLESMAP_H */ 00095 00096
1.4.6