Nemiver  0.3
nmv-i-pref-mgr.h
Go to the documentation of this file.
1 // Author: Dodji Seketeli
2 /*
3  *This file is part of the Nemiver project
4  *
5  *Nemiver is free software; you can redistribute
6  *it and/or modify it under the terms of
7  *the GNU General Public License as published by the
8  *Free Software Foundation; either version 2,
9  *or (at your option) any later version.
10  *
11  *Nemiver is distributed in the hope that it will
12  *be useful, but WITHOUT ANY WARRANTY;
13  *without even the implied warranty of
14  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *See the GNU General Public License for more details.
16  *
17  *You should have received a copy of the
18  *GNU General Public License along with Nemiver;
19  *see the file COPYING.
20  *If not, write to the Free Software Foundation,
21  *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  *See COPYRIGHT file copyright information.
24  */
25 #ifdef __NMV_PREF_MGR_H__
26 #define __NMV_PREF_MGR_H__
27 
28 #include <list>
29 #include <boost/variant.hpp>
31 #include "common/nmv-ustring.h"
32 
33 using namespace std;
35 using boost::variant;
36 
37 namespace nemiver {
38 
41 class NEMIVER_API IPrefMgr : public DynamicModule {
42 
43  //non copyable
44  IPrefMgr (const IPrefMgr&);
45  IPrefMgr& operator= (const IPrefMgr&);
46 
47 protected:
48  //must be created by the dynamic module factory
49  IPrefMgr () {}
50 
51 public:
52  class Pref {
53  UString m_name;
54  boost::variant<gint32, UString> m_value;
55 
56  public:
57  enum Type {
58  INT=0,
59  STRING=1
60  };
61 
62  Pref (gint32 a_in) :
63  m_value (a_in)
64  {}
65 
66  Pref (const UString &a_in) :
67  m_value (a_in)
68  {}
69 
70  void value (gint32 a_in) {m_value = a_in;}
71  void value (const UString &a_in) {m_value = a_in;}
72  const variant& value () {return m_value;}
73 
74  void name (const UString &a_in) {a_in = a_name;}
75  const UString& name () {return m_name;}
76  };//end class pref
77 
78  virtual ~IPrefMgr () {}
79 
80 };//end class IPrefMgr
81 
82 }//end namespace nemiver
83 
84 #endif //__NMV_PREF_MGR_H__
85 
nemiver
Definition: nmv-address.h:31
nmv-ustring.h
NEMIVER_API
#define NEMIVER_API
Definition: nmv-api-macros.h:53
nemiver::common::UString
Definition: nmv-ustring.h:45
nmv-dynamic-module.h