AssociationBase.h

Go to the documentation of this file.
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_ASSOCIATIONBASE_H
00020 #define BAKERY_CONFIGURATION_ASSOCIATIONBASE_H
00021 
00022 #include <gconfmm.h>
00023 #include <gtkmm/widget.h>
00024 #include <bakery/Utilities/sharedptr.h>
00025 
00026 namespace Bakery
00027 {
00028 
00029 namespace Conf
00030 {
00031 
00034 class AssociationBase : public sigc::trackable
00035 {
00036 public:
00037   typedef sharedptr<AssociationBase> AssociationPtr;
00038   typedef sharedptr<const AssociationBase> AssociationConstPtr;
00039     
00040   void add(const Glib::RefPtr<Gnome::Conf::Client>& conf_client);
00041   void load();
00042   void save();
00043 
00044   virtual ~AssociationBase();
00045     
00046 protected:
00047   AssociationBase(const Glib::ustring& full_key, bool instant);
00048   AssociationBase(const AssociationBase& other); // Not implemented
00049 
00050 
00051   bool is_instant() const;
00052   Glib::ustring get_key() const;
00053   Glib::RefPtr<const Gnome::Conf::Client> get_conf_client() const;
00054   Glib::RefPtr<Gnome::Conf::Client> get_conf_client();
00055     
00056   typedef sigc::slot<void> Callback;
00057   virtual void connect_widget(Callback on_widget_changed) = 0;
00058   virtual void load_widget() = 0;
00059   virtual void save_widget() = 0;
00060 
00061   void on_widget_changed();
00062   void on_conf_changed(guint cnxn_id, Gnome::Conf::Entry entry);
00063 
00064   Glib::ustring m_key;
00065   bool m_instant;
00066   Glib::RefPtr<Gnome::Conf::Client> m_conf_client;
00067 };
00068 
00069 } //namespace Conf
00070 
00071 } //namespace Bakery
00072 
00073 #endif //BAKERY_CONFIGURATION_ASSOCIATIONBASE_H

Generated on Thu Aug 24 08:45:28 2006 for bakery by  doxygen 1.4.7