2
* Copyright © 2014 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Pete Woods <pete.woods@canonical.com>
18
#ifndef CORE_DBUS_SERVICE_WATCHER_H_
19
#define CORE_DBUS_SERVICE_WATCHER_H_
21
#include <core/signal.h>
22
#include <core/dbus/dbus.h>
23
#include <core/dbus/visibility.h>
35
* @brief Allows watching for bus name owner changes.
37
class ORG_FREEDESKTOP_DBUS_DLL_PUBLIC ServiceWatcher
41
typedef std::shared_ptr<ServiceWatcher> Ptr;
43
ServiceWatcher(const ServiceWatcher& rhs) = delete;
44
ServiceWatcher& operator=(const ServiceWatcher& rhs) = delete;
45
bool operator==(const ServiceWatcher&) const = delete;
48
* @brief Emitted when DBus detects that an owner change has occurred for the specified name.
49
* @return Signal instance
51
const core::Signal<std::string, std::string>& owner_changed() const;
54
* @brief Emitted when DBus detects that an owner has been registered for the specified name.
55
* @return Signal instance
57
const core::Signal<void>& service_registered() const;
60
* @brief Emitted when DBus detects that an owner has been unregistered for the specified name.
61
* @return Signal instance
63
const core::Signal<void>& service_unregistered() const;
66
ServiceWatcher(std::shared_ptr<Object> object, const std::string& name,
67
DBus::WatchMode watch_mode = DBus::WatchMode::owner_change);
70
std::shared_ptr<Private> d;
75
#endif // CORE_DBUS_SERVICE_WATCHER_H_