1 /* This Source Code Form is subject to the terms of the Mozilla Public
\r
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
\r
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
\r
4 #ifndef COMMONAPI_DBUS_DBUS_DAEMON_PROXY_H_
\r
5 #define COMMONAPI_DBUS_DBUS_DAEMON_PROXY_H_
\r
7 #include "DBusProxy.h"
\r
8 #include "DBusEvent.h"
\r
10 #include "DBusServiceStatusEvent.h"
\r
15 namespace CommonAPI {
\r
18 class DBusServiceStatusEvent;
\r
20 class DBusDaemonProxy: public DBusProxy {
\r
23 typedef Event<std::string, std::string, std::string> NameOwnerChangedEvent;
\r
24 typedef std::function<void(const CommonAPI::CallStatus&, std::vector<std::string>)> ListNamesAsyncCallback;
\r
25 typedef std::function<void(const CommonAPI::CallStatus&, bool)> NameHasOwnerAsyncCallback;
\r
28 DBusDaemonProxy(const std::shared_ptr<DBusProxyConnection>& connection);
\r
30 const char* getInterfaceName() const;
\r
32 NameOwnerChangedEvent& getNameOwnerChangedEvent();
\r
34 void listNames(CommonAPI::CallStatus& callStatus, std::vector<std::string>& busNames) const;
\r
35 std::future<CallStatus> listNamesAsync(ListNamesAsyncCallback listNamesAsyncCallback) const;
\r
37 void nameHasOwner(const std::string& busName, CommonAPI::CallStatus& callStatus, bool& hasOwner) const;
\r
38 std::future<CallStatus> nameHasOwnerAsync(const std::string& busName, NameHasOwnerAsyncCallback nameHasOwnerAsyncCallback) const;
\r
41 void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const;
\r
44 DBusEvent<NameOwnerChangedEvent> nameOwnerChangedEvent_;
\r
49 } // namespace CommonAPI
\r
51 #endif // COMMONAPI_DBUS_DBUS_DAEMON_PROXY_H_
\r