00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGDAMM_DICTDATABASE_H 00004 #define _LIBGDAMM_DICTDATABASE_H 00005 00006 00007 #include <glibmm.h> 00008 00009 /* $Id: dictdatabase.hg,v 1.1 2006/05/08 10:18:53 murrayc Exp $ */ 00010 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in 00011 00012 /* dictdatabase.h 00013 * 00014 * Copyright 2006 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/xmlstorage.h> 00033 #include <libgdamm/dicttable.h> 00034 #include <libgdamm/dictfield.h> 00035 #include <libgdamm/dictconstraint.h> 00036 00037 00038 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00039 typedef struct _GdaDictDatabase GdaDictDatabase; 00040 typedef struct _GdaDictDatabaseClass GdaDictDatabaseClass; 00041 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00042 00043 00044 namespace Gnome 00045 { 00046 00047 namespace Gda 00048 { class DictDatabase_Class; } // namespace Gda 00049 00050 } // namespace Gnome 00051 namespace Gnome 00052 { 00053 00054 namespace Gda 00055 { 00056 00057 class Connection; 00058 00066 class DictDatabase 00067 : public Gda::Object, 00068 public Gda::XmlStorage 00069 { 00070 00071 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00072 00073 public: 00074 typedef DictDatabase CppObjectType; 00075 typedef DictDatabase_Class CppClassType; 00076 typedef GdaDictDatabase BaseObjectType; 00077 typedef GdaDictDatabaseClass BaseClassType; 00078 00079 private: friend class DictDatabase_Class; 00080 static CppClassType dictdatabase_class_; 00081 00082 private: 00083 // noncopyable 00084 DictDatabase(const DictDatabase&); 00085 DictDatabase& operator=(const DictDatabase&); 00086 00087 protected: 00088 explicit DictDatabase(const Glib::ConstructParams& construct_params); 00089 explicit DictDatabase(GdaDictDatabase* castitem); 00090 00091 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00092 00093 public: 00094 virtual ~DictDatabase(); 00095 00096 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00097 static GType get_type() G_GNUC_CONST; 00098 static GType get_base_type() G_GNUC_CONST; 00099 #endif 00100 00102 GdaDictDatabase* gobj() { return reinterpret_cast<GdaDictDatabase*>(gobject_); } 00103 00105 const GdaDictDatabase* gobj() const { return reinterpret_cast<GdaDictDatabase*>(gobject_); } 00106 00108 GdaDictDatabase* gobj_copy(); 00109 00110 private: 00111 00112 00113 protected: 00114 00115 DictDatabase(); 00116 00117 public: 00118 00119 static Glib::RefPtr<DictDatabase> create(); 00120 00121 00125 Glib::RefPtr<Dict> get_dict(); 00126 00130 Glib::RefPtr<const Dict> get_dict() const; 00131 00132 00141 #ifdef GLIBMM_EXCEPTIONS_ENABLED 00142 bool update_dbms_data(GType limit_to_type, const Glib::ustring& limit_obj_name); 00143 #else 00144 bool update_dbms_data(GType limit_to_type, const Glib::ustring& limit_obj_name, std::auto_ptr<Glib::Error>& error); 00145 #endif //GLIBMM_EXCEPTIONS_ENABLED 00146 00147 00151 void stop_update_dbms_data() const; 00152 00153 //TODO: Use ListHandle or similar: 00154 //_WRAP_METHOD(GSList* get_tables(), gda_dict_database_get_tables) 00155 00156 00161 Glib::RefPtr<DictTable> get_table_by_name(const Glib::ustring& name);; 00162 00167 Glib::RefPtr<const DictTable> get_table_by_name(const Glib::ustring& name) const;; 00168 00169 00174 Glib::RefPtr<DictTable> get_table_by_xml_id(const Glib::ustring& xml_id); 00175 00180 Glib::RefPtr<const DictTable> get_table_by_xml_id(const Glib::ustring& xml_id) const; 00181 00182 00188 Glib::RefPtr<DictField> get_field_by_name(const Glib::ustring& fullname); 00189 00195 Glib::RefPtr<const DictField> get_field_by_name(const Glib::ustring& fullname) const; 00196 00197 00202 Glib::RefPtr<DictField> get_field_by_xml_id(const Glib::ustring& xml_id); 00203 00208 Glib::RefPtr<const DictField> get_field_by_xml_id(const Glib::ustring& xml_id) const; 00209 00210 00215 void add_constraint(const Glib::RefPtr<DictConstraint>& cstr); 00216 00217 //TODO: Use ListHandle or similar, and wrap DictTable: 00218 //_WRAP_METHOD(GSList* get_all_constraints() const, gda_dict_database_get_all_constraints) 00219 //_WRAP_METHOD(GSList* get_all_fk_constraints(), gda_dict_database_get_all_fk_constraints) 00220 //_WRAP_METHOD(GSList* get_table_constraints(const Glib::RefPtr<DictTable>& table), da_dict_database_get_table_constraints) 00221 //_WRAP_METHOD(GSList* get_tables_fk_constraints(const Glib::RefPtr<DictTable>& table1, const Glib::RefPtr<DictTable>& table2, bool table1_has_fk), gda_dict_database_get_tables_fk_constraints) 00222 00223 00224 public: 00225 00226 public: 00227 //C++ methods used to invoke GTK+ virtual functions: 00228 #ifdef GLIBMM_VFUNCS_ENABLED 00229 #endif //GLIBMM_VFUNCS_ENABLED 00230 00231 protected: 00232 //GTK+ Virtual Functions (override these to change behaviour): 00233 #ifdef GLIBMM_VFUNCS_ENABLED 00234 #endif //GLIBMM_VFUNCS_ENABLED 00235 00236 //Default Signal Handlers:: 00237 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00238 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00239 00240 00241 }; 00242 00243 } // namespace Gda 00244 } // namespace Gnome 00245 00246 00247 namespace Glib 00248 { 00254 Glib::RefPtr<Gnome::Gda::DictDatabase> wrap(GdaDictDatabase* object, bool take_copy = false); 00255 } 00256 00257 00258 #endif /* _LIBGDAMM_DICTDATABASE_H */ 00259