summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/service.hpp
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-06 15:41:19 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-06 15:41:19 +1000
commitc99e05026f918a44dd43ba58ceaa15ecdd9bb7ad (patch)
tree6452562f778c47e69cdd5900c41e1e3b72d88350 /plugin/src/Caelestia/service.hpp
parentplugin: namespace everything (diff)
downloadcaelestia-shell-c99e05026f918a44dd43ba58ceaa15ecdd9bb7ad.tar.gz
caelestia-shell-c99e05026f918a44dd43ba58ceaa15ecdd9bb7ad.tar.bz2
caelestia-shell-c99e05026f918a44dd43ba58ceaa15ecdd9bb7ad.zip
plugin: abstract service + ref
Diffstat (limited to 'plugin/src/Caelestia/service.hpp')
-rw-r--r--plugin/src/Caelestia/service.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugin/src/Caelestia/service.hpp b/plugin/src/Caelestia/service.hpp
new file mode 100644
index 0000000..861d715
--- /dev/null
+++ b/plugin/src/Caelestia/service.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <QObject>
+
+namespace caelestia {
+
+class Service : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(int refCount READ refCount NOTIFY refCountChanged)
+
+public:
+ explicit Service(QObject* parent = nullptr);
+
+ [[nodiscard]] int refCount() const;
+
+ void ref();
+ void unref();
+
+signals:
+ void refCountChanged();
+
+private:
+ int m_refCount;
+
+ virtual void start() = 0;
+ virtual void stop() = 0;
+};
+
+} // namespace caelestia