File: CGConf.h

package info (click to toggle)
fireflier 1.1.6-3etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 3,348 kB
  • ctags: 1,167
  • sloc: sh: 9,023; cpp: 8,370; makefile: 437; ansic: 300
file content (41 lines) | stat: -rw-r--r-- 883 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef _CGCONF_H_
#define _CGCONF_H_

#include <gconfmm.h>
#include <map>
#include <glibmm/ustring.h>

using Glib::ustring;


class CGConfUI
{
public:
	typedef std::map <const ustring, Gnome::Conf::Value> contEntries;
	

private:
	contEntries m_contEntries;
	Glib::RefPtr <Gnome::Conf::Client> m_pGConfClient;


public:
	void add_dir(	Glib::RefPtr <Gnome::Conf::Client>& pGConfClient, 
					const ustring& strDir, 
					SigC::Slot2 <void, const ustring&, const Gnome::Conf::Value&> slotValueChanged, 
					Gnome::Conf::ClientPreloadType enPreloadType = Gnome::Conf::CLIENT_PRELOAD_ONELEVEL);
	
	Gnome::Conf::Value& operator [](const ustring& strKey)
	{
		return m_contEntries[strKey];
	}
	
	void write()
	{
		
		for (contEntries::const_iterator it = m_contEntries.begin(), itEnd = m_contEntries.end(); it != itEnd; it++)
			m_pGConfClient->set(it->first, it->second);
	}
};

#endif