1// -*- C++ -*- // 2 3/* config.h 4 * 5 * Copyright 2006 libgdamm Development Team 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or(at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free 19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 */ 21 22#include <glibmm/object.h> 23#include <libgdamm/serverprovider.h> 24#include <libgdamm/datamodel.h> 25#include <libgda/gda-config.h> 26 27_DEFS(libgdamm,libgda) 28_PINCLUDE(glibmm/private/object_p.h) 29 30namespace Gnome 31{ 32 33namespace Gda 34{ 35 36_WRAP_GERROR(ConfigError, GdaConfigError, GDA_CONFIG_ERROR) 37 38 39/** Configuration — Access/Management of libgda configuration. 40 * 41 * @ingroup Configuration 42 */ 43class Config : public Glib::Object 44{ 45 _CLASS_GOBJECT(Config, GdaConfig, GDA_CONFIG, Glib::Object, GObject) 46protected: 47 _CTOR_DEFAULT; 48public: 49 _WRAP_METHOD(static Glib::RefPtr<Config> get(), gda_config_get, refreturn) 50 51 _WRAP_METHOD(static GdaDsnInfo* get_dsn_info(const Glib::ustring& dsn_name), gda_config_get_dsn_info) 52 _WRAP_METHOD(static bool dsn_needs_authentication(const Glib::ustring& dsn_name), gda_config_dsn_needs_authentication) 53 54 _WRAP_METHOD(static Glib::RefPtr<DataModel> list_dsn(), gda_config_list_dsn) 55 56 _WRAP_METHOD(static Glib::RefPtr<ServerProvider> get_provider(const Glib::ustring& provider_name), gda_config_get_provider, errthrow) 57 58 _WRAP_METHOD(static Glib::RefPtr<DataModel> list_providers(), gda_config_list_providers) 59 60 _WRAP_METHOD(static int get_nb_dsn(), gda_config_get_nb_dsn) 61 62 _WRAP_METHOD(static bool can_modify_system_config(), gda_config_can_modify_system_config) 63 64 #m4 _CONVERSION(`gpointer',`GdaDsnInfo*',`(GdaDsnInfo*)($3)') 65 _WRAP_SIGNAL(void dsn_added(GdaDsnInfo* info), "dsn-added", no_default_handler) 66 _WRAP_SIGNAL(void dsn_changed(GdaDsnInfo* info), "dsn-changed", no_default_handler) 67 _WRAP_SIGNAL(void dsn_removed(GdaDsnInfo* info), "dsn-removed", no_default_handler) 68 _WRAP_SIGNAL(void dsn_to_be_removed(GdaDsnInfo* info), "dsn-to-be-removed", no_default_handler) 69 70 _WRAP_PROPERTY("system-filename", Glib::ustring) 71 _WRAP_PROPERTY("user-filename", Glib::ustring) 72}; 73 74} // namespace Gda 75} // namespace Gnome 76