value.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GCONFMM_VALUE_H
00004 #define _GCONFMM_VALUE_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 // -*- Mode: C++; c-basic-offset: 4  -*-
00010 /* $Id: value.hg,v 1.3 2004/12/12 22:04:01 murrayc Exp $ */
00011 
00012 /* value.hg
00013  * 
00014  * Copyright (C) 2000-2002 GConfmm Development Team
00015  *
00016  * This library is free software; you can redistribute it and/or
00017  * modify it under the terms of the GNU Library General Public
00018  * License as published by the Free Software Foundation; either
00019  * version 2 of the License, or (at your option) any later version.
00020  *
00021  * This library is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00024  * Library General Public License for more details.
00025  *
00026  * You should have received a copy of the GNU Library General Public
00027  * License along with this library; if not, write to the Free
00028  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00029  */
00030 
00031 #include <glibmm/ustring.h>
00032 #include <gconfmm/value_listhelpers.h>
00033 
00034 
00035 namespace Gnome
00036 {
00037 
00038 namespace Conf
00039 {
00040 
00046 enum ValueType
00047 {
00048   VALUE_INVALID,
00049   VALUE_STRING,
00050   VALUE_INT,
00051   VALUE_FLOAT,
00052   VALUE_BOOL,
00053   VALUE_SCHEMA,
00054   VALUE_LIST,
00055   VALUE_PAIR
00056 };
00057 
00058 } // namespace Conf
00059 
00060 } // namespace Gnome
00061 
00062 
00063 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00064 namespace Glib
00065 {
00066 
00067 template <>
00068 class Value<Gnome::Conf::ValueType> : public Glib::Value_Enum<Gnome::Conf::ValueType>
00069 {
00070 public:
00071   static GType value_type() G_GNUC_CONST;
00072 };
00073 
00074 } // namespace Glib
00075 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00076 
00077 
00078 namespace Gnome
00079 {
00080 
00081 namespace Conf
00082 {
00083 
00084 
00085 typedef std::pair<Value, Value> ValuePair;    
00086 typedef std::pair<ValueType, ValueType> ValueTypePair;
00087 
00107 class Value 
00108 {
00109   public:
00110 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00111   typedef Value CppObjectType;
00112   typedef GConfValue BaseObjectType;
00113 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00114 
00115 
00116   // Use make_a_copy=true when getting it directly from a struct.
00117   explicit Value(GConfValue* castitem, bool make_a_copy = false);
00118 
00119   Value(const Value& src);
00120   Value& operator=(const Value& src);
00121 
00122   ~Value();
00123 
00124   GConfValue*       gobj()       { return gobject_; }
00125   const GConfValue* gobj() const { return gobject_; }
00126 
00128   GConfValue* gobj_copy() const;
00129 
00130 protected:
00131   GConfValue* gobject_;
00132 
00133 private:
00134 
00135   
00136 public:
00137 
00142   Value(ValueType type = VALUE_INVALID);
00143 
00147   void set(gint val);
00148 
00153   void set(gdouble val);
00154 
00157   void set(bool val);
00158 
00161   void set(const Schema& sc);
00162 
00165   void set_car(const Value& car);
00166 
00169   void set_cdr(const Value& cdr);
00170 
00173   void set(const Glib::ustring& val);
00174   
00175 
00178   void set_list_type(ValueType type);
00179 
00185   void set_int_list(const SListHandle_ValueInt& list);
00186 
00190   void set_bool_list(const SListHandle_ValueBool& list);
00191 
00195   void set_float_list(const SListHandle_ValueFloat& list);
00196 
00200   void set_string_list(const SListHandle_ValueString& list);
00201 
00205   void set_schema_list(const SListHandle_ValueSchema& list);
00206   
00207 
00211   ValueType get_type() const;
00212   
00213 
00219   ValueType get_list_type() const;
00220 
00223   int get_int() const;
00224 
00227   bool get_bool() const;
00228 
00231   double get_float() const;
00232 
00235   Glib::ustring get_string() const;
00236   
00237 
00239   Schema get_schema() const;
00240   
00241 
00243   Value get_car() const;
00244 
00246   Value get_cdr() const;
00247 
00257   SListHandle_ValueFloat  get_float_list() const;
00258 
00263   SListHandle_ValueInt    get_int_list() const;
00264 
00269   SListHandle_ValueBool   get_bool_list() const;
00270 
00275   SListHandle_ValueString get_string_list() const;
00276 
00281   SListHandle_ValueSchema get_schema_list() const;
00282 
00288   Glib::ustring to_string() const;
00289 
00290 
00291 };
00292 
00293 } /* namespace Conf */
00294 } /* namespace Gnome */
00295 
00296 
00297 namespace Glib
00298 {
00299 
00305 Gnome::Conf::Value wrap(GConfValue* object, bool take_copy = false);
00306 
00307 } // namespace Glib
00308 
00309 
00310 #endif /* _GCONFMM_VALUE_H */
00311 

Generated on Fri Aug 11 09:35:40 2006 for gconfmm by  doxygen 1.4.7