Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

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

Generated on Wed Sep 7 11:05:00 2005 for gconfmm by  doxygen 1.4.4