glibmm 2.60.0

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gio::DBus::InterfaceSkeleton Class Reference

Abstract base class for D-Bus interfaces on the service side. More...

`#include <giomm/dbusinterfaceskeleton.h>`

Inheritance diagram for Gio::DBus::InterfaceSkeleton:
[legend]

## Public Member Functions
| InterfaceSkeleton (InterfaceSkeleton&& src) noexcept
InterfaceSkeleton& | operator= (InterfaceSkeleton&& src) noexcept
| ~InterfaceSkeleton () noexcept override
GDBusInterfaceSkeleton* | gobj ()
| Provides access to the underlying C GObject. More...
const GDBusInterfaceSkeleton* | gobj () const
| Provides access to the underlying C GObject. More...
GDBusInterfaceSkeleton* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
void | flush ()
| If interface has outstanding changes, request for these changes to be emitted immediately. More...
Glib::RefPtr< InterfaceInfo > | get_info ()
| Gets D-Bus introspection information for the D-Bus interface implemented by interface. More...
Glib::RefPtr< const InterfaceInfo > | get_info () const
| Gets D-Bus introspection information for the D-Bus interface implemented by interface. More...
Glib::VariantBase | get_properties () const
| Gets all D-Bus properties for interface. More...
void | export_interface_skeleton (const Glib::RefPtr< Connection >& connection, const Glib::ustring& object_path)
| Exports interface at object_path on connection. More...
void | unexport ()
| Stops exporting interface on all connections it is exported on. More...
void | unexport_from_connection (const Glib::RefPtr< Connection >& connection)
| Stops exporting interface on connection. More...
Glib::RefPtr< Connection > | get_connection ()
| Gets the first connection that interface is exported on, if any. More...
Glib::RefPtr< const Connection > | get_connection () const
| Gets the first connection that interface is exported on, if any. More...
std::vector< Glib::RefPtr< Connection > > | get_connections ()
| Gets a list of the connections that interface is exported on. More...
std::vector< Glib::RefPtr< const Connection > > | get_connections () const
| Gets a list of the connections that interface is exported on. More...
bool | has_connection (const Glib::RefPtr< const Connection >& connection) const
| Checks if interface is exported on connection. More...
Glib::ustring | get_object_path () const
| Gets the object path that interface is exported on, if any. More...
InterfaceSkeletonFlags | get_flags () const
| Gets the DBusInterfaceSkeletonFlags that describes what the behavior of interface. More...
void | set_flags (InterfaceSkeletonFlags flags)
| Sets flags describing what the behavior of skeleton should be. More...
Glib::PropertyProxy< InterfaceSkeletonFlags > | property_g_flags ()
| Flags from the DBusInterfaceSkeletonFlags enumeration. More...
Glib::PropertyProxy_ReadOnly< InterfaceSkeletonFlags > | property_g_flags () const
| Flags from the DBusInterfaceSkeletonFlags enumeration. More...
Glib::SignalProxy< bool, const Glib::RefPtr< MethodInvocation >& > | signal_authorize_method ()
Public Member Functions inherited from Glib::Object
| Object (const Object&)=delete
Object& | operator= (const Object&)=delete
| Object (Object&& src) noexcept
Object& | operator= (Object&& src) noexcept
void* | get_data (const QueryQuark& key)
void | set_data (const Quark& key, void* data)
void | set_data (const Quark& key, void* data, DestroyNotify notify)
void | remove_data (const QueryQuark& quark)
void* | steal_data (const QueryQuark& quark)
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase&)=delete
ObjectBase& | operator= (const ObjectBase&)=delete
void | set_property_value (const Glib::ustring& property_name, const Glib::ValueBase& value)
| You probably want to use a specific property_*() accessor method instead. More...
void | get_property_value (const Glib::ustring& property_name, Glib::ValueBase& value) const
| You probably want to use a specific property_*() accessor method instead. More...
template<class PropertyType >
void | set_property (const Glib::ustring& property_name, const PropertyType& value)
| You probably want to use a specific property_*() accessor method instead. More...
template<class PropertyType >
void | get_property (const Glib::ustring& property_name, PropertyType& value) const
| You probably want to use a specific property_*() accessor method instead. More...
void | connect_property_changed (const Glib::ustring& property_name, const sigc::slot< void >& slot)
| You can use the signal_changed() signal of the property proxy instead. More...
void | connect_property_changed (const Glib::ustring& property_name, sigc::slot< void >&& slot)
| You can use the signal_changed() signal of the property proxy instead. More...
sigc::connection | connect_property_changed_with_return (const Glib::ustring& property_name, const sigc::slot< void >& slot)
| You can use the signal_changed() signal of the property proxy instead. More...
sigc::connection | connect_property_changed_with_return (const Glib::ustring& property_name, sigc::slot< void >&& slot)
| You can use the signal_changed() signal of the property proxy instead. More...
void | freeze_notify ()
| Increases the freeze count on object. More...
void | thaw_notify ()
| Reverts the effect of a previous call to freeze_notify(). More...
virtual void | reference () const
| Increment the reference count for this object. More...
virtual void | unreference () const
| Decrement the reference count for this object. More...
GObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GObject* | gobj () const
| Provides access to the underlying C GObject. More...
GObject* | gobj_copy () const
| Give a ref-ed copy to someone. Use for direct struct access. More...
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src)
void | remove_destroy_notify_callback (void *data) const
Public Member Functions inherited from Gio::DBus::Interface
| Interface (Interface&& src) noexcept
Interface& | operator= (Interface&& src) noexcept
| ~Interface () noexcept override
GDBusInterface* | gobj ()
| Provides access to the underlying C GObject. More...
const GDBusInterface* | gobj () const
| Provides access to the underlying C GObject. More...
Glib::RefPtr< InterfaceInfo > | get_info ()
| Gets D-Bus introspection information for the D-Bus interface implemented by interface. More...
Glib::RefPtr< const InterfaceInfo > | get_info () const
| Gets D-Bus introspection information for the D-Bus interface implemented by interface. More...
Glib::RefPtr< Gio::DBus::Object > | get_object ()
| Gets the DBusObject that interface belongs to, if any. More...
Glib::RefPtr< const Gio::DBus::Object > | get_object () const
| Gets the DBusObject that interface belongs to, if any. More...
Glib::RefPtr< Gio::DBus::Object > | dup_object ()
| Gets the DBusObject that interface belongs to, if any. More...
Glib::RefPtr< const Gio::DBus::Object > | dup_object () const
| Gets the DBusObject that interface belongs to, if any. More...
void | set_object (const Glib::RefPtr< Gio::DBus::Object >& object)
| Sets the DBusObject for interface to object. More...
virtual Glib::RefPtr< InterfaceInfo > | get_info_vfunc () const
virtual Glib::RefPtr< Gio::DBus::Object > | get_object_vfunc () const
virtual void | set_object_vfunc (const Glib::RefPtr< Gio::DBus::Object >& object)
virtual Glib::RefPtr< Gio::DBus::Object > | dup_object_vfunc () const
Public Member Functions inherited from Glib::Interface
| Interface ()
| A Default constructor. More...
| Interface (Interface&& src) noexcept
Interface& | operator= (Interface&& src) noexcept
| Interface (const Glib::Interface_Class& interface_class)
| Called by constructors of derived classes. More...
| Interface (GObject* castitem)
| Called by constructors of derived classes. More...
| ~Interface () noexcept override
| Interface (const Interface&)=delete
Interface& | operator= (const Interface&)=delete
GObject* | gobj ()
const GObject* | gobj () const

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
Static Public Member Functions inherited from Gio::DBus::Interface
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Member Functions
virtual bool | on_authorize_method (const Glib::RefPtr< MethodInvocation >& invocation)
| This is a default handler for the signal signal_authorize_method(). More...
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams& construct_params)
| Object (GObject* castitem)
| ~Object () noexcept override
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. More...
| ObjectBase (const char* custom_type_name)
| A derived constructor always overrides this choice. More...
| ObjectBase (const std::type_info& custom_type_info)
| This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. More...
| ObjectBase (ObjectBase&& src) noexcept
ObjectBase& | operator= (ObjectBase&& src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject* castitem)
void | initialize_move (GObject* castitem, Glib::ObjectBase* previous_wrapper)
Protected Member Functions inherited from Gio::DBus::Interface
| Interface ()
| You should derive from this class to use it. More...

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gio::DBus::InterfaceSkeleton > | wrap (GDBusInterfaceSkeleton* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Glib::Object
Glib::RefPtr< Glib::Object > | wrap (GObject* object, bool take_copy=false)
Related Functions inherited from Gio::DBus::Interface
Glib::RefPtr< Gio::DBus::Interface > | wrap (GDBusInterface* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
Public Types inherited from Glib::Object
using | DestroyNotify = void(*)(gpointer data)
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify

## Detailed Description

Abstract base class for D-Bus interfaces on the service side.

Since glibmm 2.38:

## Constructor & Destructor Documentation

## ◆ InterfaceSkeleton()

Gio::DBus::InterfaceSkeleton::InterfaceSkeleton | ( | InterfaceSkeleton&& | src | ) |
| noexcept

## ◆ ~InterfaceSkeleton()

Gio::DBus::InterfaceSkeleton::~InterfaceSkeleton | ( |  | ) |
| override noexcept

## Member Function Documentation

## ◆ export_interface_skeleton()

void Gio::DBus::InterfaceSkeleton::export_interface_skeleton | ( | const Glib::RefPtr< Connection >& | connection,
|  | const Glib::ustring& | object_path
| ) |  |

Exports interface at object_path on connection.

This can be called multiple times to export the same interface onto multiple connections however the object_path provided must be the same for all connections.

Use g_dbus_interface_skeleton_unexport() to unexport the object.

Since glibmm 2.30:

Parameters

  connection | A DBusConnection to export interface on.
  object_path | The path to export the interface at.

Exceptions

  Glib::Error |

## ◆ flush()

void Gio::DBus::InterfaceSkeleton::flush | ( |  | ) |

If interface has outstanding changes, request for these changes to be emitted immediately.

For example, an exported D-Bus interface may queue up property changes and emit the `org.freedesktop.DBus.Properties.PropertiesChanged` signal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one.

Since glibmm 2.30:

## ◆ get_connection() [1/2]

Glib::RefPtr<Connection> Gio::DBus::InterfaceSkeleton::get_connection | ( |  | ) |

Gets the first connection that interface is exported on, if any.

Since glibmm 2.30:

Returns
  A DBusConnection or `nullptr` if interface is not exported anywhere. Do not free, the object belongs to interface.

## ◆ get_connection() [2/2]

Glib::RefPtr<const Connection> Gio::DBus::InterfaceSkeleton::get_connection | ( |  | ) | const

Gets the first connection that interface is exported on, if any.

Since glibmm 2.30:

Returns
  A DBusConnection or `nullptr` if interface is not exported anywhere. Do not free, the object belongs to interface.

## ◆ get_connections() [1/2]

std::vector< Glib::RefPtr<Connection> > Gio::DBus::InterfaceSkeleton::get_connections | ( |  | ) |

Gets a list of the connections that interface is exported on.

Since glibmm 2.32:

Returns
  A list of all the connections that interface is exported on.

## ◆ get_connections() [2/2]

std::vector< Glib::RefPtr<const Connection> > Gio::DBus::InterfaceSkeleton::get_connections | ( |  | ) | const

Gets a list of the connections that interface is exported on.

Since glibmm 2.32:

Returns
  A list of all the connections that interface is exported on.

## ◆ get_flags()

InterfaceSkeletonFlags Gio::DBus::InterfaceSkeleton::get_flags | ( |  | ) | const

Gets the DBusInterfaceSkeletonFlags that describes what the behavior of interface.

Since glibmm 2.30:

Returns
  One or more flags from the DBusInterfaceSkeletonFlags enumeration.

## ◆ get_info() [1/2]

Glib::RefPtr<InterfaceInfo> Gio::DBus::InterfaceSkeleton::get_info | ( |  | ) |

Gets D-Bus introspection information for the D-Bus interface implemented by interface.

Since glibmm 2.30:

Returns
  A DBusInterfaceInfo (never `nullptr`). Do not free.

## ◆ get_info() [2/2]

Glib::RefPtr<const InterfaceInfo> Gio::DBus::InterfaceSkeleton::get_info | ( |  | ) | const

Gets D-Bus introspection information for the D-Bus interface implemented by interface.

Since glibmm 2.30:

Returns
  A DBusInterfaceInfo (never `nullptr`). Do not free.

## ◆ get_object_path()

Glib::ustring Gio::DBus::InterfaceSkeleton::get_object_path | ( |  | ) | const

Gets the object path that interface is exported on, if any.

Since glibmm 2.30:

Returns
  A string owned by interface or `nullptr` if interface is not exported anywhere. Do not free, the string belongs to interface.

## ◆ get_properties()

Glib::VariantBase Gio::DBus::InterfaceSkeleton::get_properties | ( |  | ) | const

Gets all D-Bus properties for interface.

Since glibmm 2.30:

Returns
  A Variant of type ['a{sv}'][G-VARIANT-TYPE-VARDICT:CAPS]. Free with Glib::variant_unref().

## ◆ get_type()

static GType Gio::DBus::InterfaceSkeleton::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GDBusInterfaceSkeleton* Gio::DBus::InterfaceSkeleton::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GDBusInterfaceSkeleton* Gio::DBus::InterfaceSkeleton::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GDBusInterfaceSkeleton* Gio::DBus::InterfaceSkeleton::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## ◆ has_connection()

bool Gio::DBus::InterfaceSkeleton::has_connection | ( | const Glib::RefPtr< const Connection >& | connection | ) | const

Checks if interface is exported on connection.

Since glibmm 2.32:

Parameters

  connection | A DBusConnection.

Returns
  `true` if interface is exported on connection, `false` otherwise.

## ◆ on_authorize_method()

virtual bool Gio::DBus::InterfaceSkeleton::on_authorize_method | ( | const Glib::RefPtr< MethodInvocation >& | invocation | ) |
| protected virtual

This is a default handler for the signal signal_authorize_method().

## ◆ operator=()

InterfaceSkeleton& Gio::DBus::InterfaceSkeleton::operator= | ( | InterfaceSkeleton&& | src | ) |
| noexcept

## ◆ property_g_flags() [1/2]

Glib::PropertyProxy< InterfaceSkeletonFlags > Gio::DBus::InterfaceSkeleton::property_g_flags | ( |  | ) |

Flags from the DBusInterfaceSkeletonFlags enumeration.

Since glibmm 2.30:

Default value: DBUS_INTERFACE_SKELETON_FLAGS_NONE

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_g_flags() [2/2]

Glib::PropertyProxy_ReadOnly< InterfaceSkeletonFlags > Gio::DBus::InterfaceSkeleton::property_g_flags | ( |  | ) | const

Flags from the DBusInterfaceSkeletonFlags enumeration.

Since glibmm 2.30:

Default value: DBUS_INTERFACE_SKELETON_FLAGS_NONE

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ set_flags()

void Gio::DBus::InterfaceSkeleton::set_flags | ( | InterfaceSkeletonFlags | flags | ) |

Sets flags describing what the behavior of skeleton should be.

Since glibmm 2.30:

Parameters

  flags | Flags from the DBusInterfaceSkeletonFlags enumeration.

## ◆ signal_authorize_method()

Glib::SignalProxy< bool,const Glib::RefPtr<MethodInvocation>& > Gio::DBus::InterfaceSkeleton::signal_authorize_method | ( |  | ) |

Slot Prototype:
  `bool on_my_authorize_method(const Glib::RefPtr<MethodInvocation>& invocation)`

Flags: Run Last

Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.

Note that this signal is emitted in a thread dedicated to handling the method call so handlers are allowed to perform blocking IO. This means that it is appropriate to call e.g. polkit_authority_check_authorization_sync() with the POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION flag set.

If `false` is returned then no further handlers are run and the signal handler must take a reference to invocation and finish handling the call (e.g. return an error via g_dbus_method_invocation_return_error()).

Otherwise, if `true` is returned, signal emission continues. If no handlers return `false`, then the method is dispatched. If interface has an enclosing DBusObjectSkeleton, then the DBusObjectSkeleton::signal_authorize_method() signal handlers run before the handlers for this signal.

The default class handler just returns `true`.

Please note that the common case is optimized: if no signals handlers are connected and the default class handler isn't overridden (for both interface and the enclosing DBusObjectSkeleton, if any) and DBusInterfaceSkeleton::property_g_flags() does not have the DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD flags set, no dedicated thread is ever used and the call will be handled in the same thread as the object that interface belongs to was exported in.

Since glibmm 2.30:

Parameters

  invocation | A DBusMethodInvocation.

Returns
  `true` if the call is authorized, `false` otherwise.

## ◆ unexport()

void Gio::DBus::InterfaceSkeleton::unexport | ( |  | ) |

Stops exporting interface on all connections it is exported on.

To unexport interface from only a single connection, use g_dbus_interface_skeleton_unexport_from_connection()

Since glibmm 2.30:

## ◆ unexport_from_connection()

void Gio::DBus::InterfaceSkeleton::unexport_from_connection | ( | const Glib::RefPtr< Connection >& | connection | ) |

Stops exporting interface on connection.

To stop exporting on all connections the interface is exported on, use g_dbus_interface_skeleton_unexport().

Since glibmm 2.32:

Parameters

  connection | A DBusConnection.

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gio::DBus::InterfaceSkeleton > wrap | ( | GDBusInterfaceSkeleton * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.