/*=============================================================================
Library: CTK
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=============================================================================*/
#ifndef CTKPLUGINCONTEXT_H_
#define CTKPLUGINCONTEXT_H_
#include <QHash>
#include <QString>
#include <QVariant>
#include <QUrl>
#include <QSharedPointer>
#include <QFileInfo>
#include "ctkPluginFramework_global.h"
#include "ctkPluginEvent.h"
#include "ctkServiceException.h"
#include "ctkServiceReference.h"
#include "ctkServiceRegistration.h"
#include "ctkPluginFrameworkExport.h"
// CTK class forward declarations
class ctkPlugin;
class ctkPluginPrivate;
class ctkPluginContextPrivate;
/**
* \ingroup PluginFramework
*
* A plugin's execution context within the Framework. The context is used to
* grant access to other methods so that this plugin can interact with the
* Framework.
*
* <p>
* <code>ctkPluginContext</code> methods allow a plugin to:
* <ul>
* <li>Subscribe to events published by the Framework.
* <li>Register service objects with the Framework service registry.
* <li>Retrieve <code>ServiceReferences</code> from the Framework service
* registry.
* <li>Get and release service objects for a referenced service.
* <li>Install new plugins in the Framework.
* <li>Get the list of plugins installed in the Framework.
* <li>Get the {@link ctkPlugin} object for a plugin.
* <li>Create <code>QFile</code> objects for files in a persistent storage
* area provided for the plugin by the Framework.
* </ul>
*
* <p>
* A <code>ctkPluginContext</code> object will be created and provided to the
* plugin associated with this context when it is started using the
* {@link ctkPluginActivator::start} method. The same <code>ctkPluginContext</code>
* object will be passed to the plugin associated with this context when it is
* stopped using the {@link ctkPluginActivator::stop} method. A
* <code>ctkPluginContext</code> object is generally for the private use of its
* associated plugin and is not meant to be shared with other plugins in the
* plugin environment.
*
* <p>
* The <code>ctkPlugin</code> object associated with a <code>ctkPluginContext</code>
* object is called the <em>context plugin</em>.
*
* <p>
* The <code>ctkPluginContext</code> object is only valid during the execution of
* its context plugin; that is, during the period from when the context plugin
* is in the <code>STARTING</code>, <code>STOPPING</code>, and
* <code>ACTIVE</code> plugin states. If the <code>ctkPluginContext</code>
* object is used subsequently, a <code>ctkIllegalStateException</code> must be
* thrown. The <code>ctkPluginContext</code> object must never be reused after
* its context plugin is stopped.
*
* <p>
* The Framework is the only entity that can create <code>ctkPluginContext</code>
* objects and they are only valid within the Framework that created them.
*
* @remarks This class is thread safe.
*/
class CTK_PLUGINFW_EXPORT ctkPluginContext
{
public:
~ctkPluginContext();
/**
* Returns the value of the specified property. If the key is not found in
* the Framework properties, the system properties are then searched. The
* method returns an invalid QVariant if the property is not found.
*
* @param key The name of the requested property.
* @return The value of the requested property, or an invalid QVariant if
* the property is undefined.
*/
QVariant getProperty(const QString& key) const;
/**
* Returns the <code>ctkPlugin</code> object associated with this
* <code>ctkPluginContext</code>. This plugin is called the context plugin.
*
* @return The <code>ctkPlugin</code> object associated with this
* <code>ctkPluginContext</code>.
* @throws ctkIllegalStateException If this ctkPluginContext is no
* longer valid.
*/
QSharedPointer<ctkPlugin> getPlugin() const;
/**
* Returns the plugin with the specified identifier.
*
* @param id The identifier of the plugin to retrieve.
* @return A <code>ctkPlugin</code> object or <code>0</code> if the
* identifier does not match any installed plugin.
*/
QSharedPointer<ctkPlugin> getPlugin(long id) const;
/**
* Returns a list of all installed plugins.
* <p>
* This method returns a list of all plugins installed in the plugin
* environment at the time of the call to this method. However, since the
* Framework is a very dynamic environment, plugins can be installed or
* uninstalled at anytime.
*
* @return A QList of <code>ctkPlugin</code> objects, one object per
* installed plugin.
*/
QList<QSharedPointer<ctkPlugin> > getPlugins() const;
/**
* Registers the specified service object with the specified properties
* under the specified class names into the Framework. A
* <code>ctkServiceRegistration</code> object is returned. The
* <code>ctkServiceRegistration</code> object is for the private use of the
* plugin registering the service and should not be shared with other
* plugins. The registering plugin is defined to be the context plugin.
* Other plugins can locate the service by using either the
* {@link #getServiceReferences} or {@link #getServiceReference} method.
*
* <p>
* A plugin can register a service object that implements the
* {@link ctkServiceFactory} interface to have more flexibility in providing
* service objects to other plugins.
*
* <p>
* The following steps are required to register a service:
* <ol>
* <li>If <code>service</code> is not a <code>ctkServiceFactory</code>, an
* <code>ctkInvalidArgumentException</code> is thrown if <code>service</code>
* is not an instance of all the specified class names.
* <li>The Framework adds the following service properties to the service
* properties from the specified <code>ctkDictionary</code> (which may be
* omitted): <br/>
* A property named {@link ctkPluginConstants#SERVICE_ID} identifying the
* registration number of the service <br/>
* A property named {@link ctkPluginConstants#OBJECTCLASS} containing all the
* specified classes. <br/>
* Properties with these names in the specified <code>ctkDictionary</code> will
* be ignored.
* <li>The service is added to the Framework service registry and may now be
* used by other plugins.
* <li>A service event of type {@link ctkServiceEvent#REGISTERED} is fired.
* <li>A <code>ctkServiceRegistration</code> object for this registration is
* returned.
* </ol>
*
* @param clazzes The class names under which the service can be located.
* The class names will be stored in the service's
* properties under the key {@link ctkPluginConstants#OBJECTCLASS}.
* @param service The service object or a <code>ctkServiceFactory</code>
* object.
* @param properties The properties for this service. The keys in the
* properties object must all be <code>QString</code> objects. See
* {@link ctkPluginConstants} for a list of standard service property keys.
* Changes should not be made to this object after calling this
* method. To update the service's properties the
* {@link ctkServiceRegistration::setProperties} method must be called.
* The set of properties may be omitted if
没有合适的资源?快使用搜索试试~ 我知道了~
ctk_qt5.7.1_x86_vs2015.zip
共381个文件
h:296个
cmake:38个
tpp:15个
需积分: 50 6 下载量 93 浏览量
2021-06-27
02:16:06
上传
评论
收藏 2.14MB ZIP 举报
温馨提示
Visual Studio2015基于Qt5.7.1编译的CTK框架的32位开发包(带调试信息的Release版本)
资源推荐
资源详情
资源评论
收起资源包目录
ctk_qt5.7.1_x86_vs2015.zip (381个子文件)
ctkMacroBuildPlugin.cmake 14KB
ctkMacroTargetLibraries.cmake 9KB
ctkMacroValidateBuildOptions.cmake 8KB
CTKExports-relwithdebinfo.cmake 7KB
ctkMacroBuildQtPlugin.cmake 7KB
ctkMacroBuildLibWrapper.cmake 7KB
CTKConfig.cmake 6KB
ctkMacroCompilePythonScript.cmake 6KB
ctkMacroBuildLib.cmake 6KB
ctkMacroWrapPythonQt.cmake 6KB
CTKExports.cmake 6KB
ctkFunctionGenerateDGraphInput.cmake 5KB
ctkListToString.cmake 5KB
ctkMacroBuildApp.cmake 4KB
CMakeFindDependencyMacro.cmake 4KB
CTKPluginUseFile.cmake 3KB
ctkFunctionGeneratePluginManifest.cmake 3KB
ctkMacroSetupQt.cmake 3KB
ctkFunctionGetIncludeDirs.cmake 3KB
ctkMacroOptionUtils.cmake 3KB
ctkFunctionCompileSnippets.cmake 3KB
ctkLinkerAsNeededFlagCheck.cmake 2KB
ctkFunctionGetCompilerVisibilityFlags.cmake 2KB
ctkMacroListFilter.cmake 2KB
ctkFunctionAddPluginRepo.cmake 2KB
UseCTK.cmake 2KB
CTKConfigVersion.cmake 2KB
ctkFunctionCheckCompilerFlags.cmake 2KB
ctkFunctionGetLibraryDirs.cmake 2KB
ctkFunctionExtractOptionNameAndValue.cmake 2KB
ctkFunctionCheckoutRepo.cmake 2KB
ctkMacroAddCtkLibraryOptions.cmake 1KB
ctkFunctionGetGccVersion.cmake 1KB
ctkMacroGenerateMocs.cmake 1KB
ctkMacroSetPaths.cmake 1KB
ctkMacroGeneratePluginResourceFile.cmake 1KB
ctkFunctionExtractOptimizedLibrary.cmake 1KB
ctkMacroParseArguments.cmake 1KB
C.cpp 38B
A.cpp 35B
B.cpp 25B
CTKWidgets.dll 1.71MB
CTKPluginFramework.dll 626KB
CTKCore.dll 404KB
liborg_commontk_configadmin.dll 344KB
CTKWidgetsPlugins.dll 332KB
liborg_commontk_eventadmin.dll 291KB
liborg_commontk_metatype.dll 236KB
liborg_commontk_plugingenerator_core.dll 127KB
liborg_commontk_plugingenerator_ui.dll 113KB
liborg_commontk_log.dll 54KB
CTKDummyPlugin.dll 46KB
ctkPluginBrowser.exe 175KB
ctkPluginGenerator.exe 157KB
ctkPluginContext.h 32KB
ctkPlugin.h 32KB
ctkServiceTracker.h 17KB
ctkPluginConstants.h 16KB
ctkCommandLineParser.h 14KB
ctkDoubleSpinBox.h 13KB
ctkPluginFrameworkLauncher.h 12KB
ctkSliderWidget.h 12KB
ctkPathListWidget.h 11KB
ctkPluginTracker.h 11KB
ctkDoubleSlider.h 11KB
ctkWorkflow.h 10KB
ctkWorkflow_p.h 10KB
ctkPluginStorageSQL_p.h 10KB
ctkDoubleRangeSlider.h 10KB
ctkPathLineEdit.h 10KB
ctkConsole.h 10KB
ctkRangeWidget.h 10KB
ctkWorkflowStep.h 9KB
ctkServiceReference.h 8KB
ctkException.h 8KB
ctkPluginAbstractTracked_p.h 8KB
ctkVersion.h 8KB
ctkRangeSlider.h 8KB
ctkBasePopupWidget.h 8KB
ctkPluginFramework.h 7KB
ctkLayoutViewFactory.h 7KB
ctkCoordinatesWidget.h 7KB
ctkEAConfiguration_p.h 7KB
ctkPlugin_p.h 7KB
ctkLayoutManager.h 7KB
ctkConsole_p.h 7KB
ctkCollapsibleButton.h 7KB
ctkDirectoryButton.h 6KB
ctkWorkflowWidgetStep.h 6KB
ctkModelTester.h 6KB
ctkMatrixWidget.h 6KB
ctkColorDialog.h 6KB
ctkServiceRegistration.h 6KB
ctkPimpl.h 6KB
ctkCoreTestingMacros.h 6KB
ctkUtils.h 6KB
ctkSettingsPanel.h 6KB
ctkCheckableModelHelper.h 6KB
ctkWorkflowButtonBoxWidget.h 6KB
ctkCorePythonQtDecorators.h 6KB
共 381 条
- 1
- 2
- 3
- 4
资源评论
刘亿辰
- 粉丝: 73
- 资源: 79
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功