00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGDAMM_ENTITY_H 00004 #define _LIBGDAMM_ENTITY_H 00005 00006 00007 #include <glibmm.h> 00008 00009 /* $Id: entity.hg,v 1.1 2006/11/08 00:07:37 murrayc Exp $ */ 00010 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in 00011 00012 /* entity.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/dicttype.h> 00033 #include <libgdamm/entityfield.h> 00034 #include <glibmm/object.h> 00035 #include <libgda/gda-entity.h> 00036 00037 00038 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00039 typedef struct _GdaEntity GdaEntity; 00040 typedef struct _GdaEntityClass GdaEntityClass; 00041 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00042 00043 00044 namespace Gnome 00045 { 00046 00047 namespace Gda 00048 { class Entity_Class; } // namespace Gda 00049 00050 } // namespace Gnome 00051 namespace Gnome 00052 { 00053 00054 namespace Gda 00055 { 00056 00060 class Entity : public Glib::Interface 00061 { 00062 00063 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00064 00065 public: 00066 typedef Entity CppObjectType; 00067 typedef Entity_Class CppClassType; 00068 typedef GdaEntity BaseObjectType; 00069 typedef GdaEntityIface BaseClassType; 00070 00071 private: 00072 friend class Entity_Class; 00073 static CppClassType entity_class_; 00074 00075 // noncopyable 00076 Entity(const Entity&); 00077 Entity& operator=(const Entity&); 00078 00079 protected: 00080 Entity(); // you must derive from this class 00081 explicit Entity(GdaEntity* castitem); 00082 00083 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00084 00085 public: 00086 virtual ~Entity(); 00087 00088 static void add_interface(GType gtype_implementer); 00089 00090 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00091 static GType get_type() G_GNUC_CONST; 00092 static GType get_base_type() G_GNUC_CONST; 00093 #endif 00094 00096 GdaEntity* gobj() { return reinterpret_cast<GdaEntity*>(gobject_); } 00097 00099 const GdaEntity* gobj() const { return reinterpret_cast<GdaEntity*>(gobject_); } 00100 00101 private: 00102 00103 protected: 00104 00105 public: 00106 00107 00112 bool has_field(const Glib::RefPtr<const EntityField>& field) const; 00113 00114 //TODO: Use a ListHandle or similar: 00115 00122 GSList* get_fields(); 00123 00124 00128 int get_n_fields() const; 00129 00130 00146 Glib::RefPtr<EntityField> get_field_by_name(const Glib::ustring& name); 00147 00163 Glib::RefPtr<const EntityField> get_field_by_name(const Glib::ustring& name) const; 00164 00165 00169 Glib::RefPtr<EntityField> get_field_by_xml_id(const Glib::ustring& xml_id); 00170 00174 Glib::RefPtr<const EntityField> get_field_by_xml_id(const Glib::ustring& xml_id) const; 00175 00176 00180 Glib::RefPtr<EntityField> get_field_by_index(int index); 00181 00185 Glib::RefPtr<const EntityField> get_field_by_index(int index) const; 00186 00187 00193 int get_field_index(const Glib::RefPtr<const EntityField>& field) const; 00194 00198 void add_field(const Glib::RefPtr<EntityField>& field); 00199 00205 void add_field_before(const Glib::RefPtr<EntityField>& field, const Glib::RefPtr<EntityField>& field_before); 00206 00211 void swap_fields(const Glib::RefPtr<EntityField>& field1, const Glib::RefPtr<EntityField>& field2); 00212 00216 void remove_field(const Glib::RefPtr<EntityField>& field); 00217 00218 00222 bool is_writable() const; 00223 00224 00225 //TODO: vfuncs and signals. 00226 00227 00228 public: 00229 00230 public: 00231 //C++ methods used to invoke GTK+ virtual functions: 00232 #ifdef GLIBMM_VFUNCS_ENABLED 00233 #endif //GLIBMM_VFUNCS_ENABLED 00234 00235 protected: 00236 //GTK+ Virtual Functions (override these to change behaviour): 00237 #ifdef GLIBMM_VFUNCS_ENABLED 00238 #endif //GLIBMM_VFUNCS_ENABLED 00239 00240 //Default Signal Handlers:: 00241 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00242 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00243 00244 00245 }; 00246 00247 } // namespace Gda 00248 } // namespace Gnome 00249 00250 00251 namespace Glib 00252 { 00258 Glib::RefPtr<Gnome::Gda::Entity> wrap(GdaEntity* object, bool take_copy = false); 00259 00260 } // namespace Glib 00261 00262 00263 #endif /* _LIBGDAMM_ENTITY_H */ 00264