CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkPluginFrameworkLauncher.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: CTK
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef CTKPLUGINFRAMEWORKLAUNCHER_H
23 #define CTKPLUGINFRAMEWORKLAUNCHER_H
24 
25 #include <QString>
26 #include <QScopedPointer>
27 
28 #include <ctkPluginFrameworkExport.h>
29 #include "ctkPlugin.h"
31 
32 class ctkPluginFramework;
33 class ctkPluginFrameworkLauncherPrivate;
34 
35 class QRunnable;
36 
45 class CTK_PLUGINFW_EXPORT ctkPluginFrameworkLauncher
46 {
47 public:
48 
49  // System properties
50  static const QString PROP_USER_HOME; // = "user.home";
51  static const QString PROP_USER_DIR; // = "user.dir";
52 
53  // Framework properties
54  static const QString PROP_PLUGINS; // = "ctk.plugins";
55  static const QString PROP_PLUGINS_START_OPTIONS; // = "ctk.plugins.startOptions";
56  static const QString PROP_DEBUG; // = "ctk.debug";
57  static const QString PROP_DEV; // = "ctk.dev";
58  static const QString PROP_CONSOLE; // = "ctk.console";
59  static const QString PROP_OS; // = "ctk.os";
60  static const QString PROP_ARCH; // = "ctk.arch";
61 
62  static const QString PROP_NOSHUTDOWN; // = "ctk.noShutdown";
63  static const QString PROP_IGNOREAPP; // = "ctk.ignoreApp";
64 
65  static const QString PROP_INSTALL_AREA; // = "ctk.install.area";
66  static const QString PROP_CONFIG_AREA; // = "ctk.configuration.area";
67  static const QString PROP_SHARED_CONFIG_AREA; // = "ctk.sharedConfiguration.area";
68  static const QString PROP_INSTANCE_AREA; // = "ctk.instance.area";
69  static const QString PROP_USER_AREA; // = "ctk.user.area";
70  static const QString PROP_HOME_LOCATION_AREA; // = "ctk.home.location";
71 
72 
73  static const QString PROP_CONFIG_AREA_DEFAULT; // = "ctk.configuration.area.default";
74  static const QString PROP_INSTANCE_AREA_DEFAULT; // = "ctk.instance.area.default";
75  static const QString PROP_USER_AREA_DEFAULT; // = "ctk.user.area.default";
76 
77  static const QString PROP_EXITCODE; // = "ctk.exitcode";
78  static const QString PROP_EXITDATA; // = "ctk.exitdata";
79  static const QString PROP_CONSOLE_LOG; // = "ctk.consoleLog";
80 
81  static const QString PROP_ALLOW_APPRELAUNCH; // = "ctk.allowAppRelaunch";
82  static const QString PROP_APPLICATION_LAUNCHDEFAULT; // = "ctk.application.launchDefault";
83 
84  static const QString PROP_OSGI_RELAUNCH; // = "ctk.pluginfw.relaunch";
85 
86 
99  static void setFrameworkProperties(const ctkProperties& props);
100 
114  static QVariant run(QRunnable* endSplashHandler = NULL, const QVariant& argument = QVariant());
115 
128  static QVariant run(const QVariant& argument);
129 
130 
142  static ctkPluginContext* startup(QRunnable* endSplashHandler);
143 
144 
162  static void shutdown();
163 
164 
184  static long install(const QString& symbolicName, ctkPluginContext* context = 0);
185 
209  static bool start(const QString& symbolicName = QString(),
210  ctkPlugin::StartOptions options = ctkPlugin::START_ACTIVATION_POLICY,
211  ctkPluginContext* context = 0);
212 
231  static bool stop(const QString& symbolicName = QString(),
232  ctkPlugin::StopOptions options = 0, ctkPluginContext* context = 0);
233 
242  static void resolve(const QSharedPointer<ctkPlugin>& plugin);
243 
250  static void resolve();
251 
259 
266  static QSharedPointer<ctkPluginFramework> getPluginFramework();
267 
277  static void appendPathEnv(const QString& path);
278 
291  static void addSearchPath(const QString& searchPath, bool addToPathEnv = true);
292 
305  static QString getPluginPath(const QString& symbolicName);
306 
317  static QStringList getPluginSymbolicNames(const QString& searchPath);
318 
319 private:
320 
321  static const QScopedPointer<ctkPluginFrameworkLauncherPrivate> d;
322 
323  Q_DISABLE_COPY(ctkPluginFrameworkLauncher)
324 };
325 
326 #endif // CTKPLUGINFRAMEWORKLAUNCHER_H
static long install(const QString &symbolicName, ctkPluginContext *context=0)
static const QString PROP_SHARED_CONFIG_AREA
static bool start(const QString &symbolicName=QString(), ctkPlugin::StartOptions options=ctkPlugin::START_ACTIVATION_POLICY, ctkPluginContext *context=0)
static QSharedPointer< ctkPluginFramework > getPluginFramework()
static bool stop(const QString &symbolicName=QString(), ctkPlugin::StopOptions options=0, ctkPluginContext *context=0)
static const QString PROP_HOME_LOCATION_AREA
static QStringList getPluginSymbolicNames(const QString &searchPath)
static void addSearchPath(const QString &searchPath, bool addToPathEnv=true)
static void resolve(const QSharedPointer< ctkPlugin > &plugin)
static ctkPluginContext * getPluginContext()
static QVariant run(const QVariant &argument)
static const QString PROP_INSTANCE_AREA_DEFAULT
static QString getPluginPath(const QString &symbolicName)
static ctkPluginContext * startup(QRunnable *endSplashHandler)
static void setFrameworkProperties(const ctkProperties &props)
static const QString PROP_ALLOW_APPRELAUNCH
static const QString PROP_APPLICATION_LAUNCHDEFAULT
static const QString PROP_USER_AREA_DEFAULT
static QVariant run(QRunnable *endSplashHandler=NULL, const QVariant &argument=QVariant())
static const QString PROP_CONFIG_AREA_DEFAULT
static const QString PROP_PLUGINS_START_OPTIONS
static void appendPathEnv(const QString &path)
@ START_ACTIVATION_POLICY
Definition: ctkPlugin.h:207