00001
00002
00003 #ifndef _LIBGDAMM_SERVERPROVIDER_H
00004 #define _LIBGDAMM_SERVERPROVIDER_H
00005
00006 #include <glibmm.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <libgdamm/connection.h>
00031 #include <libgdamm/command.h>
00032 #include <libgda/gda-server-provider.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdaServerProvider GdaServerProvider;
00037 typedef struct _GdaServerProviderClass GdaServerProviderClass;
00038 #endif
00039
00040
00041 namespace Gnome
00042 {
00043
00044 namespace Gda
00045 { class ServerProvider_Class; }
00046
00047 }
00048 namespace Gnome
00049 {
00050
00051 namespace Gda
00052 {
00053
00054 class Connection;
00055
00056
00057 class ServerProvider : public Glib::Object
00058 {
00059
00060 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00061
00062 public:
00063 typedef ServerProvider CppObjectType;
00064 typedef ServerProvider_Class CppClassType;
00065 typedef GdaServerProvider BaseObjectType;
00066 typedef GdaServerProviderClass BaseClassType;
00067
00068 private: friend class ServerProvider_Class;
00069 static CppClassType serverprovider_class_;
00070
00071 private:
00072
00073 ServerProvider(const ServerProvider&);
00074 ServerProvider& operator=(const ServerProvider&);
00075
00076 protected:
00077 explicit ServerProvider(const Glib::ConstructParams& construct_params);
00078 explicit ServerProvider(GdaServerProvider* castitem);
00079
00080 #endif
00081
00082 public:
00083 virtual ~ServerProvider();
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 GdaServerProvider* gobj() { return reinterpret_cast<GdaServerProvider*>(gobject_); }
00092
00094 const GdaServerProvider* gobj() const { return reinterpret_cast<GdaServerProvider*>(gobject_); }
00095
00097 GdaServerProvider* gobj_copy();
00098
00099 private:
00100
00101
00102 Glib::ustring get_version() const;
00103
00104 bool open_connection(const Glib::RefPtr<Connection>& cnc, GdaQuarkList *params, const Glib::ustring& username, const Glib::ustring& password);
00105
00106 bool close_connection(const Glib::RefPtr<Connection>& cnc);
00107
00108
00109 Glib::ustring get_server_version(const Glib::RefPtr<Connection>& cnc) const;
00110
00111 Glib::ustring get_database(const Glib::RefPtr<Connection>& cnc) const;
00112
00113 bool change_database(const Glib::RefPtr<Connection>& cnc, const Glib::ustring& name);
00114
00115 bool create_database(const Glib::RefPtr<Connection>& cnc, const Glib::ustring& name);
00116
00117 bool drop_database(const Glib::RefPtr<Connection>& cnc, const Glib::ustring& name);
00118
00119
00120
00121
00122 Glib::ListHandle< Glib::RefPtr<DataModel> > execute_command(const Glib::RefPtr<Connection>& cnc, const Command& cmd, const ParameterList& params);
00123
00124
00125 bool begin_transaction(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Transaction>& xaction);
00126
00127 bool commit_transaction(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Transaction>& xaction);
00128
00129 bool rollback_transaction(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Transaction>& xaction);
00130
00131
00132 bool supports(const Glib::RefPtr<Connection>& cnc, ConnectionFeature feature) const;
00133
00134
00135
00136 Glib::RefPtr<DataModel> get_schema(const Glib::RefPtr<Connection>& cnc, ConnectionSchema schema, const ParameterList& params);
00137
00138 Glib::RefPtr<const DataModel> get_schema(const Glib::RefPtr<Connection>& cnc, ConnectionSchema schema, const ParameterList& params) const;
00139
00140 Glib::RefPtr<DataModel> get_schema(const Glib::RefPtr<Connection>& cnc, ConnectionSchema schema);
00141 Glib::RefPtr<const DataModel> get_schema(const Glib::RefPtr<Connection>& cnc, ConnectionSchema schema) const;
00142
00143
00144 bool create_blob(const Glib::RefPtr<Connection>& cnc, GdaBlob *blob);
00145
00146
00147 Glib::ustring get_last_insert_id(const Glib::RefPtr<Connection>&, const Glib::RefPtr<DataModel>& recset) const;
00148
00149
00150
00151
00152 public:
00153
00154 public:
00155
00156
00157 protected:
00158
00159
00160
00161
00162
00163 };
00164
00165 }
00166 }
00167
00168
00169 namespace Glib
00170 {
00176 Glib::RefPtr<Gnome::Gda::ServerProvider> wrap(GdaServerProvider* object, bool take_copy = false);
00177 }
00178
00179
00180 #endif
00181