00001
00002
00003 #ifndef _LIBGDAMM_DICT_H
00004 #define _LIBGDAMM_DICT_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 <libgdamm/object.h>
00032 #include <libgdamm/dictaggregate.h>
00033 #include <libgdamm/dictdatabase.h>
00034 #include <libgdamm/dicttype.h>
00035 #include <libgdamm/datahandler.h>
00036
00037
00038 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00039 typedef struct _GdaDict GdaDict;
00040 typedef struct _GdaDictClass GdaDictClass;
00041 #endif
00042
00043
00044 namespace Gnome
00045 {
00046
00047 namespace Gda
00048 { class Dict_Class; }
00049
00050 }
00051 namespace Gnome
00052 {
00053
00054 namespace Gda
00055 {
00056
00057 class Object;
00058
00059 class Connection;
00060
00078 class Dict : public Glib::Object
00079 {
00080
00081 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00082
00083 public:
00084 typedef Dict CppObjectType;
00085 typedef Dict_Class CppClassType;
00086 typedef GdaDict BaseObjectType;
00087 typedef GdaDictClass BaseClassType;
00088
00089 private: friend class Dict_Class;
00090 static CppClassType dict_class_;
00091
00092 private:
00093
00094 Dict(const Dict&);
00095 Dict& operator=(const Dict&);
00096
00097 protected:
00098 explicit Dict(const Glib::ConstructParams& construct_params);
00099 explicit Dict(GdaDict* castitem);
00100
00101 #endif
00102
00103 public:
00104 virtual ~Dict();
00105
00106 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00107 static GType get_type() G_GNUC_CONST;
00108 static GType get_base_type() G_GNUC_CONST;
00109 #endif
00110
00112 GdaDict* gobj() { return reinterpret_cast<GdaDict*>(gobject_); }
00113
00115 const GdaDict* gobj() const { return reinterpret_cast<GdaDict*>(gobject_); }
00116
00118 GdaDict* gobj_copy();
00119
00120 private:
00121
00122
00123 protected:
00124
00125 Dict();
00126
00127 public:
00128
00129 static Glib::RefPtr<Dict> create();
00130
00131
00136 void set_connection(const Glib::RefPtr<Connection>& cnc);
00137
00141 Glib::RefPtr<Connection> get_connection();
00142
00146 Glib::RefPtr<const Connection> get_connection() const;
00147
00148
00151 void declare_object_string_id_change(const Glib::RefPtr<Gda::Object>& obj, const Glib::ustring& oldid);
00152
00157 Glib::RefPtr<Gda::Object> get_object_by_string_id(const Glib::ustring& strid);
00158
00163 Glib::RefPtr<const Gda::Object> get_object_by_string_id(const Glib::ustring& strid) const;
00164
00165
00174 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00175 bool update_dbms_meta_data(GType limit_to_type, const Glib::ustring& limit_obj_name);
00176 #else
00177 bool update_dbms_meta_data(GType limit_to_type, const Glib::ustring& limit_obj_name, std::auto_ptr<Glib::Error>& error);
00178 #endif //GLIBMM_EXCEPTIONS_ENABLED
00179
00180
00188 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00189 bool update_dbms_meta_data(GType limit_to_type);
00190 #else
00191 bool update_dbms_meta_data(GType limit_to_type, std::auto_ptr<Glib::Error>& error);
00192 #endif //GLIBMM_EXCEPTIONS_ENABLED
00193
00200 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00201 bool update_dbms_meta_data();
00202 #else
00203 bool update_dbms_meta_data(std::auto_ptr<Glib::Error>& error);
00204 #endif //GLIBMM_EXCEPTIONS_ENABLED
00205
00206
00210 void stop_update_dbms_meta_data();
00211
00212
00213
00228 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00229 std::string compute_xml_filename(const Glib::ustring& datasource, const Glib::ustring& app_id);
00230 #else
00231 std::string compute_xml_filename(const Glib::ustring& datasource, const Glib::ustring& app_id, std::auto_ptr<Glib::Error>& error);
00232 #endif //GLIBMM_EXCEPTIONS_ENABLED
00233
00234
00238 void set_xml_filename(const std::string& xmlfile);
00239
00243 std::string get_xml_filename() const;
00244
00259 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00260 bool load();
00261 #else
00262 bool load(std::auto_ptr<Glib::Error>& error);
00263 #endif //GLIBMM_EXCEPTIONS_ENABLED
00264
00265
00271 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00272 bool save();
00273 #else
00274 bool save(std::auto_ptr<Glib::Error>& error);
00275 #endif //GLIBMM_EXCEPTIONS_ENABLED
00276
00277
00291 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00292 bool load_xml_file(const std::string& xmlfile);
00293 #else
00294 bool load_xml_file(const std::string& xmlfile, std::auto_ptr<Glib::Error>& error);
00295 #endif //GLIBMM_EXCEPTIONS_ENABLED
00296
00297
00303 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00304 bool save_xml_file(const std::string& xmlfile);
00305 #else
00306 bool save_xml_file(const std::string& xmlfile, std::auto_ptr<Glib::Error>& error);
00307 #endif //GLIBMM_EXCEPTIONS_ENABLED
00308
00309
00323 Glib::RefPtr<DataHandler> get_handler(GType for_type);
00324
00338 Glib::RefPtr<const DataHandler> get_handler(GType for_type) const;
00339
00347 Glib::RefPtr<DataHandler> get_default_handler(GType for_type);
00348
00356 Glib::RefPtr<const DataHandler> get_default_handler(GType for_type) const;
00357
00358
00359
00360
00361 GSList* get_dict_types();
00362
00363
00364 Glib::RefPtr<DictType> get_dict_type_by_name(const Glib::ustring& type_name);
00365
00366 Glib::RefPtr<const DictType> get_dict_type_by_name(const Glib::ustring& type_name) const;
00367
00368
00369 Glib::RefPtr<DictType> get_dict_type_by_xml_id(const Glib::ustring& xml_id);
00370
00371 Glib::RefPtr<const DictType> get_dict_type_by_xml_id(const Glib::ustring& xml_id) const;
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381 GSList* get_aggregates() const;
00382 #if 0
00383
00384
00385
00386 GSList* get_aggregates_by_name (const Glib::ustring& aggname);
00387
00388
00389
00390 Glib::RefPtr<DictAggregate> get_aggregate_by_name_arg(const Glib::ustring& aggname, GdaDictType *argtype);
00391 Glib::RefPtr<DictAggregate> get_aggregate_by_xml_id(const Glib::ustring& xml_id);
00392 Glib::RefPtr<DictAggregate> get_aggregate_by_dbms_id(const Glib::ustring& dbms_id);
00393 #endif
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00415 Glib::RefPtr<DictDatabase> get_database();
00416
00420 Glib::RefPtr<const DictDatabase> get_database() const;
00421
00422
00423
00424
00425 public:
00426
00427 public:
00428
00429 #ifdef GLIBMM_VFUNCS_ENABLED
00430 #endif //GLIBMM_VFUNCS_ENABLED
00431
00432 protected:
00433
00434 #ifdef GLIBMM_VFUNCS_ENABLED
00435 #endif //GLIBMM_VFUNCS_ENABLED
00436
00437
00438 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00439 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00440
00441
00442 };
00443
00444 }
00445 }
00446
00447
00448 namespace Glib
00449 {
00455 Glib::RefPtr<Gnome::Gda::Dict> wrap(GdaDict* object, bool take_copy = false);
00456 }
00457
00458
00459 #endif
00460