/* $Id: client.hg,v 1.5 2004/11/28 15:07:16 murrayc Exp $ */ // -*- C++ -*- // /* client.h * * Copyright 2003 libgdamm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include //#include _DEFS(libgdamm,libgda) _PINCLUDE(glibmm/private/object_p.h) namespace Gnome { namespace Gda { _WRAP_ENUM(ClientEvent, GdaClientEvent) class Client : public Glib::Object { _CLASS_GOBJECT(Client, GdaClient, GDA_CLIENT, Glib::Object, GObject) protected: _CTOR_DEFAULT() public: _WRAP_CREATE() _WRAP_METHOD(Glib::RefPtr open_connection(const Glib::ustring& dsn, const Glib::ustring& username, const Glib::ustring& password, ConnectionOptions options = (ConnectionOptions)0), gda_client_open_connection) _WRAP_METHOD(Glib::RefPtr open_connection_from_string(const Glib::ustring& provider_id, const Glib::ustring& cnc_string, ConnectionOptions options = (ConnectionOptions)0), gda_client_open_connection_from_string) //TODO: _WRAP_METHOD(const GList *get_connection_list(), gda_client_get_connection_list) //Use a special conversion here, because we should not own any part of the returned GList, and because we need to unconst the GList.: #m4 _CONVERSION(`const GList*',`Glib::ListHandle< Glib::RefPtr >',`$2((GList*)$3, Glib::OWNERSHIP_SHALLOW)') #m4 _CONVERSION(`const GList*',`Glib::ListHandle< Glib::RefPtr >',`$2((GList*)$3, Glib::OWNERSHIP_SHALLOW)') _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr > get_connection_list(), gda_client_get_connection_list) _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr > get_connection_list() const, gda_client_get_connection_list) _WRAP_METHOD(Glib::RefPtr find_connection(const Glib::ustring& dsn, const Glib::ustring& username, const Glib::ustring& password), gda_client_find_connection) _WRAP_METHOD(void close_all_connections(), gda_client_close_all_connections) _WRAP_METHOD(void notify_event(const Glib::RefPtr& cnc, ClientEvent event, const ParameterList& params), gda_client_notify_event) _WRAP_METHOD(void notify_error_event(const Glib::RefPtr& cnc, GdaError *error), gda_client_notify_error_event) _WRAP_METHOD(void notify_connection_opened_event(const Glib::RefPtr& cnc), gda_client_notify_connection_opened_event) // _WRAP_METHOD(void notify_connection_closed_event(const Glib::RefPtr& cnc), gda_client_notify_connection_closed_event) _WRAP_METHOD(void notify_transaction_started_event(const Glib::RefPtr& cnc, const Glib::RefPtr& xaction), gda_client_notify_transaction_started_event) _WRAP_METHOD(void notify_transaction_committed_event(const Glib::RefPtr& cnc, const Glib::RefPtr& xaction), gda_client_notify_transaction_committed_event) _WRAP_METHOD(void notify_transaction_cancelled_event(const Glib::RefPtr& cnc, const Glib::RefPtr& xaction), gda_client_notify_transaction_cancelled_event) _WRAP_METHOD(bool begin_transaction(const Glib::RefPtr& xaction), gda_client_begin_transaction) _WRAP_METHOD(bool commit_transaction(const Glib::RefPtr& xaction), gda_client_commit_transaction) _WRAP_METHOD(bool rollback_transaction(const Glib::RefPtr& xaction), gda_client_rollback_transaction) //TODO: Use C++ types: _WRAP_SIGNAL(void event_notification(const Glib::RefPtr cnc, GdaClientEvent event, const ParameterList& params), "event_notification") }; } // namespace Gda } // namespace Gnome