00001 /* 00002 * Copyright 2002 The Bakery team 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) any later version. 00008 * 00009 * This library 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 GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this library; if not, write to the Free 00016 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef BAKERY_CONFIGURATION_ASSOCIATION_H 00020 #define BAKERY_CONFIGURATION_ASSOCIATION_H 00021 00022 #include "bakery/Configuration/AssociationBase.h" 00023 00024 namespace Bakery 00025 { 00026 namespace Conf 00027 { 00028 00029 template< class T_Widget > 00030 class Association : public AssociationBase 00031 { 00032 public: 00033 static const AssociationPtr create(const Glib::ustring& full_key, T_Widget& widget, bool instant) 00034 { 00035 return AssociationPtr(SigC::manage(new Association(full_key,widget,instant))); 00036 } 00037 00038 virtual ~Association() 00039 { 00040 } 00041 00046 virtual void connect_widget(Callback on_widget_changed); 00047 virtual void load_widget(); 00048 virtual void save_widget(); 00049 00050 protected: 00051 Association(const Glib::ustring& full_key, T_Widget& widget, bool instant) 00052 : AssociationBase(full_key,instant), m_widget(widget) 00053 { 00054 } 00055 00056 Association(const Association& other); // Not implemented 00057 00058 private: 00059 T_Widget& m_widget; 00060 }; 00061 00062 } //namespace Conf 00063 00064 } //namespace Bakery 00065 00066 #endif //BAKERY_CONFIGURATION_ASSOCIATION_H