18 #ifndef ITEMREGISTRY_H
19 #define ITEMREGISTRY_H
21 #include <QLoggingCategory>
25 #include <QQmlListProperty>
26 #include "PluginIncubator.h"
28 Q_DECLARE_LOGGING_CATEGORY(PLUGIN_ITEM_REGISTRY)
33 Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged)
34 Q_PROPERTY(QString location READ location WRITE setLocation NOTIFY locationChanged)
35 Q_PROPERTY(QQmlListProperty<QQuickItem> defaultItems READ defaultItems)
36 Q_PROPERTY(LoadMode loadMode READ loadMode WRITE setLoadMode NOTIFY loadModeChanged)
37 Q_PROPERTY(QString pluginId MEMBER m_pluginId)
39 Q_PROPERTY(
bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asyncChanged)
53 QQuickItem *target()
const;
54 QString location()
const;
55 QQmlListProperty<QQuickItem> defaultItems();
57 LoadMode loadMode()
const;
58 bool asynchronous()
const;
60 Q_INVOKABLE QString findFirstEnabled(
const QString &location);
63 void targetChanged(QQuickItem *target);
64 void locationChanged(QString location);
65 void loadModeChanged(LoadMode loadMode);
67 void asyncChanged(
bool asynchronous);
70 void setTarget(QQuickItem *target);
71 void setLocation(QString location);
72 void setLoadMode(LoadMode loadMode);
73 void setAsynchronous(
bool asynchronous);
76 void loadIfPossible();
77 void reparentItemToTarget(QQuickItem *item);
78 void reparentItemsToTarget(QList<QQuickItem *> items);
79 QQuickItem *createItemFromUrl(
const QString &itemUrl);
80 void createItemAsync(
const QString &itemUrl);
81 void asyncItemReady();
82 void handleIncubatorError();
86 QPointer<QQuickItem> m_target;
88 QList<QQuickItem *> m_defaultItems;
91 IncubatorList m_incubators;
94 #endif // ITEMREGISTRY_H