parameterlist.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_PARAMETERLIST_H
00004 #define _LIBGDAMM_PARAMETERLIST_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* $Id: parameterlist.hg,v 1.11 2006/11/30 06:58:55 murrayc Exp $ */
00010 // -*- C++ -*- //
00011 
00012 /* parameterlist.h
00013  *
00014  * Copyright 2003 libgdamm 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/object.h>
00032 #include <libgdamm/parameter.h>
00033 
00034 
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdaParameterList GdaParameterList;
00037 typedef struct _GdaParameterListClass GdaParameterListClass;
00038 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00039 
00040 
00041 namespace Gnome
00042 {
00043 
00044 namespace Gda
00045 { class ParameterList_Class; } // namespace Gda
00046 
00047 } // namespace Gnome
00048 namespace Gnome
00049 {
00050 
00051 namespace Gda
00052 {
00053 
00056 class ParameterListError : public Glib::Error
00057 {
00058 public:
00059   enum Code
00060   {
00061     PARAMETER_LIST_NO_NODE_ERROR,
00062     PARAMETER_LIST_NODE_OUTDATED_ERROR,
00063     PARAMETER_LIST_VALUE_PROV_OBJ_TYPE_ERROR,
00064     PARAMETER_LIST_VALUE_PROV_DATA_TYPE_ERROR,
00065     PARAMETER_LIST_VALUE_PROV_INVISIBLE_ERROR,
00066     PARAMETER_LIST_VALUE_PROV_QUERY_TYPE_ERROR,
00067     PARAMETER_LIST_DEPENDENCY_NOT_IN_PARAMLIST_ERROR,
00068     PARAMETER_LIST_DEPENDENCY_POSITION_ERROR,
00069     PARAMETER_LIST_XML_SPEC_ERROR
00070   };
00071 
00072   ParameterListError(Code error_code, const Glib::ustring& error_message);
00073   explicit ParameterListError(GError* gobject);
00074   Code code() const;
00075 
00076 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00077 private:
00078 
00079 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00080   static void throw_func(GError* gobject);
00081 #else
00082   //When not using exceptions, we just pass the Exception object around without throwing it:
00083   static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
00084 #endif //GLIBMM_EXCEPTIONS_ENABLED
00085 
00086   friend void wrap_init(); // uses throw_func()
00087 #endif
00088 };
00089 
00090 } // namespace Gda
00091 
00092 } // namespace Gnome
00093 
00094 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00095 namespace Glib
00096 {
00097 
00098 template <>
00099 class Value<Gnome::Gda::ParameterListError::Code> : public Glib::Value_Enum<Gnome::Gda::ParameterListError::Code>
00100 {
00101 public:
00102   static GType value_type() G_GNUC_CONST;
00103 };
00104 
00105 } // namespace Glib
00106 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00107 
00108 
00109 namespace Gnome
00110 {
00111 
00112 namespace Gda
00113 {
00114 
00115 
00126 class ParameterList : public Glib::Object
00127 {
00128   
00129 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00130 
00131 public:
00132   typedef ParameterList CppObjectType;
00133   typedef ParameterList_Class CppClassType;
00134   typedef GdaParameterList BaseObjectType;
00135   typedef GdaParameterListClass BaseClassType;
00136 
00137 private:  friend class ParameterList_Class;
00138   static CppClassType parameterlist_class_;
00139 
00140 private:
00141   // noncopyable
00142   ParameterList(const ParameterList&);
00143   ParameterList& operator=(const ParameterList&);
00144 
00145 protected:
00146   explicit ParameterList(const Glib::ConstructParams& construct_params);
00147   explicit ParameterList(GdaParameterList* castitem);
00148 
00149 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00150 
00151 public:
00152   virtual ~ParameterList();
00153 
00154 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00155   static GType get_type()      G_GNUC_CONST;
00156   static GType get_base_type() G_GNUC_CONST;
00157 #endif
00158 
00160   GdaParameterList*       gobj()       { return reinterpret_cast<GdaParameterList*>(gobject_); }
00161 
00163   const GdaParameterList* gobj() const { return reinterpret_cast<GdaParameterList*>(gobject_); }
00164 
00166   GdaParameterList* gobj_copy();
00167 
00168 private:
00169 
00170 protected:
00171 
00172   ParameterList();
00173 
00174 public:
00175   
00176   static Glib::RefPtr<ParameterList> create();
00177 
00178 
00179   operator bool() const;
00180 
00181   
00184   guint get_length();
00185 
00186 
00193   void add_parameter(const Glib::RefPtr<Parameter>& param);
00194   
00202   Glib::RefPtr<Parameter> add_parameter(const Glib::ustring& name, GType type, const Glib::ustring& str);
00203   
00210   Glib::RefPtr<Parameter> add_parameter(const Glib::ustring& name, const Value& value);
00211 
00212   
00219   void add_param(const Glib::RefPtr<Parameter>& param);
00220   
00228   Glib::RefPtr<Parameter> add_param_from_string(const Glib::ustring& name, GType type, const Glib::ustring& str);
00229   
00236   Glib::RefPtr<Parameter> add_param_from_value(const Glib::ustring& name, const Value& value);
00237   
00241   void merge(const Glib::RefPtr<ParameterList>& paramlist_to_merge);
00242   
00246 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00247   bool is_coherent() const;
00248 #else
00249   bool is_coherent(std::auto_ptr<Glib::Error>& error) const;
00250 #endif //GLIBMM_EXCEPTIONS_ENABLED
00251 
00252   
00256   bool is_valid() const;
00257  
00258 
00263   Glib::RefPtr<Parameter> find_param(const Glib::ustring& param_name);
00264   //_WRAP_METHOD(Glib::RefPtr<Parameter> find_param_for_user(const Glib::RefPtr<Object>& user), gda_parameter_list_find_param_for_user)
00265 
00266   //TODO: What on earth are these for? Who should use them, and when?
00267   //_WRAP_METHOD(GdaParameterListNode* find_node_for_param(const Glib::RefPtr<Parameter>& param), gda_parameter_list_find_node_for_param)
00268   //_WRAP_METHOD(GdaParameterListSource* find_source(const Glib::RefPtr<DataModel>& model), gda_parameter_list_find_source)
00269   //_WRAP_METHOD(GdaParameterListSource* find_source_for_param(const Glib::RefPtr<Parameter>& param), gda_parameter_list_find_source_for_param)
00270   //_WRAP_METHOD(GdaParameterListGroup* find_group_for_param(const Glib::RefPtr<Parameter>& param), gda_parameter_list_find_group_for_param)
00271 
00272   
00281   void set_param_default_value(const Glib::RefPtr<const Parameter>& param, const Value& value);
00282   
00283   void set_param_default_alias(const Glib::RefPtr<const Parameter>& param, const Glib::RefPtr<const Parameter>& alias);
00284   Value get_param_default_value(const Glib::RefPtr<const Parameter>& param) const;
00285   
00286 
00291   Glib::ustring get_spec() const;
00292   
00295   guint get_length() const;
00296 
00297   
00303   Glib::SignalProxy0< void > signal_public_data_changed();
00304 
00305   
00311   Glib::SignalProxy1< void,Glib::RefPtr<Parameter> > signal_param_plugin_changed();
00312 
00313   
00319   Glib::SignalProxy1< void,Glib::RefPtr<Parameter> > signal_param_changed();
00320 
00321   
00327   Glib::SignalProxy1< void,Glib::RefPtr<Parameter> > signal_param_attr_changed();
00328   
00329 
00330 public:
00331 
00332 public:
00333   //C++ methods used to invoke GTK+ virtual functions:
00334 #ifdef GLIBMM_VFUNCS_ENABLED
00335 #endif //GLIBMM_VFUNCS_ENABLED
00336 
00337 protected:
00338   //GTK+ Virtual Functions (override these to change behaviour):
00339 #ifdef GLIBMM_VFUNCS_ENABLED
00340 #endif //GLIBMM_VFUNCS_ENABLED
00341 
00342   //Default Signal Handlers::
00343 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00344   virtual void on_public_data_changed();
00345   virtual void on_param_plugin_changed(Glib::RefPtr<Parameter> parameter);
00346   virtual void on_param_changed(Glib::RefPtr<Parameter> parameter);
00347   virtual void on_param_attr_changed(Glib::RefPtr<Parameter> parameter);
00348 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00349 
00350 
00351 };
00352 
00353 } // namespace Gda
00354 } // namespace Gnome
00355 
00356 
00357 namespace Glib
00358 {
00364   Glib::RefPtr<Gnome::Gda::ParameterList> wrap(GdaParameterList* object, bool take_copy = false);
00365 }
00366 
00367 
00368 #endif /* _LIBGDAMM_PARAMETERLIST_H */
00369 

Generated on Sat Feb 10 20:06:26 2007 for libgdamm by  doxygen 1.4.7