ctkPluginContext.h

Go to the documentation of this file.
00001 /*=============================================================================
00002 
00003   Library: CTK
00004 
00005   Copyright (c) 2010 German Cancer Research Center,
00006     Division of Medical and Biological Informatics
00007 
00008   Licensed under the Apache License, Version 2.0 (the "License");
00009   you may not use this file except in compliance with the License.
00010   You may obtain a copy of the License at
00011 
00012     http://www.apache.org/licenses/LICENSE-2.0
00013 
00014   Unless required by applicable law or agreed to in writing, software
00015   distributed under the License is distributed on an "AS IS" BASIS,
00016   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017   See the License for the specific language governing permissions and
00018   limitations under the License.
00019 
00020 =============================================================================*/
00021 
00022 #ifndef CTKPLUGINCONTEXT_H_
00023 #define CTKPLUGINCONTEXT_H_
00024 
00025 #include <QHash>
00026 #include <QString>
00027 #include <QVariant>
00028 #include <QUrl>
00029 
00030 #include "ctkPluginFramework_global.h"
00031 
00032 #include "ctkPluginEvent.h"
00033 
00034 #include "CTKPluginFrameworkExport.h"
00035 
00036 
00037 
00038   // CTK class forward declarations
00039   class ctkPlugin;
00040   class ctkPluginPrivate;
00041   class ctkServiceRegistration;
00042   class ctkServiceReference;
00043   class ctkPluginContextPrivate;
00044 
00094   class CTK_PLUGINFW_EXPORT ctkPluginContext
00095   {
00096     Q_DECLARE_PRIVATE(ctkPluginContext)
00097 
00098   public:
00099 
00100     ~ctkPluginContext();
00101 
00111     ctkPlugin* getPlugin() const;
00112 
00120     ctkPlugin* getPlugin(long id) const;
00121 
00122 
00134     QList<ctkPlugin*> getPlugins() const;
00135 
00201     ctkServiceRegistration* registerService(const QStringList& clazzes, QObject* service, const ServiceProperties& properties = ServiceProperties());
00202 
00248     QList<ctkServiceReference*> getServiceReferences(const QString& clazz, const QString& filter = QString());
00249 
00279     ctkServiceReference* getServiceReference(const QString& clazz);
00280 
00338     QObject* getService(ctkServiceReference* reference);
00339 
00340     ctkPlugin* installPlugin(const QUrl& location, QIODevice* in = 0);
00341 
00342 
00343     bool connectPluginListener(const QObject* receiver, const char* method, Qt::ConnectionType type = Qt::QueuedConnection);
00344 
00345     bool connectFrameworkListener(const QObject* receiver, const char* method, Qt::ConnectionType type = Qt::QueuedConnection);
00346 
00347   protected:
00348 
00349     friend class ctkPluginFrameworkPrivate;
00350     friend class ctkPlugin;
00351     friend class ctkPluginPrivate;
00352 
00353     ctkPluginContext(ctkPluginPrivate* plugin);
00354 
00355     ctkPluginContextPrivate * const d_ptr;
00356   };
00357 
00358 
00359 #endif /* CTKPLUGINCONTEXT_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1