31
|
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 |
*
|
55
|
14 |
* Description: Launch controlpanel plugin setting view in client process.
|
31
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <cppluginlauncher.h>
|
32
|
19 |
#include <cpplugininterface.h>
|
36
|
20 |
#include <cplauncherinterface.h>
|
32
|
21 |
#include <QSharedPointer>
|
|
22 |
#include <cppluginloader.h>
|
36
|
23 |
#include <cpbasesettingview.h>
|
|
24 |
#include <cpitemdatahelper.h>
|
|
25 |
#include "cpviewlauncher.h"
|
38
|
26 |
|
|
27 |
/*!
|
32
|
28 |
\class CpPluginLauncher
|
|
29 |
\brief The CpPluginLauncher class loads a controlpanel plugin at run-time.And display the specify plugin view in client process.
|
38
|
30 |
*/
|
31
|
31 |
|
36
|
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 |
*/
|
37
|
42 |
CpBaseSettingView* CpPluginLauncher::launchSettingView(const QString &pluginFile,const QVariant &hint /*= QVariant()*/)
|
36
|
43 |
{
|
|
44 |
CpLauncherInterface *plugin = CpPluginLoader::loadCpLauncherInterface(pluginFile);
|
|
45 |
if (plugin) {
|
|
46 |
CpBaseSettingView *view = plugin->createSettingView(hint);
|
|
47 |
if (view) {
|
|
48 |
CpViewLauncher::launchView(view);
|
37
|
49 |
return view;
|
36
|
50 |
}
|
|
51 |
}
|
|
52 |
|
37
|
53 |
return 0;
|
36
|
54 |
}
|
37
|
55 |
|
|
56 |
//End of File
|