00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
00025 namespace Bakery
00026 {
00027
00028 namespace Conf
00029 {
00030
00033 class AssociationBase : public SigC::Object
00034 {
00035 public:
00036 typedef SigC::Ptr<AssociationBase> AssociationPtr;
00037
00038 void add(const Glib::RefPtr<Gnome::Conf::Client>& conf_client);
00039 void load();
00040 void save();
00041
00042 protected:
00043 AssociationBase(const Glib::ustring& full_key, bool instant);
00044 AssociationBase(const AssociationBase& other);
00045 virtual ~AssociationBase();
00046
00047 bool is_instant() const;
00048 Glib::ustring get_key() const;
00049 Glib::RefPtr<const Gnome::Conf::Client> get_conf_client() const;
00050 Glib::RefPtr<Gnome::Conf::Client> get_conf_client();
00051
00052 typedef SigC::Slot0<void> Callback;
00053 virtual void connect_widget(Callback on_widget_changed) = 0;
00054 virtual void load_widget() = 0;
00055 virtual void save_widget() = 0;
00056
00057 void on_widget_changed();
00058 void on_conf_changed(guint cnxn_id, Gnome::Conf::Entry entry);
00059
00060 Glib::ustring m_key;
00061 bool m_instant;
00062 Glib::RefPtr<Gnome::Conf::Client> m_conf_client;
00063 };
00064
00065 }
00066
00067 }
00068
00069 #endif //BAKERY_CONFIGURATION_ASSOCIATIONBASE_H