22 #ifndef CTKPLUGINCONTEXT_H_
23 #define CTKPLUGINCONTEXT_H_
29 #include <QSharedPointer>
39 #include "ctkPluginFrameworkExport.h"
44 class ctkPluginPrivate;
45 class ctkPluginContextPrivate;
243 const char* clazz = qobject_interface_iid<S*>();
246 throw ctkServiceException(QString(
"The interface class you are registering your service %1 against has no Q_DECLARE_INTERFACE macro")
247 .arg(service->metaObject()->className()));
249 return registerService(clazz, service, properties);
322 const char* clazz = qobject_interface_iid<S*>();
323 if (clazz == 0)
throw ctkServiceException(
"The service interface class has no Q_DECLARE_INTERFACE macro");
324 return getServiceReferences(QString(clazz), filter);
377 const char* clazz = qobject_interface_iid<S*>();
378 if (clazz == 0)
throw ctkServiceException(
"The service interface class has no Q_DECLARE_INTERFACE macro");
379 return getServiceReference(QString(clazz));
468 return qobject_cast<S*>(getService(reference));
594 QSharedPointer<ctkPlugin>
installPlugin(
const QUrl& location, QIODevice* input = 0);
714 const QString& filter = QString());
728 friend class ctkPluginFrameworkPrivate;
730 friend class ctkPluginPrivate;
734 ctkPluginContextPrivate *
const d_ptr;
bool connectPluginListener(const QObject *receiver, const char *slot, Qt::ConnectionType type=Qt::QueuedConnection)
QSharedPointer< ctkPlugin > installPlugin(const QUrl &location, QIODevice *input=0)
void disconnectFrameworkListener(const QObject *receiver, const char *slot=0)
ctkPluginContext(ctkPluginPrivate *plugin)
QVariant getProperty(const QString &key) const
void disconnectPluginListener(const QObject *receiver, const char *slot=0)
void connectServiceListener(QObject *receiver, const char *slot, const QString &filter=QString())
QSharedPointer< ctkPlugin > getPlugin(long id) const
QObject * getService(const ctkServiceReference &reference)
bool ungetService(const ctkServiceReference &reference)
ctkServiceRegistration registerService(const QStringList &clazzes, QObject *service, const ctkDictionary &properties=ctkDictionary())
ctkPluginContextPrivate *const d_ptr
ctkServiceRegistration registerService(QObject *service, const ctkDictionary &properties=ctkDictionary())
QFileInfo getDataFile(const QString &filename)
bool connectFrameworkListener(const QObject *receiver, const char *slot, Qt::ConnectionType type=Qt::QueuedConnection)
QSharedPointer< ctkPlugin > getPlugin() const
ctkServiceReference getServiceReference()
ctkServiceReference getServiceReference(const QString &clazz)
void disconnectServiceListener(QObject *receiver, const char *slot)
QList< ctkServiceReference > getServiceReferences(const QString &clazz, const QString &filter=QString())
QList< ctkServiceReference > getServiceReferences(const QString &filter=QString())
QList< QSharedPointer< ctkPlugin > > getPlugins() const
S * getService(const ctkServiceReference &reference)
ctkServiceRegistration registerService(const char *clazz, QObject *service, const ctkDictionary &properties=ctkDictionary())
QHash< QString, QVariant > ctkDictionary