Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

connection.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_CONNECTION_H
00004 #define _LIBGDAMM_CONNECTION_H
00005 
00006 #include <glibmm.h>
00007 
00008 /* $Id: connection.hg,v 1.7 2002/07/20 13:25:14 murrayc Exp $ */
00009 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in
00010 
00011 /* connection.h
00012  * 
00013  * Copyright 2001      Free Software Foundation
00014  *
00015  * This library is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU Library General Public
00017  * License as published by the Free Software Foundation; either
00018  * version 2 of the License, or (at your option) any later version.
00019  *
00020  * This library is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00023  * Library General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU Library General Public
00026  * License along with this library; if not, write to the Free
00027  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00028  */
00029 
00030 #include <libgdamm/serverprovider.h>
00031 #include <libgdamm/transaction.h>
00032 #include <libgdamm/error.h>
00033 #include <libgdamm/datamodel.h>
00034 #include <libgda/gda-connection.h>
00035 
00036 
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 typedef struct _GdaConnection GdaConnection;
00039 typedef struct _GdaConnectionClass GdaConnectionClass;
00040 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00041 
00042 
00043 namespace Gnome
00044 {
00045 
00046 namespace Gda
00047 { class Connection_Class; } // namespace Gda
00048 
00049 } // namespace Gnome
00050 namespace Gnome
00051 {
00052 
00053 namespace Gda
00054 {
00055 
00056 
00057 class Connection : public Glib::Object
00058 {
00059   
00060 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00061 
00062 public:
00063   typedef Connection CppObjectType;
00064   typedef Connection_Class CppClassType;
00065   typedef GdaConnection BaseObjectType;
00066   typedef GdaConnectionClass BaseClassType;
00067 
00068 private:  friend class Connection_Class;
00069   static CppClassType connection_class_;
00070 
00071 private:
00072   // noncopyable
00073   Connection(const Connection&);
00074   Connection& operator=(const Connection&);
00075 
00076 protected:
00077   explicit Connection(const Glib::ConstructParams& construct_params);
00078   explicit Connection(GdaConnection* castitem);
00079 
00080 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00081 
00082 public:
00083   virtual ~Connection();
00084 
00085 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00086   static GType get_type()      G_GNUC_CONST;
00087   static GType get_base_type() G_GNUC_CONST;
00088 #endif
00089 
00091   GdaConnection*       gobj()       { return reinterpret_cast<GdaConnection*>(gobject_); }
00092 
00094   const GdaConnection* gobj() const { return reinterpret_cast<GdaConnection*>(gobject_); }
00095 
00096   GdaConnection* gobj_copy();
00097 
00098 private:
00099 
00100 protected:
00101   explicit Connection(GdaClient* client, const Glib::RefPtr<ServerProvider>& provider, const Glib::ustring& dsn, const Glib::ustring& username, const Glib::ustring& password);
00102 
00103 public:
00104   
00105   static Glib::RefPtr<Connection> create(GdaClient* client, const Glib::RefPtr<ServerProvider>& provider, const Glib::ustring& dsn, const Glib::ustring& username, const Glib::ustring& password);
00106 
00107 
00108   bool close();
00109   
00110   bool is_open();
00111 
00112   
00113   GdaClient* get_client();
00114   
00115   void set_client(GdaClient *client);
00116 
00117   
00118   Glib::ustring get_database() const;;
00119   
00120   Glib::ustring get_dsn() const;
00121   
00122   Glib::ustring get_cnc_string() const;
00123   
00124   Glib::ustring get_provider() const;
00125   
00126   Glib::ustring get_username() const;
00127   
00128   Glib::ustring get_password() const;
00129 
00130   
00131   void add_error(const Glib::RefPtr<Error>& error);
00132   
00133   void add_error_list(GList *error_list);
00134 
00135   
00136   bool change_database(const Glib::ustring& name);
00137   
00138   bool create_database(const Glib::ustring& name);
00139   
00140   bool drop_database (const Glib::ustring& name);
00141 
00142   
00143   GList* execute_command(GdaCommand *cmd, GdaParameterList *params);
00144   
00145   Glib::RefPtr<DataModel> execute_single_command(GdaCommand *cmd, GdaParameterList *params);
00146   
00147   int execute_non_query(GdaCommand *cmd, GdaParameterList *params);
00148 
00149   
00150   bool begin_transaction(const Glib::RefPtr<Transaction>& transaction);
00151   
00152   bool commit_transaction(const Glib::RefPtr<Transaction>& transaction);
00153   
00154   bool rollback_transaction(const Glib::RefPtr<Transaction>& transaction);
00155 
00156   //const GList   *gda_connection_get_errors (GdaConnection *cnc);
00157 
00158   
00159   bool supports(GdaConnectionFeature feature);
00160 
00161 
00162   Glib::RefPtr<DataModel> get_schema(GdaConnectionSchema schema, GdaParameterList *params);
00163 
00164   
00169   Glib::SignalProxy1<void,GList*> signal_error();
00170 
00171 
00172 public:
00173 
00174 public:
00175   //C++ methods used to invoke GTK+ virtual functions:
00176 
00177 protected:
00178   //GTK+ Virtual Functions (override these to change behaviour):
00179 
00180   //Default Signal Handlers::
00181   virtual void on_error(GList* error_list);
00182 
00183 
00184 };
00185 
00186 } // namespace Gda
00187 } // namespace Gnome
00188 
00189 
00190 namespace Glib
00191 {
00193   Glib::RefPtr<Gnome::Gda::Connection> wrap(GdaConnection* object, bool take_copy = false);
00194 }
00195 
00196 
00197 #endif /* _LIBGDAMM_CONNECTION_H */
00198 

Generated on Thu Mar 11 13:59:18 2004 for libgdamm by doxygen 1.3.6-20040222