glibmm 2.82.0
|
Abstract base class for D-Bus interfaces on the service side. More...
#include <giomm/dbusinterfaceskeleton.h>
Public Types | |
enum class | Flags { Flags::NONE = 0x0 , Flags::HANDLE_METHOD_INVOCATIONS_IN_THREAD = (1<<0) } |
Flags describing the behavior of a DBusInterfaceSkeleton instance. More... | |
Public Types inherited from Glib::Object | |
using | DestroyNotify = void(*)(gpointer data) |
Public Member Functions | |
InterfaceSkeleton (InterfaceSkeleton &&src) noexcept | |
InterfaceSkeleton & | operator= (InterfaceSkeleton &&src) noexcept |
~InterfaceSkeleton () noexcept override | |
GDBusInterfaceSkeleton * | gobj () |
Provides access to the underlying C GObject. | |
const GDBusInterfaceSkeleton * | gobj () const |
Provides access to the underlying C GObject. | |
GDBusInterfaceSkeleton * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
void | flush () |
If interface has outstanding changes, request for these changes to be emitted immediately. | |
Glib::RefPtr< InterfaceInfo > | get_info () |
Gets D-Bus introspection information for the D-Bus interface implemented by interface. | |
Glib::RefPtr< const InterfaceInfo > | get_info () const |
Gets D-Bus introspection information for the D-Bus interface implemented by interface. | |
Glib::VariantBase | get_properties () const |
Gets all D-Bus properties for interface. | |
void | export_interface_skeleton (const Glib::RefPtr< Connection > &connection, const Glib::ustring &object_path) |
Exports interface at object_path on connection. | |
void | unexport () |
Stops exporting interface on all connections it is exported on. | |
void | unexport_from_connection (const Glib::RefPtr< Connection > &connection) |
Stops exporting interface on connection. | |
Glib::RefPtr< Connection > | get_connection () |
Gets the first connection that interface is exported on, if any. | |
Glib::RefPtr< const Connection > | get_connection () const |
Gets the first connection that interface is exported on, if any. | |
std::vector< Glib::RefPtr< Connection > > | get_connections () |
Gets a list of the connections that interface is exported on. | |
std::vector< Glib::RefPtr< const Connection > > | get_connections () const |
Gets a list of the connections that interface is exported on. | |
bool | has_connection (const Glib::RefPtr< const Connection > &connection) const |
Checks if interface is exported on connection. | |
Glib::ustring | get_object_path () const |
Gets the object path that interface is exported on, if any. | |
Flags | get_flags () const |
Gets the Gio::DBus::InterfaceSkeleton::Flags that describes what the behavior of interface. | |
void | set_flags (Flags flags) |
Sets flags describing what the behavior of skeleton should be. | |
Glib::PropertyProxy< Flags > | property_g_flags () |
Flags from the Gio::DBus::InterfaceSkeleton::Flags enumeration. | |
Glib::PropertyProxy_ReadOnly< Flags > | property_g_flags () const |
Flags from the Gio::DBus::InterfaceSkeleton::Flags enumeration. | |
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_with_c_callback (const Quark & key, void *data, GDestroyNotify notify) |
void | set_data (const Quark & key, void *data, DestroyNotify notify) |
Prefer set_data_with_c_callback() with a callback with C linkage. | |
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. | |
void | get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const |
You probably want to use a specific property_*() accessor method instead. | |
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. | |
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. | |
template<class PropertyType > | |
PropertyType | get_property (const Glib::ustring & property_name) const |
You probably want to use a specific property_*() accessor method instead. | |
sigc::connection | 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. | |
sigc::connection | connect_property_changed (const Glib::ustring & property_name, sigc::slot< void()> &&slot) |
You can use the signal_changed() signal of the property proxy instead. | |
void | freeze_notify () |
Increases the freeze count on object. | |
void | thaw_notify () |
Reverts the effect of a previous call to freeze_notify(). | |
virtual void | reference () const |
Increment the reference count for this object. | |
virtual void | unreference () const |
Decrement the reference count for this object. | |
GObject * | gobj () |
Provides access to the underlying C GObject. | |
const GObject * | gobj () const |
Provides access to the underlying C GObject. | |
GObject * | gobj_copy () const |
Give a ref-ed copy to someone. Use for direct struct access. | |
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. | |
const GDBusInterface * | gobj () const |
Provides access to the underlying C GObject. | |
Glib::RefPtr< InterfaceInfo > | get_info () |
Gets D-Bus introspection information for the D-Bus interface implemented by interface. | |
Glib::RefPtr< const InterfaceInfo > | get_info () const |
Gets D-Bus introspection information for the D-Bus interface implemented by interface. | |
Glib::RefPtr< Gio::DBus::Object > | get_object () |
Gets the DBusObject that interface belongs to, if any. | |
Glib::RefPtr< const Gio::DBus::Object > | get_object () const |
Gets the DBusObject that interface belongs to, if any. | |
Glib::RefPtr< Gio::DBus::Object > | dup_object () |
Gets the DBusObject that interface belongs to, if any. | |
Glib::RefPtr< const Gio::DBus::Object > | dup_object () const |
Gets the DBusObject that interface belongs to, if any. | |
void | set_object (const Glib::RefPtr< Gio::DBus::Object > &object) |
Sets the DBusObject for interface to object. | |
Public Member Functions inherited from Glib::Interface | |
Interface () | |
A Default constructor. | |
Interface (Interface &&src) noexcept | |
Interface & | operator= (Interface &&src) noexcept |
Interface (const Glib::Interface_Class &interface_class) | |
Called by constructors of derived classes. | |
Interface (GObject *castitem) | |
Called by constructors of derived classes. | |
~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. | |
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. | |
Protected Member Functions | |
virtual bool | on_authorize_method (const Glib::RefPtr< MethodInvocation > &invocation) |
This is a default handler for the signal signal_authorize_method(). | |
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. | |
ObjectBase (const char *custom_type_name) | |
A derived constructor always overrides this choice. | |
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. | |
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. | |
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 |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gio::DBus::InterfaceSkeleton > | wrap (GDBusInterfaceSkeleton *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Related Symbols inherited from Glib::Object | |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
Related Symbols inherited from Gio::DBus::Interface | |
Glib::RefPtr< Gio::DBus::Interface > | wrap (GDBusInterface *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Abstract base class for D-Bus interfaces on the service side.
|
noexcept |
|
overridenoexcept |
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.
connection | A Gio::DBus::Connection to export interface on. |
object_path | The path to export the interface at. |
Glib::Error |
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.
Glib::RefPtr< Connection > Gio::DBus::InterfaceSkeleton::get_connection | ( | ) |
Gets the first connection that interface is exported on, if any.
nullptr
if interface is not exported anywhere. Do not free, the object belongs to interface. Glib::RefPtr< const Connection > Gio::DBus::InterfaceSkeleton::get_connection | ( | ) | const |
Gets the first connection that interface is exported on, if any.
nullptr
if interface is not exported anywhere. Do not free, the object belongs to interface. std::vector< Glib::RefPtr< Connection > > Gio::DBus::InterfaceSkeleton::get_connections | ( | ) |
Gets a list of the connections that interface is exported on.
std::vector< Glib::RefPtr< const Connection > > Gio::DBus::InterfaceSkeleton::get_connections | ( | ) | const |
Gets a list of the connections that interface is exported on.
Flags Gio::DBus::InterfaceSkeleton::get_flags | ( | ) | const |
Gets the Gio::DBus::InterfaceSkeleton::Flags that describes what the behavior of interface.
Glib::RefPtr< InterfaceInfo > Gio::DBus::InterfaceSkeleton::get_info | ( | ) |
Gets D-Bus introspection information for the D-Bus interface implemented by interface.
nullptr
). Do not free. Glib::RefPtr< const InterfaceInfo > Gio::DBus::InterfaceSkeleton::get_info | ( | ) | const |
Gets D-Bus introspection information for the D-Bus interface implemented by interface.
nullptr
). Do not free. Glib::ustring Gio::DBus::InterfaceSkeleton::get_object_path | ( | ) | const |
Gets the object path that interface is exported on, if any.
nullptr
if interface is not exported anywhere. Do not free, the string belongs to interface. Glib::VariantBase Gio::DBus::InterfaceSkeleton::get_properties | ( | ) | const |
Gets all D-Bus properties for interface.
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
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.
bool Gio::DBus::InterfaceSkeleton::has_connection | ( | const Glib::RefPtr< const Connection > & | connection | ) | const |
Checks if interface is exported on connection.
connection | A Gio::DBus::Connection. |
true
if interface is exported on connection, false
otherwise.
|
protectedvirtual |
This is a default handler for the signal signal_authorize_method().
|
noexcept |
Glib::PropertyProxy< Flags > Gio::DBus::InterfaceSkeleton::property_g_flags | ( | ) |
Flags from the Gio::DBus::InterfaceSkeleton::Flags enumeration.
Default value: Gio::DBus::InterfaceSkeleton::Flags::NONE
Glib::PropertyProxy_ReadOnly< Flags > Gio::DBus::InterfaceSkeleton::property_g_flags | ( | ) | const |
Flags from the Gio::DBus::InterfaceSkeleton::Flags enumeration.
Default value: Gio::DBus::InterfaceSkeleton::Flags::NONE
Sets flags describing what the behavior of skeleton should be.
flags | Flags from the Gio::DBus::InterfaceSkeleton::Flags enumeration. |
Glib::SignalProxy< bool(const Glib::RefPtr< MethodInvocation > &)> Gio::DBus::InterfaceSkeleton::signal_authorize_method | ( | ) |
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 Gio::DBus::InterfaceSkeleton::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.
invocation | A DBusMethodInvocation. |
true
if the call is authorized, false
otherwise. 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()
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().
connection | A Gio::DBus::Connection. |
|
related |
A Glib::wrap() method for this object.
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. |