// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- /* Copyright (C) 2010 The giomm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser 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 _DEFS(giomm,gio) _PINCLUDE(glibmm/private/object_p.h) namespace Gio { _WRAP_ENUM(DBusServerFlags, GDBusServerFlags, NO_GTYPE) class DBusAuthObserver; class DBusConnection; //TODO: Add example from the C API in class docs. /** DBusServer - Helper for accepting connections. * DBusServer is a helper for listening to and accepting D-Bus connections. * Since DBusServer implements the Initable interface, its constructors can * throw an exception if construction fails. * * @newin{2,28} * @ingroup DBus */ class DBusServer : public Glib::Object, public Initable { _CLASS_GOBJECT(DBusServer, GDBusServer, G_DBUS_SERVER, Glib::Object, GObject) _IMPLEMENTS_INTERFACE(Initable) protected: DBusServer(const Glib::ustring& address, const std::string& guid, const Glib::RefPtr& observer, const Glib::RefPtr& cancellable, DBusServerFlags flags); DBusServer(const Glib::ustring& address, const std::string& guid, const Glib::RefPtr& cancellable, DBusServerFlags flags); DBusServer(const Glib::ustring& address, const std::string& guid, const Glib::RefPtr& observer, DBusServerFlags flags); DBusServer(const Glib::ustring& address, const std::string& guid, DBusServerFlags flags); public: _WRAP_METHOD_DOCS_ONLY(g_dbus_server_new_sync) /// @throw Glib::Error. static Glib::RefPtr create_sync(const Glib::ustring& address, const std::string& guid, const Glib::RefPtr& observer, const Glib::RefPtr& cancellable, DBusServerFlags flags = Gio::DBUS_SERVER_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_server_new_sync) /// @throw Glib::Error. static Glib::RefPtr create_sync(const Glib::ustring& address, const std::string& guid, const Glib::RefPtr& cancellable, DBusServerFlags flags = Gio::DBUS_SERVER_FLAGS_NONE); /// Non-cancellable version of create_sync(). static Glib::RefPtr create_sync(const Glib::ustring& address, const std::string& guid, const Glib::RefPtr& observer, DBusServerFlags flags = Gio::DBUS_SERVER_FLAGS_NONE); /// Non-cancellable version of create_sync(). static Glib::RefPtr create_sync(const Glib::ustring& address, const std::string& guid, DBusServerFlags flags = Gio::DBUS_SERVER_FLAGS_NONE); _WRAP_METHOD(void start(), g_dbus_server_start) _WRAP_METHOD(void stop(), g_dbus_server_stop) _WRAP_METHOD(bool is_active() const, g_dbus_server_is_active) _WRAP_METHOD(std::string get_guid() const, g_dbus_server_get_guid) _WRAP_METHOD(DBusServerFlags get_flags() const, g_dbus_server_get_flags) _WRAP_METHOD(Glib::ustring get_client_address() const, g_dbus_server_get_client_address) _WRAP_PROPERTY("active", bool) _WRAP_PROPERTY("address", Glib::ustring) _WRAP_PROPERTY("authentication-observer", Glib::RefPtr) _WRAP_PROPERTY("client-address", Glib::ustring) _WRAP_PROPERTY("flags", DBusServerFlags) _WRAP_PROPERTY("guid", std::string) #m4 _CONVERSION(`GDBusConnection*', `const Glib::RefPtr&', `Glib::wrap($3, true)') _WRAP_SIGNAL(bool new_connection(const Glib::RefPtr& connection), "new-connection", no_default_handler) }; } // namespace Gio