1// Copyright (C) 2017 Ford Motor Company
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QREMOTEOBJECTREGISTRY_P_H
5#define QREMOTEOBJECTREGISTRY_P_H
6
7#include <QtRemoteObjects/qremoteobjectreplica.h>
8
9QT_BEGIN_NAMESPACE
10
11class QRemoteObjectRegistryPrivate;
12class QRemoteObjectNodePrivate;
13
14class Q_REMOTEOBJECTS_EXPORT QRemoteObjectRegistry : public QRemoteObjectReplica
15{
16 Q_OBJECT
17 Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_TYPE, "Registry")
18
19 Q_PROPERTY(QRemoteObjectSourceLocations sourceLocations READ sourceLocations STORED false
20 BINDABLE bindableSourceLocations)
21
22public:
23 ~QRemoteObjectRegistry() override;
24 static void registerMetatypes();
25
26 QRemoteObjectSourceLocations sourceLocations() const;
27 QBindable<QRemoteObjectSourceLocations> bindableSourceLocations() const;
28
29Q_SIGNALS:
30 void remoteObjectAdded(const QRemoteObjectSourceLocation &entry);
31 void remoteObjectRemoved(const QRemoteObjectSourceLocation &entry);
32
33protected Q_SLOTS:
34 void addSource(const QRemoteObjectSourceLocation &entry);
35 void removeSource(const QRemoteObjectSourceLocation &entry);
36 void pushToRegistryIfNeeded();
37
38private:
39 void initialize() override;
40 void notifySourceLocationsChanged();
41
42 explicit QRemoteObjectRegistry(QObject *parent = nullptr);
43 explicit QRemoteObjectRegistry(QRemoteObjectNode *node, const QString &name, QObject *parent = nullptr);
44
45 Q_DECLARE_PRIVATE(QRemoteObjectRegistry)
46 friend class QT_PREPEND_NAMESPACE(QRemoteObjectNode);
47 friend class QT_PREPEND_NAMESPACE(QRemoteObjectNodePrivate);
48};
49
50QT_END_NAMESPACE
51
52#endif
53

source code of qtremoteobjects/src/remoteobjects/qremoteobjectregistry.h