gconfmm  2.28.0
value.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GCONFMM_VALUE_H
4 #define _GCONFMM_VALUE_H
5 
6 
7 #include <glibmm.h>
8 
9 // -*- Mode: C++; c-basic-offset: 4 -*-
10 /* $Id: value.hg,v 1.3 2004/12/12 22:04:01 murrayc Exp $ */
11 
12 /* value.hg
13  *
14  * Copyright (C) 2000-2002 GConfmm Development Team
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free
28  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29  */
30 
31 #include <glibmm/ustring.h>
33 
34 
35 namespace Gnome
36 {
37 
38 namespace Conf
39 {
40 
47 {
56 };
57 
58 } // namespace Conf
59 
60 } // namespace Gnome
61 
62 
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64 namespace Glib
65 {
66 
67 template <>
68 class Value<Gnome::Conf::ValueType> : public Glib::Value_Enum<Gnome::Conf::ValueType>
69 {
70 public:
71  static GType value_type() G_GNUC_CONST;
72 };
73 
74 } // namespace Glib
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
76 
77 
78 namespace Gnome
79 {
80 
81 namespace Conf
82 {
83 
88 {
90 };
91 
92 } // namespace Conf
93 
94 } // namespace Gnome
95 
96 
97 #ifndef DOXYGEN_SHOULD_SKIP_THIS
98 namespace Glib
99 {
100 
101 template <>
102 class Value<Gnome::Conf::UnsetFlags> : public Glib::Value_Enum<Gnome::Conf::UnsetFlags>
103 {
104 public:
105  static GType value_type() G_GNUC_CONST;
106 };
107 
108 } // namespace Glib
109 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
110 
111 
112 namespace Gnome
113 {
114 
115 namespace Conf
116 {
117 
118 
119 typedef std::pair<Value, Value> ValuePair;
120 typedef std::pair<ValueType, ValueType> ValueTypePair;
121 
141 class Value
142 {
143  public:
144 #ifndef DOXYGEN_SHOULD_SKIP_THIS
145  typedef Value CppObjectType;
146  typedef GConfValue BaseObjectType;
147 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
148 
149 
150  // Use make_a_copy=true when getting it directly from a struct.
151  explicit Value(GConfValue* castitem, bool make_a_copy = false);
152 
153  Value(const Value& src);
154  Value& operator=(const Value& src);
155 
156  ~Value();
157 
158  GConfValue* gobj() { return gobject_; }
159  const GConfValue* gobj() const { return gobject_; }
160 
162  GConfValue* gobj_copy() const;
163 
164 protected:
166 
167 private:
168 
169 
170 public:
171 
176  Value(ValueType type = VALUE_INVALID);
177 
181  void set(gint val);
182 
187  void set(gdouble val);
188 
191  void set(bool val);
192 
195  void set(const Schema& sc);
196 
199  void set_car(const Value& car);
200 
203  void set_cdr(const Value& cdr);
204 
207  void set(const Glib::ustring& val);
208 
209 
212  void set_list_type(ValueType type);
213 
219  void set_int_list(const SListHandle_ValueInt& list);
220 
224  void set_bool_list(const SListHandle_ValueBool& list);
225 
229  void set_float_list(const SListHandle_ValueFloat& list);
230 
234  void set_string_list(const SListHandle_ValueString& list);
235 
239  void set_schema_list(const SListHandle_ValueSchema& list);
240 
241 
245  ValueType get_type() const;
246 
247 
253  ValueType get_list_type() const;
254 
257  int get_int() const;
258 
261  bool get_bool() const;
262 
265  double get_float() const;
266 
269  Glib::ustring get_string() const;
270 
271 
273  Schema get_schema() const;
274 
275 
277  Value get_car() const;
278 
280  Value get_cdr() const;
281 
291  SListHandle_ValueFloat get_float_list() const;
292 
297  SListHandle_ValueInt get_int_list() const;
298 
303  SListHandle_ValueBool get_bool_list() const;
304 
309  SListHandle_ValueString get_string_list() const;
310 
315  SListHandle_ValueSchema get_schema_list() const;
316 
322  Glib::ustring to_string() const;
323 
324 
325 };
326 
327 } /* namespace Conf */
328 } /* namespace Gnome */
329 
330 
331 namespace Glib
332 {
333 
342 Gnome::Conf::Value wrap(GConfValue* object, bool take_copy = false);
343 
344 } // namespace Glib
345 
346 
347 #endif /* _GCONFMM_VALUE_H */
348 
std::pair< ValueType, ValueType > ValueTypePair
Definition: value.h:120
const GConfValue * gobj() const
Definition: value.h:159
Definition: client.h:910
Definition: value.h:51
SListHandle_ValueString get_string_list() const
Retrieves the list of strings from the Value.
UnsetFlags
Definition: value.h:87
Definition: value.h:52
Definition: schema.h:47
Definition: callback.h:33
struct _GConfValue GConfValue
Definition: value_listhelpers.h:25
Definition: value.h:55
Definition: value.h:54
SListHandle_ValueSchema get_schema_list() const
Retrieves the list of Schemas from the Value.
void set_schema_list(const SListHandle_ValueSchema &list)
Sets the Value to contain a list of Schema.
int get_int() const
Get the integer that the Value contains.
Glib::ustring to_string() const
Convert the Value to a string.
void set_string_list(const SListHandle_ValueString &list)
Sets the Value to contain a list of strings.
Value get_car() const
Get a copy of the car of a VALUE_PAIR Value.
void set_bool_list(const SListHandle_ValueBool &list)
Sets the Value to contain a list of bools.
ValueType
Definition: value.h:46
void set_car(const Value &car)
Set the car (in a pair, the first element) of a Value whose type is VALUE_PAIR.
void set_float_list(const SListHandle_ValueFloat &list)
Sets the Value to contain a list of doubles.
SListHandle_ValueFloat get_float_list() const
Gets a list of doubles from the Value.
Value(GConfValue *castitem, bool make_a_copy=false)
GConfValue * gobj()
Definition: value.h:158
GConfValue * gobj_copy() const
Provides access to the underlying C instance. The caller is responsible for freeing it...
Value & operator=(const Value &src)
double get_float() const
Get the double that the Value contains.
Value get_cdr() const
Get a copy of the cdr of a VALUE_PAIR Value.
Glib::ustring get_string() const
Get the string that the Value contains.
Definition: value.h:49
Definition: value.h:48
void set_cdr(const Value &cdr)
Set the cdr (in a pair, the second element) of a Value whose type is VALUE_PAIR.
void set_int_list(const SListHandle_ValueInt &list)
Sets the Value to contain a list of integers.
Wrapper for primitive types.
Definition: value.h:141
void set(gint val)
Set the integer value of a Value whose type is VALUE_INT.
ValueType get_type() const
Get the type of the Value.
SListHandle_ValueInt get_int_list() const
Retrieves the list of integers from the Value.
SListHandle_ValueBool get_bool_list() const
Retrieves the list of booleans from the Value.
ValueType get_list_type() const
Get the type of the list elements of the Value.
Definition: value.h:50
GConfValue * gobject_
Definition: value.h:165
bool get_bool() const
Get the boolean that the Value contains.
std::pair< Value, Value > ValuePair
Definition: value.h:119
Definition: value.h:53
void set_list_type(ValueType type)
Sets the type of the elements of a Value with type VALUE_LIST.
Schema get_schema() const
Get a copy of the Schema of the value.