dict.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_DICT_H
00004 #define _LIBGDAMM_DICT_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* $Id: dict.hg,v 1.2 2006/11/30 06:58:55 murrayc Exp $ */
00010 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in
00011 
00012 /* error.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/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 /* DOXYGEN_SHOULD_SKIP_THIS */
00042 
00043 
00044 namespace Gnome
00045 {
00046 
00047 namespace Gda
00048 { class Dict_Class; } // namespace Gda
00049 
00050 } // namespace Gnome
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   // noncopyable
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 /* DOXYGEN_SHOULD_SKIP_THIS */
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 //TODO: What is datasource? is it UTF-8?
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   //Note that these are described in libgda_others.defs, because the C functions are actually macros:
00359   //TODO: Use SListHandle:
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 /* GdaDictFunction manipulations */
00374   //_WRAP_METHOD(GSList* get_functions() const, gda_dict_get_functions)
00375   //_WRAP_METHOD(GSList* get_functions_by_name(const Glib::ustring& funcname), gda_dict_get_functions_by_name)
00376   //_WRAP_METHOD(GdaDictFunction* get_function_by_name_arg(const Glib::ustring& funcname, const GSList* argtypes), gda_dict_get_function_by_name_arg)
00377   //_WRAP_METHOD(GdaDictFunction* get_function_by_xml_id(const Glib::ustring& xml_id), gda_dict_get_function_by_xml_id)
00378   //_WRAP_METHOD(GdaDictFunction* get_function_by_dbms_id(const Glib::ustring& dbms_id), gda_dict_get_function_by_dbms_id)
00379 
00380   //TODO: Use a ListHandle or similar?
00381   GSList* get_aggregates() const;
00382 #if 0
00383   // The C counterparts to these functions are declared in a header that is not surrounded by
00384   // G_BEGIN_DECL / G_END_DECL (gda-dict-reg-aggregates.h). This is a bit strange since there is a macro calling these
00385   // functions in the public gda-dict.h file.
00386   GSList* get_aggregates_by_name (const Glib::ustring& aggname);
00387 
00388   //TODO: Use a C++ type, or at least a reference instead of a pointer:
00389   //TODO: Make sure that these take a reference.
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 /* GdaQuery manipulations */
00396   //_WRAP_METHOD(void declare_query(const Glib::RefPtr<Query>& query), gda_dict_declare_query)
00397   //_WRAP_METHOD(void assume_query (const Glib::RefPtr<Query>& query), gda_dict_assume_query)
00398   //_WRAP_METHOD(void unassume_query(const Glib::RefPtr<Query>& query), gda_dict_unassume_query)
00399   //_WRAP_METHOD(GSList* get_queries  () const, gda_dict_get_queries)
00400   //_WRAP_METHOD(Glib::RefPtr<Query> get_query_by_xml_id(const Glib::ustring& xml_id), gda_dict_get_query_by_xml_id, refreturn)
00401   //_WRAP_METHOD(Glib::RefPtr<const Query> get_query_by_xml_id(const Glib::ustring& xml_id), gda_dict_get_query_by_xml_id, constversion)
00402 
00403 /* GdaGraph manipulations */
00404   //_WRAP_METHOD(void declare_graph(GdaGraph *graph), gda_dict_declare_graph)
00405   //_WRAP_METHOD(void assume_graph(GdaGraph *graph), gda_dict_assume_graph)
00406   //_WRAP_METHOD(void unassume_graph(GdaGraph *graph), gda_dict_unassume_graph)
00407   //_WRAP_METHOD(GSList* get_graphs (GraphType type_of_graphs), gda_dict_get_graphs)
00408   //_WRAP_METHOD(GdaGraph* get_graph_by_xml_id(const Glib::ustring& xml_id), gda_dict_get_graph_by_xml_id)
00409   //_WRAP_METHOD(GdaGraph* get_graph_for_object(GObject *obj), gda_dict_get_graph_for_object)
00410 
00411   
00415   Glib::RefPtr<DictDatabase> get_database();
00416   
00420   Glib::RefPtr<const DictDatabase> get_database() const;
00421 
00422   //_WRAP_METHOD(GSList* get_entities_fk_constraints(GdaEntity *entity1, GdaEntity *entity2, bool entity1_has_fk), gda_dict_get_entities_fk_constraints)
00423 
00424 
00425 public:
00426 
00427 public:
00428   //C++ methods used to invoke GTK+ virtual functions:
00429 #ifdef GLIBMM_VFUNCS_ENABLED
00430 #endif //GLIBMM_VFUNCS_ENABLED
00431 
00432 protected:
00433   //GTK+ Virtual Functions (override these to change behaviour):
00434 #ifdef GLIBMM_VFUNCS_ENABLED
00435 #endif //GLIBMM_VFUNCS_ENABLED
00436 
00437   //Default Signal Handlers::
00438 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00439 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00440 
00441 
00442 };
00443 
00444 } // namespace Gda
00445 } // namespace Gnome
00446 
00447 
00448 namespace Glib
00449 {
00455   Glib::RefPtr<Gnome::Gda::Dict> wrap(GdaDict* object, bool take_copy = false);
00456 }
00457 
00458 
00459 #endif /* _LIBGDAMM_DICT_H */
00460 

Generated on Sat Feb 10 20:06:25 2007 for libgdamm by  doxygen 1.4.7