From c99e05026f918a44dd43ba58ceaa15ecdd9bb7ad Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 6 Sep 2025 15:41:19 +1000 Subject: plugin: abstract service + ref --- plugin/src/Caelestia/serviceref.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugin/src/Caelestia/serviceref.hpp (limited to 'plugin/src/Caelestia/serviceref.hpp') diff --git a/plugin/src/Caelestia/serviceref.hpp b/plugin/src/Caelestia/serviceref.hpp new file mode 100644 index 0000000..fb48a47 --- /dev/null +++ b/plugin/src/Caelestia/serviceref.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "service.hpp" +#include +#include + +namespace caelestia { + +class ServiceRef : public QObject { + Q_OBJECT + QML_ELEMENT + + Q_PROPERTY(Service* service READ service WRITE setService NOTIFY serviceChanged) + +public: + explicit ServiceRef(Service* service = nullptr, QObject* parent = nullptr); + ~ServiceRef(); + + [[nodiscard]] Service* service() const; + void setService(Service* service); + +signals: + void serviceChanged(); + +private: + Service* m_service; +}; + +} // namespace caelestia -- cgit v1.2.3-freya