gconfmm  2.28.0
callback.h
Go to the documentation of this file.
1 // $Id$ -*- c++ -*-
2 
3 /* callback.h
4  *
5  * Copyright (C) 2000-2002 GConfmm Development Team
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free
19  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 
22 #ifndef GCONFMM_CALLBACK_H
23 #define GCONFMM_CALLBACK_H
24 
25 extern "C"
26 {
27 #include <gconf/gconf-client.h>
28 }
29 
30 #include <glibmm/object.h>
31 #include <gconfmm/entry.h>
32 
33 namespace Gnome
34 {
35 
36 namespace Conf
37 {
38 
39 typedef sigc::slot<void, guint, Entry> Callback;
40 
41 class Client;
42 
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44 class CallbackHolder
45 {
46 public:
47 
48  CallbackHolder(Callback slot);
49  ~CallbackHolder();
50 
51  void add(Client* pObj);
52 
53  Callback m_Slot;
54 
55  static void destroy(void *data);
56  static void call(GConfClient *client, guint i, GConfEntry *entry, void *data);
57 };
58 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
59 
60 } /* namespace Conf */
61 } /* namespace Gnome */
62 
63 #endif //GCONFMM_CALLBACK_H