diff --git a/internal/platform/implementation/linux/generated/dbus/avahi/entrygroup_client.h b/internal/platform/implementation/linux/generated/dbus/avahi/entrygroup_client.h new file mode 100644 index 00000000..c689b2bd --- /dev/null +++ b/internal/platform/implementation/linux/generated/dbus/avahi/entrygroup_client.h @@ -0,0 +1,103 @@ + +/* + * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! + */ + +#ifndef __sdbuscpp___home_lasan_Dev_nearby_latest_internal_platform_implementation_linux_generated_dbus_avahi_entrygroup_client_v2_h__proxy__H__ +#define __sdbuscpp___home_lasan_Dev_nearby_latest_internal_platform_implementation_linux_generated_dbus_avahi_entrygroup_client_v2_h__proxy__H__ + +#include +#include +#include + +namespace org { +namespace freedesktop { +namespace Avahi { + +class EntryGroup_proxy +{ +public: + static constexpr const char* INTERFACE_NAME = "org.freedesktop.Avahi.EntryGroup"; + +protected: + EntryGroup_proxy(sdbus::IProxy& proxy) + : m_proxy(proxy) + { + } + + EntryGroup_proxy(const EntryGroup_proxy&) = delete; + EntryGroup_proxy& operator=(const EntryGroup_proxy&) = delete; + EntryGroup_proxy(EntryGroup_proxy&&) = delete; + EntryGroup_proxy& operator=(EntryGroup_proxy&&) = delete; + + ~EntryGroup_proxy() = default; + + void registerProxy() + { + m_proxy.uponSignal("StateChanged").onInterface(INTERFACE_NAME).call([this](const int32_t& state, const std::string& error){ this->onStateChanged(state, error); }); + } + + virtual void onStateChanged(const int32_t& state, const std::string& error) = 0; + +public: + void Free() + { + m_proxy.callMethod("Free").onInterface(INTERFACE_NAME); + } + + void Commit() + { + m_proxy.callMethod("Commit").onInterface(INTERFACE_NAME); + } + + void Reset() + { + m_proxy.callMethod("Reset").onInterface(INTERFACE_NAME); + } + + int32_t GetState() + { + int32_t result; + m_proxy.callMethod("GetState").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + bool IsEmpty() + { + bool result; + m_proxy.callMethod("IsEmpty").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + void AddService(const int32_t& interface, const int32_t& protocol, const uint32_t& flags, const std::string& name, const std::string& type, const std::string& domain, const std::string& host, const uint16_t& port, const std::vector>& txt) + { + m_proxy.callMethod("AddService").onInterface(INTERFACE_NAME).withArguments(interface, protocol, flags, name, type, domain, host, port, txt); + } + + void AddServiceSubtype(const int32_t& interface, const int32_t& protocol, const uint32_t& flags, const std::string& name, const std::string& type, const std::string& domain, const std::string& subtype) + { + m_proxy.callMethod("AddServiceSubtype").onInterface(INTERFACE_NAME).withArguments(interface, protocol, flags, name, type, domain, subtype); + } + + void UpdateServiceTxt(const int32_t& interface, const int32_t& protocol, const uint32_t& flags, const std::string& name, const std::string& type, const std::string& domain, const std::vector>& txt) + { + m_proxy.callMethod("UpdateServiceTxt").onInterface(INTERFACE_NAME).withArguments(interface, protocol, flags, name, type, domain, txt); + } + + void AddAddress(const int32_t& interface, const int32_t& protocol, const uint32_t& flags, const std::string& name, const std::string& address) + { + m_proxy.callMethod("AddAddress").onInterface(INTERFACE_NAME).withArguments(interface, protocol, flags, name, address); + } + + void AddRecord(const int32_t& interface, const int32_t& protocol, const uint32_t& flags, const std::string& name, const uint16_t& clazz, const uint16_t& type, const uint32_t& ttl, const std::vector& rdata) + { + m_proxy.callMethod("AddRecord").onInterface(INTERFACE_NAME).withArguments(interface, protocol, flags, name, clazz, type, ttl, rdata); + } + +private: + sdbus::IProxy& m_proxy; +}; + +}}} // namespaces + +#endif diff --git a/internal/platform/implementation/linux/generated/dbus/avahi/server2_client.h b/internal/platform/implementation/linux/generated/dbus/avahi/server2_client.h new file mode 100644 index 00000000..b0a95f3b --- /dev/null +++ b/internal/platform/implementation/linux/generated/dbus/avahi/server2_client.h @@ -0,0 +1,417 @@ + +/* + * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! + */ + +#ifndef __sdbuscpp___home_lasan_Dev_nearby_latest_internal_platform_implementation_linux_generated_dbus_avahi_server2_client_v2_h__proxy__H__ +#define __sdbuscpp___home_lasan_Dev_nearby_latest_internal_platform_implementation_linux_generated_dbus_avahi_server2_client_v2_h__proxy__H__ + +#include +#include +#include + +namespace org { +namespace freedesktop { +namespace Avahi { + +class Server_proxy +{ +public: + static constexpr const char* INTERFACE_NAME = "org.freedesktop.Avahi.Server"; + +protected: + Server_proxy(sdbus::IProxy& proxy) + : m_proxy(proxy) + { + } + + Server_proxy(const Server_proxy&) = delete; + Server_proxy& operator=(const Server_proxy&) = delete; + Server_proxy(Server_proxy&&) = delete; + Server_proxy& operator=(Server_proxy&&) = delete; + + ~Server_proxy() = default; + + void registerProxy() + { + m_proxy.uponSignal("StateChanged").onInterface(INTERFACE_NAME).call([this](const int32_t& state, const std::string& error){ this->onStateChanged(state, error); }); + } + + virtual void onStateChanged(const int32_t& state, const std::string& error) = 0; + + virtual void onResolveServiceReply(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const std::string& host, const int32_t& aprotocol, const std::string& address, const uint16_t& port, const std::vector>& txt, const uint32_t& flags, std::optional error) = 0; + +public: + std::string GetVersionString() + { + std::string result; + m_proxy.callMethod("GetVersionString").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + uint32_t GetAPIVersion() + { + uint32_t result; + m_proxy.callMethod("GetAPIVersion").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + std::string GetHostName() + { + std::string result; + m_proxy.callMethod("GetHostName").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + void SetHostName(const std::string& name) + { + m_proxy.callMethod("SetHostName").onInterface(INTERFACE_NAME).withArguments(name); + } + + std::string GetHostNameFqdn() + { + std::string result; + m_proxy.callMethod("GetHostNameFqdn").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + std::string GetDomainName() + { + std::string result; + m_proxy.callMethod("GetDomainName").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + bool IsNSSSupportAvailable() + { + bool result; + m_proxy.callMethod("IsNSSSupportAvailable").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + int32_t GetState() + { + int32_t result; + m_proxy.callMethod("GetState").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + uint32_t GetLocalServiceCookie() + { + uint32_t result; + m_proxy.callMethod("GetLocalServiceCookie").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + std::string GetAlternativeHostName(const std::string& name) + { + std::string result; + m_proxy.callMethod("GetAlternativeHostName").onInterface(INTERFACE_NAME).withArguments(name).storeResultsTo(result); + return result; + } + + std::string GetAlternativeServiceName(const std::string& name) + { + std::string result; + m_proxy.callMethod("GetAlternativeServiceName").onInterface(INTERFACE_NAME).withArguments(name).storeResultsTo(result); + return result; + } + + std::string GetNetworkInterfaceNameByIndex(const int32_t& index) + { + std::string result; + m_proxy.callMethod("GetNetworkInterfaceNameByIndex").onInterface(INTERFACE_NAME).withArguments(index).storeResultsTo(result); + return result; + } + + int32_t GetNetworkInterfaceIndexByName(const std::string& name) + { + int32_t result; + m_proxy.callMethod("GetNetworkInterfaceIndexByName").onInterface(INTERFACE_NAME).withArguments(name).storeResultsTo(result); + return result; + } + + std::tuple ResolveHostName(const int32_t& interface, const int32_t& protocol, const std::string& name, const int32_t& aprotocol, const uint32_t& flags) + { + std::tuple result; + m_proxy.callMethod("ResolveHostName").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, aprotocol, flags).storeResultsTo(result); + return result; + } + + std::tuple ResolveAddress(const int32_t& interface, const int32_t& protocol, const std::string& address, const uint32_t& flags) + { + std::tuple result; + m_proxy.callMethod("ResolveAddress").onInterface(INTERFACE_NAME).withArguments(interface, protocol, address, flags).storeResultsTo(result); + return result; + } + + sdbus::PendingAsyncCall ResolveService(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const int32_t& aprotocol, const uint32_t& flags) + { + return m_proxy.callMethodAsync("ResolveService").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, type, domain, aprotocol, flags).uponReplyInvoke([this](std::optional error, const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const std::string& host, const int32_t& aprotocol, const std::string& address, const uint16_t& port, const std::vector>& txt, const uint32_t& flags){ this->onResolveServiceReply(interface, protocol, name, type, domain, host, aprotocol, address, port, txt, flags, std::move(error)); }); + } + + sdbus::ObjectPath EntryGroupNew() + { + sdbus::ObjectPath result; + m_proxy.callMethod("EntryGroupNew").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath DomainBrowserNew(const int32_t& interface, const int32_t& protocol, const std::string& domain, const int32_t& btype, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("DomainBrowserNew").onInterface(INTERFACE_NAME).withArguments(interface, protocol, domain, btype, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath ServiceTypeBrowserNew(const int32_t& interface, const int32_t& protocol, const std::string& domain, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("ServiceTypeBrowserNew").onInterface(INTERFACE_NAME).withArguments(interface, protocol, domain, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath ServiceBrowserNew(const int32_t& interface, const int32_t& protocol, const std::string& type, const std::string& domain, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("ServiceBrowserNew").onInterface(INTERFACE_NAME).withArguments(interface, protocol, type, domain, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath ServiceResolverNew(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const int32_t& aprotocol, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("ServiceResolverNew").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, type, domain, aprotocol, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath HostNameResolverNew(const int32_t& interface, const int32_t& protocol, const std::string& name, const int32_t& aprotocol, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("HostNameResolverNew").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, aprotocol, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath AddressResolverNew(const int32_t& interface, const int32_t& protocol, const std::string& address, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("AddressResolverNew").onInterface(INTERFACE_NAME).withArguments(interface, protocol, address, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath RecordBrowserNew(const int32_t& interface, const int32_t& protocol, const std::string& name, const uint16_t& clazz, const uint16_t& type, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("RecordBrowserNew").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, clazz, type, flags).storeResultsTo(result); + return result; + } + +private: + sdbus::IProxy& m_proxy; +}; + +}}} // namespaces + +namespace org { +namespace freedesktop { +namespace Avahi { + +class Server2_proxy +{ +public: + static constexpr const char* INTERFACE_NAME = "org.freedesktop.Avahi.Server2"; + +protected: + Server2_proxy(sdbus::IProxy& proxy) + : m_proxy(proxy) + { + } + + Server2_proxy(const Server2_proxy&) = delete; + Server2_proxy& operator=(const Server2_proxy&) = delete; + Server2_proxy(Server2_proxy&&) = delete; + Server2_proxy& operator=(Server2_proxy&&) = delete; + + ~Server2_proxy() = default; + + void registerProxy() + { + m_proxy.uponSignal("StateChanged").onInterface(INTERFACE_NAME).call([this](const int32_t& state, const std::string& error){ this->onStateChanged(state, error); }); + } + + virtual void onStateChanged(const int32_t& state, const std::string& error) = 0; + + virtual void onResolveServiceReply(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const std::string& host, const int32_t& aprotocol, const std::string& address, const uint16_t& port, const std::vector>& txt, const uint32_t& flags, std::optional error) = 0; + +public: + std::string GetVersionString() + { + std::string result; + m_proxy.callMethod("GetVersionString").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + uint32_t GetAPIVersion() + { + uint32_t result; + m_proxy.callMethod("GetAPIVersion").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + std::string GetHostName() + { + std::string result; + m_proxy.callMethod("GetHostName").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + void SetHostName(const std::string& name) + { + m_proxy.callMethod("SetHostName").onInterface(INTERFACE_NAME).withArguments(name); + } + + std::string GetHostNameFqdn() + { + std::string result; + m_proxy.callMethod("GetHostNameFqdn").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + std::string GetDomainName() + { + std::string result; + m_proxy.callMethod("GetDomainName").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + bool IsNSSSupportAvailable() + { + bool result; + m_proxy.callMethod("IsNSSSupportAvailable").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + int32_t GetState() + { + int32_t result; + m_proxy.callMethod("GetState").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + uint32_t GetLocalServiceCookie() + { + uint32_t result; + m_proxy.callMethod("GetLocalServiceCookie").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + std::string GetAlternativeHostName(const std::string& name) + { + std::string result; + m_proxy.callMethod("GetAlternativeHostName").onInterface(INTERFACE_NAME).withArguments(name).storeResultsTo(result); + return result; + } + + std::string GetAlternativeServiceName(const std::string& name) + { + std::string result; + m_proxy.callMethod("GetAlternativeServiceName").onInterface(INTERFACE_NAME).withArguments(name).storeResultsTo(result); + return result; + } + + std::string GetNetworkInterfaceNameByIndex(const int32_t& index) + { + std::string result; + m_proxy.callMethod("GetNetworkInterfaceNameByIndex").onInterface(INTERFACE_NAME).withArguments(index).storeResultsTo(result); + return result; + } + + int32_t GetNetworkInterfaceIndexByName(const std::string& name) + { + int32_t result; + m_proxy.callMethod("GetNetworkInterfaceIndexByName").onInterface(INTERFACE_NAME).withArguments(name).storeResultsTo(result); + return result; + } + + std::tuple ResolveHostName(const int32_t& interface, const int32_t& protocol, const std::string& name, const int32_t& aprotocol, const uint32_t& flags) + { + std::tuple result; + m_proxy.callMethod("ResolveHostName").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, aprotocol, flags).storeResultsTo(result); + return result; + } + + std::tuple ResolveAddress(const int32_t& interface, const int32_t& protocol, const std::string& address, const uint32_t& flags) + { + std::tuple result; + m_proxy.callMethod("ResolveAddress").onInterface(INTERFACE_NAME).withArguments(interface, protocol, address, flags).storeResultsTo(result); + return result; + } + + sdbus::PendingAsyncCall ResolveService(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const int32_t& aprotocol, const uint32_t& flags) + { + return m_proxy.callMethodAsync("ResolveService").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, type, domain, aprotocol, flags).uponReplyInvoke([this](std::optional error, const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const std::string& host, const int32_t& aprotocol, const std::string& address, const uint16_t& port, const std::vector>& txt, const uint32_t& flags){ this->onResolveServiceReply(interface, protocol, name, type, domain, host, aprotocol, address, port, txt, flags, std::move(error)); }); + } + + sdbus::ObjectPath EntryGroupNew() + { + sdbus::ObjectPath result; + m_proxy.callMethod("EntryGroupNew").onInterface(INTERFACE_NAME).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath DomainBrowserPrepare(const int32_t& interface, const int32_t& protocol, const std::string& domain, const int32_t& btype, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("DomainBrowserPrepare").onInterface(INTERFACE_NAME).withArguments(interface, protocol, domain, btype, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath ServiceTypeBrowserPrepare(const int32_t& interface, const int32_t& protocol, const std::string& domain, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("ServiceTypeBrowserPrepare").onInterface(INTERFACE_NAME).withArguments(interface, protocol, domain, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath ServiceBrowserPrepare(const int32_t& interface, const int32_t& protocol, const std::string& type, const std::string& domain, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("ServiceBrowserPrepare").onInterface(INTERFACE_NAME).withArguments(interface, protocol, type, domain, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath ServiceResolverPrepare(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const int32_t& aprotocol, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("ServiceResolverPrepare").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, type, domain, aprotocol, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath HostNameResolverPrepare(const int32_t& interface, const int32_t& protocol, const std::string& name, const int32_t& aprotocol, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("HostNameResolverPrepare").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, aprotocol, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath AddressResolverPrepare(const int32_t& interface, const int32_t& protocol, const std::string& address, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("AddressResolverPrepare").onInterface(INTERFACE_NAME).withArguments(interface, protocol, address, flags).storeResultsTo(result); + return result; + } + + sdbus::ObjectPath RecordBrowserPrepare(const int32_t& interface, const int32_t& protocol, const std::string& name, const uint16_t& clazz, const uint16_t& type, const uint32_t& flags) + { + sdbus::ObjectPath result; + m_proxy.callMethod("RecordBrowserPrepare").onInterface(INTERFACE_NAME).withArguments(interface, protocol, name, clazz, type, flags).storeResultsTo(result); + return result; + } + +private: + sdbus::IProxy& m_proxy; +}; + +}}} // namespaces + +#endif diff --git a/internal/platform/implementation/linux/generated/dbus/avahi/servicebrowser_client.h b/internal/platform/implementation/linux/generated/dbus/avahi/servicebrowser_client.h new file mode 100644 index 00000000..b8c3b6ed --- /dev/null +++ b/internal/platform/implementation/linux/generated/dbus/avahi/servicebrowser_client.h @@ -0,0 +1,67 @@ + +/* + * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! + */ + +#ifndef __sdbuscpp___home_lasan_Dev_nearby_latest_internal_platform_implementation_linux_generated_dbus_avahi_servicebrowser_client_v2_h__proxy__H__ +#define __sdbuscpp___home_lasan_Dev_nearby_latest_internal_platform_implementation_linux_generated_dbus_avahi_servicebrowser_client_v2_h__proxy__H__ + +#include +#include +#include + +namespace org { +namespace freedesktop { +namespace Avahi { + +class ServiceBrowser_proxy +{ +public: + static constexpr const char* INTERFACE_NAME = "org.freedesktop.Avahi.ServiceBrowser"; + +protected: + ServiceBrowser_proxy(sdbus::IProxy& proxy) + : m_proxy(proxy) + { + } + + ServiceBrowser_proxy(const ServiceBrowser_proxy&) = delete; + ServiceBrowser_proxy& operator=(const ServiceBrowser_proxy&) = delete; + ServiceBrowser_proxy(ServiceBrowser_proxy&&) = delete; + ServiceBrowser_proxy& operator=(ServiceBrowser_proxy&&) = delete; + + ~ServiceBrowser_proxy() = default; + + void registerProxy() + { + m_proxy.uponSignal("ItemNew").onInterface(INTERFACE_NAME).call([this](const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const uint32_t& flags){ this->onItemNew(interface, protocol, name, type, domain, flags); }); + m_proxy.uponSignal("ItemRemove").onInterface(INTERFACE_NAME).call([this](const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const uint32_t& flags){ this->onItemRemove(interface, protocol, name, type, domain, flags); }); + m_proxy.uponSignal("Failure").onInterface(INTERFACE_NAME).call([this](const std::string& error){ this->onFailure(error); }); + m_proxy.uponSignal("AllForNow").onInterface(INTERFACE_NAME).call([this](){ this->onAllForNow(); }); + m_proxy.uponSignal("CacheExhausted").onInterface(INTERFACE_NAME).call([this](){ this->onCacheExhausted(); }); + } + + virtual void onItemNew(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const uint32_t& flags) = 0; + virtual void onItemRemove(const int32_t& interface, const int32_t& protocol, const std::string& name, const std::string& type, const std::string& domain, const uint32_t& flags) = 0; + virtual void onFailure(const std::string& error) = 0; + virtual void onAllForNow() = 0; + virtual void onCacheExhausted() = 0; + +public: + void Free() + { + m_proxy.callMethod("Free").onInterface(INTERFACE_NAME); + } + + void Start() + { + m_proxy.callMethod("Start").onInterface(INTERFACE_NAME); + } + +private: + sdbus::IProxy& m_proxy; +}; + +}}} // namespaces + +#endif diff --git a/sharing/linux/qml_tray_app/file_share_tray_controller.cc b/sharing/linux/qml_tray_app/file_share_tray_controller.cc index bd706678..f75c76b5 100644 --- a/sharing/linux/qml_tray_app/file_share_tray_controller.cc +++ b/sharing/linux/qml_tray_app/file_share_tray_controller.cc @@ -539,33 +539,48 @@ void FileShareTrayController::hideToTray() { } void FileShareTrayController::startSendMode() { - service_->StartSendMode([this](NearbySharingApi::StatusCode status) { - QMetaObject::invokeMethod( - this, - [this, status]() { - SetStatus(QStringLiteral("StartSendMode: %1").arg(StatusToString(status))); - if (status != NearbySharingApi::StatusCode::kOk) { - running_ = false; - emit runningChanged(); - } - }, - Qt::QueuedConnection); + service_->StopReceiveMode([this](NearbySharingApi::StatusCode status) + { + if (status == NearbySharingApi::StatusCode::kOk || status == NearbySharingApi::StatusCode::kStatusAlreadyStopped) + { + service_->StartSendMode([this](NearbySharingApi::StatusCode status) { + QMetaObject::invokeMethod( + this, + [this, status]() { + SetStatus(QStringLiteral("StartSendMode: %1").arg(StatusToString(status))); + if (status != NearbySharingApi::StatusCode::kOk) { + running_ = false; + emit runningChanged(); + } + }, + Qt::QueuedConnection); + }); + } + }); } void FileShareTrayController::startReceiveMode() { - service_->StartReceiveMode([this](NearbySharingApi::StatusCode status) { - QMetaObject::invokeMethod( - this, - [this, status]() { - SetStatus( - QStringLiteral("StartReceiveMode: %1").arg(StatusToString(status))); - if (status != NearbySharingApi::StatusCode::kOk) { - running_ = false; - emit runningChanged(); - } - }, - Qt::QueuedConnection); + service_->StopSendMode([this](NearbySharingApi::StatusCode status) + { + if (status == NearbySharingApi::StatusCode::kOk || status == NearbySharingApi::StatusCode::kStatusAlreadyStopped) + { + + service_->StartReceiveMode([this](NearbySharingApi::StatusCode status) { + QMetaObject::invokeMethod( + this, + [this, status]() { + SetStatus( + QStringLiteral("StartReceiveMode: %1").arg(StatusToString(status))); + if (status != NearbySharingApi::StatusCode::kOk) { + running_ = false; + emit runningChanged(); + } + }, + Qt::QueuedConnection); + }); + } + }); } diff --git a/sharing/linux/qml_tray_app/file_share_tray_controller.h b/sharing/linux/qml_tray_app/file_share_tray_controller.h index 5aba5de0..f1d71b91 100644 --- a/sharing/linux/qml_tray_app/file_share_tray_controller.h +++ b/sharing/linux/qml_tray_app/file_share_tray_controller.h @@ -123,15 +123,19 @@ class FileShareTrayController : public QObject { bool running_ = false; bool auto_accept_incoming_ = true; + + // qr stuff QString qr_code_url_; QStringList qr_code_rows_; int qr_code_size_ = 0; QString log_path_ = QStringLiteral("/tmp/nearby_qml_file_tray.log"); + // pending send stuff QString pending_send_file_path_; QString pending_send_file_name_; qlonglong pending_send_target_id_ = 0; + // send targets QVariantList discovered_targets_; QHash discovered_row_by_target_; QSet pending_target_removals_;