00001 /* Gxsm - Gnome X Scanning Microscopy 00002 * universal STM/AFM/SARLS/SPALEED/... controlling and 00003 * data analysis software 00004 * 00005 * Copyright (C) 1999,2000,2001,2002,2003 Percy Zahl 00006 * 00007 * Authors: Percy Zahl <zahl@users.sf.net> 00008 * additional features: Andreas Klust <klust@users.sf.net> 00009 * WWW Home: http://gxsm.sf.net 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 00024 */ 00025 00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */ 00027 00028 #ifndef __GXSM_CONF_H 00029 #define __GXSM_CONF_H 00030 00031 #include <gconf/gconf-client.h> 00032 00033 /* Generalize Rescoure Management 00034 * Prefix allows to save different Value Sets by name 00035 */ 00036 class XsmRescourceManager{ 00037 public: 00038 XsmRescourceManager(const gchar *prefix = NULL, const gchar *group = NULL); 00039 ~XsmRescourceManager(); 00040 00041 void SetGroup(const gchar *group = NULL); 00042 gchar* KeyTranslate(const gchar *name); 00043 00044 void PutBool(gchar *name, gboolean value); 00045 void Put(gchar *name, double value); 00046 void Put(gchar *name, int value); 00047 void Put(gchar *name, gchar *value); 00048 00049 gboolean GetBool(gchar *name, gboolean defaultv=FALSE); 00050 int Get(gchar *name, double *value, gchar *defaultv=NULL); 00051 int Get(gchar *name, int *value, gchar *defaultv=NULL); 00052 int Get(gchar *name, gchar **value, gchar *defaultv=NULL); 00053 gchar *GetStr(gchar *name, gchar *defaultv=NULL); 00054 private: 00055 GConfClient *client; 00056 gchar *Prefix; 00057 gchar *Group; 00058 }; 00059 00060 #endif /* __GXSM_CONF_H */