00001
00002
00003 #ifndef _LIBGDAMM_OBJECT_H
00004 #define _LIBGDAMM_OBJECT_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
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdaObject GdaObject;
00037 typedef struct _GdaObjectClass GdaObjectClass;
00038 #endif
00039
00040
00041 namespace Gnome
00042 {
00043
00044 namespace Gda
00045 { class Object_Class; }
00046
00047 }
00048 namespace Gnome
00049 {
00050
00051 namespace Gda
00052 {
00053
00067 enum ValueAttribute
00068 {
00069 VALUE_ATTR_NONE = 0,
00070 VALUE_ATTR_IS_NULL = 1 << 0,
00071 VALUE_ATTR_CAN_BE_NULL = 1 << 1,
00072 VALUE_ATTR_IS_DEFAULT = 1 << 2,
00073 VALUE_ATTR_CAN_BE_DEFAULT = 1 << 3,
00074 VALUE_ATTR_IS_UNCHANGED = 1 << 4,
00075 VALUE_ATTR_ACTIONS_SHOWN = 1 << 5,
00076 VALUE_ATTR_DATA_NON_VALID = 1 << 6,
00077 VALUE_ATTR_HAS_VALUE_ORIG = 1 << 7,
00078 VALUE_ATTR_NO_MODIF = 1 << 8,
00079 VALUE_ATTR_UNUSED = 1 << 9
00080 };
00081
00083 inline ValueAttribute operator|(ValueAttribute lhs, ValueAttribute rhs)
00084 { return static_cast<ValueAttribute>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00085
00087 inline ValueAttribute operator&(ValueAttribute lhs, ValueAttribute rhs)
00088 { return static_cast<ValueAttribute>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00089
00091 inline ValueAttribute operator^(ValueAttribute lhs, ValueAttribute rhs)
00092 { return static_cast<ValueAttribute>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00093
00095 inline ValueAttribute operator~(ValueAttribute flags)
00096 { return static_cast<ValueAttribute>(~static_cast<unsigned>(flags)); }
00097
00099 inline ValueAttribute& operator|=(ValueAttribute& lhs, ValueAttribute rhs)
00100 { return (lhs = static_cast<ValueAttribute>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00101
00103 inline ValueAttribute& operator&=(ValueAttribute& lhs, ValueAttribute rhs)
00104 { return (lhs = static_cast<ValueAttribute>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00105
00107 inline ValueAttribute& operator^=(ValueAttribute& lhs, ValueAttribute rhs)
00108 { return (lhs = static_cast<ValueAttribute>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00109
00110 }
00111
00112 }
00113
00114
00115 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00116 namespace Glib
00117 {
00118
00119 template <>
00120 class Value<Gnome::Gda::ValueAttribute> : public Glib::Value_Flags<Gnome::Gda::ValueAttribute>
00121 {
00122 public:
00123 static GType value_type() G_GNUC_CONST;
00124 };
00125
00126 }
00127 #endif
00128
00129
00130 namespace Gnome
00131 {
00132
00133 namespace Gda
00134 {
00135
00136
00137 class Dict;
00138
00142 class Object : public Glib::Object
00143 {
00144
00145 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00146
00147 public:
00148 typedef Object CppObjectType;
00149 typedef Object_Class CppClassType;
00150 typedef GdaObject BaseObjectType;
00151 typedef GdaObjectClass BaseClassType;
00152
00153 private: friend class Object_Class;
00154 static CppClassType object_class_;
00155
00156 private:
00157
00158 Object(const Object&);
00159 Object& operator=(const Object&);
00160
00161 protected:
00162 explicit Object(const Glib::ConstructParams& construct_params);
00163 explicit Object(GdaObject* castitem);
00164
00165 #endif
00166
00167 public:
00168 virtual ~Object();
00169
00170 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00171 static GType get_type() G_GNUC_CONST;
00172 static GType get_base_type() G_GNUC_CONST;
00173 #endif
00174
00176 GdaObject* gobj() { return reinterpret_cast<GdaObject*>(gobject_); }
00177
00179 const GdaObject* gobj() const { return reinterpret_cast<GdaObject*>(gobject_); }
00180
00182 GdaObject* gobj_copy();
00183
00184 private:
00185
00186 protected:
00187
00188 Object();
00189
00190 public:
00191
00192 static Glib::RefPtr<Object> create();
00193
00194
00198 Glib::RefPtr<Dict> get_dict();
00199
00203 Glib::RefPtr<const Dict> get_dict() const;
00204
00205
00211 void set_id(const Glib::ustring& strid);
00212
00216 void set_name(const Glib::ustring& name);
00217
00221 void set_description(const Glib::ustring& descr);
00222
00226 void set_owner(const Glib::ustring& owner);
00227
00228
00232 Glib::ustring get_id() const;
00233
00237 Glib::ustring get_name() const;
00238
00242 Glib::ustring get_description() const;
00243
00247 Glib::ustring get_owner() const;
00248
00249
00250
00251
00252
00253
00254
00258 void signal_emit_changed();
00259
00262 void block_changed();
00263
00266 void unblock_changed();
00267
00268
00269
00275 Glib::SignalProxy0< void > signal_signal_changed();
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289 public:
00290
00291 public:
00292
00293 #ifdef GLIBMM_VFUNCS_ENABLED
00294 #endif //GLIBMM_VFUNCS_ENABLED
00295
00296 protected:
00297
00298 #ifdef GLIBMM_VFUNCS_ENABLED
00299 #endif //GLIBMM_VFUNCS_ENABLED
00300
00301
00302 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00303 virtual void on_signal_changed();
00304 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00305
00306
00307 };
00308
00309 }
00310 }
00311
00312
00313 namespace Glib
00314 {
00320 Glib::RefPtr<Gnome::Gda::Object> wrap(GdaObject* object, bool take_copy = false);
00321 }
00322
00323
00324 #endif
00325