parameter.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_PARAMETER_H
00004 #define _LIBGDAMM_PARAMETER_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* $Id: parameter.hg,v 1.12 2006/11/08 01:42:01 murrayc Exp $ */
00010 // -*- C++ -*- //
00011 
00012 /* parameter.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 <libgdamm/object.h>
00032 #include <libgdamm/value.h>
00033 #include <libgdamm/entityfield.h>
00034 #include <libgdamm/referer.h>
00035 
00036 
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 typedef struct _GdaParameter GdaParameter;
00039 typedef struct _GdaParameterClass GdaParameterClass;
00040 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00041 
00042 
00043 namespace Gnome
00044 {
00045 
00046 namespace Gda
00047 { class Parameter_Class; } // namespace Gda
00048 
00049 } // namespace Gnome
00050 namespace Gnome
00051 {
00052 
00053 namespace Gda
00054 {
00055 
00058 class ParameterError : public Glib::Error
00059 {
00060 public:
00061   enum Code
00062   {
00063     PARAMETER_QUERY_LIMIT_ERROR
00064   };
00065 
00066   ParameterError(Code error_code, const Glib::ustring& error_message);
00067   explicit ParameterError(GError* gobject);
00068   Code code() const;
00069 
00070 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00071 private:
00072 
00073 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00074   static void throw_func(GError* gobject);
00075 #else
00076   //When not using exceptions, we just pass the Exception object around without throwing it:
00077   static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
00078 #endif //GLIBMM_EXCEPTIONS_ENABLED
00079 
00080   friend void wrap_init(); // uses throw_func()
00081 #endif
00082 };
00083 
00084 } // namespace Gda
00085 
00086 } // namespace Gnome
00087 
00088 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00089 namespace Glib
00090 {
00091 
00092 template <>
00093 class Value<Gnome::Gda::ParameterError::Code> : public Glib::Value_Enum<Gnome::Gda::ParameterError::Code>
00094 {
00095 public:
00096   static GType value_type() G_GNUC_CONST;
00097 };
00098 
00099 } // namespace Glib
00100 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00101 
00102 
00103 namespace Gnome
00104 {
00105 
00106 namespace Gda
00107 {
00108 
00109 
00110 class DataModel;
00111 
00115 class Parameter
00116   : public Object,
00117     public Referer
00118 {
00119   
00120 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00121 
00122 public:
00123   typedef Parameter CppObjectType;
00124   typedef Parameter_Class CppClassType;
00125   typedef GdaParameter BaseObjectType;
00126   typedef GdaParameterClass BaseClassType;
00127 
00128 private:  friend class Parameter_Class;
00129   static CppClassType parameter_class_;
00130 
00131 private:
00132   // noncopyable
00133   Parameter(const Parameter&);
00134   Parameter& operator=(const Parameter&);
00135 
00136 protected:
00137   explicit Parameter(const Glib::ConstructParams& construct_params);
00138   explicit Parameter(GdaParameter* castitem);
00139 
00140 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00141 
00142 public:
00143   virtual ~Parameter();
00144 
00145 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00146   static GType get_type()      G_GNUC_CONST;
00147   static GType get_base_type() G_GNUC_CONST;
00148 #endif
00149 
00151   GdaParameter*       gobj()       { return reinterpret_cast<GdaParameter*>(gobject_); }
00152 
00154   const GdaParameter* gobj() const { return reinterpret_cast<GdaParameter*>(gobject_); }
00155 
00157   GdaParameter* gobj_copy();
00158 
00159 private:
00160 
00161   
00162 protected:
00163 
00164   Parameter();
00165 
00166   Parameter(const Glib::ustring& name, const Value& value);
00167   
00168   Parameter(const Glib::ustring& name, bool value);
00169   
00170   Parameter(const Glib::ustring& name, const Glib::ustring& value);
00171   
00172 
00173 public:
00174   
00175   static Glib::RefPtr<Parameter> create();
00176 
00177   
00178   static Glib::RefPtr<Parameter> create(const Glib::ustring& name, bool value);
00179 ;
00180   
00181   static Glib::RefPtr<Parameter> create(const Glib::ustring& name, const Glib::ustring& value);
00182 ;
00183   
00184 
00185   typedef Glib::SListHandle< Glib::RefPtr<EntityField> > ListHandleEntityField; 
00186    
00187 
00188   Value get_value() const;
00189   
00190   
00195   Glib::ustring get_alphanum_name() const;
00196   
00197   
00201   GType get_g_type() const;
00202 
00203   
00204   void set_value(const Value& value);
00205   
00212   bool set_value(const Glib::ustring& value);
00213 
00214 
00218   void declare_invalid();
00219   
00223   bool is_valid() const;
00224 
00225   Value get_default_value() const;
00226   
00227 
00228   void set_default_value(const Value& value);
00229   
00233   bool get_exists_default_value();
00234   
00239   void set_exists_default_value(bool default_value_exists = true);
00240 
00241   
00244   void set_not_null(bool not_null = true);
00245   
00249   bool get_not_null() const;
00250 
00251   
00259 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00260   bool restrict_values(const Glib::RefPtr<DataModel>& model, int col);
00261 #else
00262   bool restrict_values(const Glib::RefPtr<DataModel>& model, int col, std::auto_ptr<Glib::Error>& error);
00263 #endif //GLIBMM_EXCEPTIONS_ENABLED
00264 
00265 
00266   bool has_restrict_values() const;
00267   bool has_restrict_values(Glib::RefPtr<DataModel>& model, int& col) const;
00268   
00269 
00273   void bind_to_param(const Glib::RefPtr<Parameter>& bind_to);
00274 
00275   
00279   Glib::RefPtr<Parameter> get_bind_param();
00280   
00284   Glib::RefPtr<const Parameter> get_bind_param() const;
00285 
00286   
00287   // Hand-code because it might return NULL;
00288   // TODO: That shouldn't be a problem. murrayc
00289   Glib::ustring get_value_str() const;
00290 
00291   //TODO: Wrap list correctly - Johannes
00292   // It is defined in gda-parameter-utils.c, check whether it is useful API
00293   // _WRAP_METHOD(GSList* get_param_users(), gda_parameter_get_param_users);
00294   // same for replace_param_users and declare_param_user    
00295 
00296   #ifdef GLIBMM_PROPERTIES_ENABLED
00297 
00303   Glib::PropertyProxy_ReadOnly<GType> property_g_type() const;
00304 #endif //#GLIBMM_PROPERTIES_ENABLED
00305 
00306 
00307   #ifdef GLIBMM_PROPERTIES_ENABLED
00308 
00314   Glib::PropertyProxy<Glib::ustring> property_entry_plugin() ;
00315 #endif //#GLIBMM_PROPERTIES_ENABLED
00316 
00317 #ifdef GLIBMM_PROPERTIES_ENABLED
00318 
00324   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_entry_plugin() const;
00325 #endif //#GLIBMM_PROPERTIES_ENABLED
00326 
00327   #ifdef GLIBMM_PROPERTIES_ENABLED
00328 
00334   Glib::PropertyProxy<bool> property_use_default_value() ;
00335 #endif //#GLIBMM_PROPERTIES_ENABLED
00336 
00337 #ifdef GLIBMM_PROPERTIES_ENABLED
00338 
00344   Glib::PropertyProxy_ReadOnly<bool> property_use_default_value() const;
00345 #endif //#GLIBMM_PROPERTIES_ENABLED
00346 
00347   #ifdef GLIBMM_PROPERTIES_ENABLED
00348 
00354   Glib::PropertyProxy<bool> property_not_null() ;
00355 #endif //#GLIBMM_PROPERTIES_ENABLED
00356 
00357 #ifdef GLIBMM_PROPERTIES_ENABLED
00358 
00364   Glib::PropertyProxy_ReadOnly<bool> property_not_null() const;
00365 #endif //#GLIBMM_PROPERTIES_ENABLED
00366 
00367   #ifdef GLIBMM_PROPERTIES_ENABLED
00368 
00374   Glib::PropertyProxy< Glib::RefPtr<Parameter> > property_simple_bind() ;
00375 #endif //#GLIBMM_PROPERTIES_ENABLED
00376 
00377 #ifdef GLIBMM_PROPERTIES_ENABLED
00378 
00384   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Parameter> > property_simple_bind() const;
00385 #endif //#GLIBMM_PROPERTIES_ENABLED
00386 
00387   #ifdef GLIBMM_PROPERTIES_ENABLED
00388 
00394   Glib::PropertyProxy< Glib::RefPtr<Parameter> > property_full_bind() ;
00395 #endif //#GLIBMM_PROPERTIES_ENABLED
00396 
00397 #ifdef GLIBMM_PROPERTIES_ENABLED
00398 
00404   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Parameter> > property_full_bind() const;
00405 #endif //#GLIBMM_PROPERTIES_ENABLED
00406 
00407   #ifdef GLIBMM_PROPERTIES_ENABLED
00408 
00414   Glib::PropertyProxy< Glib::RefPtr<DataModel> > property_restrict_model() ;
00415 #endif //#GLIBMM_PROPERTIES_ENABLED
00416 
00417 #ifdef GLIBMM_PROPERTIES_ENABLED
00418 
00424   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> > property_restrict_model() const;
00425 #endif //#GLIBMM_PROPERTIES_ENABLED
00426 
00427   #ifdef GLIBMM_PROPERTIES_ENABLED
00428 
00434   Glib::PropertyProxy<int> property_restrict_column() ;
00435 #endif //#GLIBMM_PROPERTIES_ENABLED
00436 
00437 #ifdef GLIBMM_PROPERTIES_ENABLED
00438 
00444   Glib::PropertyProxy_ReadOnly<int> property_restrict_column() const;
00445 #endif //#GLIBMM_PROPERTIES_ENABLED
00446 
00447 
00453   Glib::SignalProxy0< void > signal_restrict_changed();
00454 
00455 
00456 public:
00457 
00458 public:
00459   //C++ methods used to invoke GTK+ virtual functions:
00460 #ifdef GLIBMM_VFUNCS_ENABLED
00461 #endif //GLIBMM_VFUNCS_ENABLED
00462 
00463 protected:
00464   //GTK+ Virtual Functions (override these to change behaviour):
00465 #ifdef GLIBMM_VFUNCS_ENABLED
00466 #endif //GLIBMM_VFUNCS_ENABLED
00467 
00468   //Default Signal Handlers::
00469 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00470   virtual void on_restrict_changed();
00471 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00472 
00473 
00474 };
00475 
00476 } // namespace Gda
00477 } // namespace Gnome
00478 
00479 
00480 namespace Glib
00481 {
00487   Glib::RefPtr<Gnome::Gda::Parameter> wrap(GdaParameter* object, bool take_copy = false);
00488 }
00489 
00490 
00491 #endif /* _LIBGDAMM_PARAMETER_H */
00492 

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