* @return A subscription identifier that can be used with signal_unsubscribe().@n
* If failed, a negative value.
*/
- int64_t signal_subscribe(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener);
+ int64_t subscribe_system_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener);
+ int64_t subscribe_session_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener);
/**
* @brief Unsubscribes from signals.
*/
- void signal_unsubscribe(int64_t subscription_id);
+ void unsubscribe_system_signal(int64_t subscription_id);
+ void unsubscribe_session_signal(int64_t subscription_id);
} /* namespace ctx::dbus_server */
} /* namespace ctx */
class dbus_server_iface {
public:
virtual ~dbus_server_iface() {}
- virtual int64_t signal_subscribe(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener) = 0;
- virtual void signal_unsubscribe(int64_t subscription_id) = 0;
+ virtual int64_t subscribe_system_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener) = 0;
+ virtual int64_t subscribe_session_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener) = 0;
+ virtual void unsubscribe_system_signal(int64_t subscription_id) = 0;
+ virtual void unsubscribe_session_signal(int64_t subscription_id) = 0;
}; /* class ctx::dbus_server */
namespace dbus_server {
_instance = svr;
}
-int64_t ctx::dbus_server::signal_subscribe(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener)
+int64_t ctx::dbus_server::subscribe_system_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener)
{
IF_FAIL_RETURN_TAG(_instance, false, _E, "Not initialized");
- return _instance->signal_subscribe(sender, path, iface, name, listener);
+ return _instance->subscribe_system_signal(sender, path, iface, name, listener);
}
-void ctx::dbus_server::signal_unsubscribe(int64_t subscription_id)
+int64_t ctx::dbus_server::subscribe_session_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener)
+{
+ IF_FAIL_RETURN_TAG(_instance, false, _E, "Not initialized");
+ return _instance->subscribe_session_signal(sender, path, iface, name, listener);
+}
+
+void ctx::dbus_server::unsubscribe_system_signal(int64_t subscription_id)
+{
+ IF_FAIL_VOID_TAG(_instance, _E, "Not initialized");
+ _instance->unsubscribe_system_signal(subscription_id);
+}
+
+void ctx::dbus_server::unsubscribe_session_signal(int64_t subscription_id)
{
IF_FAIL_VOID_TAG(_instance, _E, "Not initialized");
- _instance->signal_unsubscribe(subscription_id);
+ _instance->unsubscribe_session_signal(subscription_id);
}