Reference Manual

Inti Logo
Main Page | Namespace List | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

value.h

Go to the documentation of this file.
00001 /*  Inti-GConf: Integrated Foundation Classes
00002  *  Copyright (C) 2002 The Inti Development Team.
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00021 
00022 #ifndef INTI_GCONF_VALUE_H
00023 #define INTI_GCONF_VALUE_H
00024 
00025 #ifndef GCONF_GCONF_VALUE_H
00026 extern "C"
00027 {
00028 #include <gconf/gconf-value.h>
00029 }
00030 #endif
00031 
00032 #ifndef INTI_STRING_H
00033 #include <inti/utf-string.h>
00034 #endif
00035 
00036 #ifndef CPP_VECTOR_H
00037 #include <vector>
00038 #endif
00039 
00040 namespace Inti {
00041 
00042 namespace G {
00043 class Error;
00044 }
00045 
00046 namespace GConf {
00047 
00048 class Schema;
00049 
00052 
00053 enum ValueType
00054 {
00055         VALUE_INVALID = GCONF_VALUE_INVALID, 
00056         VALUE_STRING = GCONF_VALUE_STRING, 
00057         VALUE_INT = GCONF_VALUE_INT, 
00058         VALUE_FLOAT = GCONF_VALUE_FLOAT, 
00059         VALUE_BOOL = GCONF_VALUE_BOOL, 
00060         VALUE_SCHEMA = GCONF_VALUE_SCHEMA, 
00061         VALUE_LIST = GCONF_VALUE_LIST, 
00062         VALUE_PAIR = GCONF_VALUE_PAIR 
00063 };
00064 
00072 
00073 class Value
00074 {
00075         GConfValue *value_;
00076 
00077 public:
00080 
00081         Value();
00083 
00084         Value(ValueType type);
00090 
00091         Value(ValueType type, const String& value_str, G::Error *error= 0);
00100 
00101         explicit Value(const GConfValue *src);
00103 
00104         Value(const Value& src);
00106 
00107         ~Value();
00109 
00110         Value& operator=(const Value& src);
00112 
00116 
00117         GConfValue* gconf_value() const { return value_; }
00119 
00120         bool is_set() const;
00122 
00123         ValueType get_type() const;
00125 
00126         ValueType get_list_type() const;
00128 
00129         int get_int() const;
00131 
00132         bool get_bool() const;
00134 
00135         double get_float() const;
00137 
00138         String get_string() const;
00142 
00143         Schema get_schema() const;
00147 
00148         Value get_car() const;
00153 
00154         Value get_cdr() const;
00159 
00160         bool get_list(std::vector<int>& list) const;
00164 
00165         bool get_list(std::vector<bool>& list) const;
00169 
00170         bool get_list(std::vector<double>& list) const;
00174 
00175         bool get_list(std::vector<String>& list) const;
00179 
00180         bool get_list(std::vector<Schema>& list) const;
00184 
00188 
00189         void set_int(int value);
00192 
00193         void set_bool(bool value);
00196 
00197         void set_float(double value);
00200 
00201         void set_string(const String& str);
00204 
00205         void set_schema(const Schema& sc);
00208 
00209         void set_car(const Value& car);
00212 
00213         void set_cdr(const Value& cdr);
00216 
00217         void set_list(std::vector<int>& list);
00220 
00221         void set_list(std::vector<bool>& list);
00224 
00225         void set_list(std::vector<double>& list);
00228 
00229         void set_list(std::vector<String>& list);
00232 
00233         void set_list(std::vector<Schema>& list);
00236 
00237         String to_string();
00245 
00247 };
00248 
00259 
00260 class Entry
00261 {
00262         GConfEntry *entry_;
00263 
00264 public:
00267 
00268         Entry(const String& key, const Value& value);
00272 
00273         Entry(const GConfEntry *src);
00276 
00277         Entry(const Entry& src);
00279 
00280         ~Entry();
00282 
00283         Entry& operator=(const Entry& src);
00285 
00289 
00290         GConfEntry* gconf_entry() const { return entry_; }
00292 
00293         bool is_set() const;
00295 
00296         String get_key() const;
00298 
00299         Value get_value() const;
00302 
00303         String get_schema_name() const;
00305 
00306         bool get_is_default() const;
00308 
00309         bool get_is_writable() const;
00311 
00315         
00316         void set_value(const Value& value);
00319 
00320         void set_schema_name(const String& name);
00323 
00324         void set_is_default(bool is_default);
00326 
00327         void set_is_writable(bool is_writable);
00329 
00331 };
00332 
00333 } // namespace GConf
00334 
00335 } // namespace Inti
00336 
00337 #endif // INTI_GCONF_VALUE_H
00338 
Main Page - Footer


Generated on Sun Sep 14 23:52:40 2003 for Inti-GConf by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002