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

client.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_CLIENT_H
00004 #define _LIBGDAMM_CLIENT_H
00005 
00006 #include <glibmm.h>
00007 
00008 /* $Id: client.hg,v 1.5 2004/11/28 15:07:16 murrayc Exp $ */
00009 // -*- C++ -*- //
00010 
00011 /* client.h
00012  *
00013  * Copyright 2003 libgdamm Development Team
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/transaction.h>
00031 #include <libgdamm/connection.h>
00032 //#include <libgda/gda-client.h>
00033 
00034 
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdaClient GdaClient;
00037 typedef struct _GdaClientClass GdaClientClass;
00038 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00039 
00040 
00041 namespace Gnome
00042 {
00043 
00044 namespace Gda
00045 { class Client_Class; } // namespace Gda
00046 
00047 } // namespace Gnome
00048 namespace Gnome
00049 {
00050 
00051 namespace Gda
00052 {
00053 
00059 enum ClientEvent
00060 {
00061   CLIENT_EVENT_INVALID,
00062   CLIENT_EVENT_ERROR,
00063   CLIENT_EVENT_CONNECTION_OPENED,
00064   CLIENT_EVENT_CONNECTION_CLOSED,
00065   CLIENT_EVENT_TRANSACTION_STARTED,
00066   CLIENT_EVENT_TRANSACTION_COMMITTED,
00067   CLIENT_EVENT_TRANSACTION_CANCELLED
00068 };
00069 
00070 } // namespace Gda
00071 
00072 } // namespace Gnome
00073 
00074 
00075 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00076 namespace Glib
00077 {
00078 
00079 template <>
00080 class Value<Gnome::Gda::ClientEvent> : public Glib::Value_Enum<Gnome::Gda::ClientEvent>
00081 {
00082 public:
00083   static GType value_type() G_GNUC_CONST;
00084 };
00085 
00086 } // namespace Glib
00087 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00088 
00089 
00090 namespace Gnome
00091 {
00092 
00093 namespace Gda
00094 {
00095 
00096 
00097 class Client : public Glib::Object
00098 {
00099   
00100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00101 
00102 public:
00103   typedef Client CppObjectType;
00104   typedef Client_Class CppClassType;
00105   typedef GdaClient BaseObjectType;
00106   typedef GdaClientClass BaseClassType;
00107 
00108 private:  friend class Client_Class;
00109   static CppClassType client_class_;
00110 
00111 private:
00112   // noncopyable
00113   Client(const Client&);
00114   Client& operator=(const Client&);
00115 
00116 protected:
00117   explicit Client(const Glib::ConstructParams& construct_params);
00118   explicit Client(GdaClient* castitem);
00119 
00120 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00121 
00122 public:
00123   virtual ~Client();
00124 
00125 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00126   static GType get_type()      G_GNUC_CONST;
00127   static GType get_base_type() G_GNUC_CONST;
00128 #endif
00129 
00131   GdaClient*       gobj()       { return reinterpret_cast<GdaClient*>(gobject_); }
00132 
00134   const GdaClient* gobj() const { return reinterpret_cast<GdaClient*>(gobject_); }
00135 
00137   GdaClient* gobj_copy();
00138 
00139 private:
00140 
00141 protected:
00142   Client();
00143 
00144 public:
00145   
00146   static Glib::RefPtr<Client> create();
00147 
00148   
00149   Glib::RefPtr<Connection> open_connection(const Glib::ustring& dsn, const Glib::ustring& username, const Glib::ustring& password, ConnectionOptions options = (ConnectionOptions)0);
00150   
00151   Glib::RefPtr<Connection> open_connection_from_string(const Glib::ustring& provider_id, const Glib::ustring& cnc_string, ConnectionOptions options = (ConnectionOptions)0);
00152 //TODO:  _WRAP_METHOD(const GList   *get_connection_list(), gda_client_get_connection_list)
00153 
00154  //Use a special conversion here, because we should not own any part of the returned GList, and because we need to unconst the GList.:
00155   
00156 
00157   Glib::ListHandle< Glib::RefPtr<Connection> > get_connection_list();
00158   
00159   Glib::ListHandle< Glib::RefPtr<const Connection> > get_connection_list() const;
00160    
00161   
00162   Glib::RefPtr<Connection> find_connection(const Glib::ustring& dsn, const Glib::ustring& username, const Glib::ustring& password);
00163   
00164   void close_all_connections();
00165 
00166   
00167   void notify_event(const Glib::RefPtr<Connection>& cnc, ClientEvent event, const ParameterList& params);
00168   
00169   void notify_error_event(const Glib::RefPtr<Connection>& cnc, GdaError *error);
00170   
00171   void notify_connection_opened_event(const Glib::RefPtr<Connection>& cnc);
00172 //  _WRAP_METHOD(void notify_connection_closed_event(const Glib::RefPtr<Connection>& cnc), gda_client_notify_connection_closed_event)
00173   
00174   void notify_transaction_started_event(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Transaction>& xaction);
00175   
00176   void notify_transaction_committed_event(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Transaction>& xaction);
00177   
00178   void notify_transaction_cancelled_event(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Transaction>& xaction);
00179 
00180 
00181   bool begin_transaction(const Glib::RefPtr<Transaction>& xaction);
00182   
00183   bool commit_transaction(const Glib::RefPtr<Transaction>& xaction);
00184   
00185   bool rollback_transaction(const Glib::RefPtr<Transaction>& xaction);
00186 
00187   //TODO: Use C++ types:
00188   //gtkmmproc error: event_notification :  signal defs lookup failed
00189 
00190 
00191 public:
00192 
00193 public:
00194   //C++ methods used to invoke GTK+ virtual functions:
00195 
00196 protected:
00197   //GTK+ Virtual Functions (override these to change behaviour):
00198 
00199   //Default Signal Handlers::
00200 
00201 
00202 };
00203 
00204 } // namespace Gda
00205 } // namespace Gnome
00206 
00207 
00208 namespace Glib
00209 {
00215   Glib::RefPtr<Gnome::Gda::Client> wrap(GdaClient* object, bool take_copy = false);
00216 }
00217 
00218 
00219 #endif /* _LIBGDAMM_CLIENT_H */
00220 

Generated on Mon Apr 18 23:01:33 2005 for libgdamm by  doxygen 1.4.2