00001
00002
00003 #ifndef _LIBGDAMM_DATAMODELINDEX_H
00004 #define _LIBGDAMM_DATAMODELINDEX_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include <glibmm/object.h>
00032 #include <libgdamm/columnindex.h>
00033 #include <libgda/gda-data-model-index.h>
00034
00035
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 extern "C" { typedef struct _GdaDataModelIndex GdaDataModelIndex; }
00038 #endif
00039
00040 namespace Gnome
00041 {
00042
00043 namespace Gda
00044 {
00045
00046 class Row;
00047
00048
00049 class DataModelIndex
00050 {
00051 public:
00052 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00053 typedef DataModelIndex CppObjectType;
00054 typedef GdaDataModelIndex BaseObjectType;
00055
00056 static GType get_type() G_GNUC_CONST;
00057 #endif
00058
00059 DataModelIndex();
00060
00061 explicit DataModelIndex(GdaDataModelIndex* gobject, bool make_a_copy = true);
00062
00063 DataModelIndex(const DataModelIndex& other);
00064 DataModelIndex& operator=(const DataModelIndex& other);
00065
00066 ~DataModelIndex();
00067
00068 void swap(DataModelIndex& other);
00069
00071 GdaDataModelIndex* gobj() { return gobject_; }
00072
00074 const GdaDataModelIndex* gobj() const { return gobject_; }
00075
00077 GdaDataModelIndex* gobj_copy() const;
00078
00079 protected:
00080 GdaDataModelIndex* gobject_;
00081
00082 private:
00083
00084
00085 public:
00086
00087
00088
00089
00090
00094 Glib::ustring get_name() const;
00095
00099 void gda_data_set_name(const Glib::ustring& name);
00100
00104 Glib::ustring get_table_name() const;
00105
00109 void set_table_name(const Glib::ustring& name);
00110
00114 bool get_primary_key() const;
00115
00119 void set_primary_key(bool pk = true);
00120
00124 bool get_unique_key() const;
00125
00129 void set_unique_key(bool uk = true);
00130
00134 Glib::ustring get_references() const;
00135
00139 void set_references(const Glib::ustring& ref);
00140
00141
00142
00143
00144
00145
00146 };
00147
00148 }
00149 }
00150
00151
00152 namespace Gnome
00153 {
00154
00155 namespace Gda
00156 {
00157
00163 bool operator==(const DataModelIndex& lhs, const DataModelIndex& rhs);
00164
00170 bool operator!=(const DataModelIndex& lhs, const DataModelIndex& rhs);
00171
00172
00173 }
00174
00175 }
00176
00177
00178 namespace Gnome
00179 {
00180
00181 namespace Gda
00182 {
00183
00188 inline void swap(DataModelIndex& lhs, DataModelIndex& rhs)
00189 { lhs.swap(rhs); }
00190
00191 }
00192
00193 }
00194
00195 namespace Glib
00196 {
00197
00203 Gnome::Gda::DataModelIndex wrap(GdaDataModelIndex* object, bool take_copy = false);
00204
00205 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00206 template <>
00207 class Value<Gnome::Gda::DataModelIndex> : public Glib::Value_Boxed<Gnome::Gda::DataModelIndex>
00208 {};
00209 #endif
00210
00211 }
00212
00213
00214 #endif
00215