|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Launch controlpanel plugin setting view in client process. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <cppluginlauncher.h> |
|
19 #include <cpplugininterface.h> |
|
20 #include <cplauncherinterface.h> |
|
21 #include <QSharedPointer> |
|
22 #include <cppluginloader.h> |
|
23 #include <cpbasesettingview.h> |
|
24 #include <cpitemdatahelper.h> |
|
25 #include "cpviewlauncher.h" |
|
26 |
|
27 /*! |
|
28 \class CpPluginLauncher |
|
29 \brief The CpPluginLauncher class loads a controlpanel plugin at run-time.And display the specify plugin view in client process. |
|
30 */ |
|
31 |
|
32 /*! |
|
33 Load and display a plugin view in client process. The client must be a orbit based application. |
|
34 The pluginFile can either absoulte file path or only file name. |
|
35 Acceptable format: |
|
36 sampleplugin |
|
37 sampleplugin.qtplugin |
|
38 sampleplugin.dll |
|
39 C:/resource/qt/plugins/controlpanel/sampleplugin.qtplugin |
|
40 C:/resource/qt/plugins/controlpanel/sampleplugin.dll |
|
41 */ |
|
42 CpBaseSettingView* CpPluginLauncher::launchSettingView(const QString &pluginFile,const QVariant &hint /*= QVariant()*/) |
|
43 { |
|
44 CpLauncherInterface *plugin = CpPluginLoader::loadCpLauncherInterface(pluginFile); |
|
45 if (plugin) { |
|
46 CpBaseSettingView *view = plugin->createSettingView(hint); |
|
47 if (view) { |
|
48 CpViewLauncher::launchView(view); |
|
49 return view; |
|
50 } |
|
51 } |
|
52 |
|
53 return 0; |
|
54 } |
|
55 |
|
56 //End of File |