1 // This file is a part of Simple Launcher
3 // Copyright (C) 2006, 2007, Mikhail Sobolev
5 // Simple Launcher is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License version 2 as published by
7 // the Free Software Foundation.
9 // This program is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 // You should have received a copy of the GNU General Public License along with
15 // this program; if not, write to the Free Software Foundation, Inc., 51
16 // Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef _GCONF_WRAPPER_H_
19 #define _GCONF_WRAPPER_H_
23 #include <gconf/gconf-client.h>
25 class GConfClientWrapper {
26 friend class GConfKey;
30 ~GConfClientWrapper();
32 GConfKey getKey(const std::string&);
35 bool getBool(const std::string& name);
36 void setBool(const std::string& name, bool);
38 int getInt(const std::string& name);
39 void setInt(const std::string& name, int);
42 GConfClient *myClient;
47 GConfKey(GConfClientWrapper&, const std::string&);
48 GConfKey(const GConfKey& what) : myWrapper(what.myWrapper), myPath(what.myPath) { }
51 GConfKey& operator = (const GConfKey& what) {
52 myWrapper = what.myWrapper;
58 bool getBool(const std::string& name, bool defvalue = false);
59 void setBool(const std::string& name, bool value);
61 int getInt(const std::string& name, int defvalue = 0);
62 void setInt(const std::string& name, int value);
65 GConfClientWrapper& myWrapper;