1 /**************************************************************************** |
1 /* |
2 ** |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
4 ** Contact: Nokia Corporation (qt-info@nokia.com) |
4 * |
5 ** |
5 * This program is free software: you can redistribute it and/or modify |
6 ** This file is part of the QtCore module of the Qt Toolkit. |
6 * it under the terms of the GNU Lesser General Public License as published by |
7 ** |
7 * the Free Software Foundation, version 2.1 of the License. |
8 ** $QT_BEGIN_LICENSE:LGPL$ |
8 * |
9 ** No Commercial Usage |
9 * This program is distributed in the hope that it will be useful, |
10 ** This file contains pre-release code and may not be distributed. |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 ** You may use this file in accordance with the terms and conditions |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 ** contained in the either Technology Preview License Agreement or the |
12 * GNU Lesser General Public License for more details. |
13 ** Beta Release License Agreement. |
13 * |
14 ** |
14 * You should have received a copy of the GNU Lesser General Public License |
15 ** GNU Lesser General Public License Usage |
15 * along with this program. If not, |
16 ** Alternatively, this file may be used under the terms of the GNU Lesser |
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
17 ** General Public License version 2.1 as published by the Free Software |
17 * |
18 ** Foundation and appearing in the file LICENSE.LGPL included in the |
18 * Description: This class implements plugins factory. |
19 ** packaging of this file. Please review the following information to |
19 * |
20 ** ensure the GNU Lesser General Public License version 2.1 requirements |
20 */ |
21 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
22 ** |
|
23 ** In addition, as a special exception, Nokia gives you certain |
|
24 ** additional rights. These rights are described in the Nokia Qt LGPL |
|
25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this |
|
26 ** package. |
|
27 ** |
|
28 ** GNU General Public License Usage |
|
29 ** Alternatively, this file may be used under the terms of the GNU |
|
30 ** General Public License version 3.0 as published by the Free Software |
|
31 ** Foundation and appearing in the file LICENSE.GPL included in the |
|
32 ** packaging of this file. Please review the following information to |
|
33 ** ensure the GNU General Public License version 3.0 requirements will be |
|
34 ** met: http://www.gnu.org/copyleft/gpl.html. |
|
35 ** |
|
36 ** If you are unsure which license is appropriate for your use, please |
|
37 ** contact the sales department at http://www.qtsoftware.com/contact. |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
21 |
42 #include <xqpluginfactory.h> |
22 #include <xqpluginfactory.h> |
43 |
23 |
44 #include "xqpluginhandle.h" |
24 #include "xqpluginhandle.h" |
45 #include <ecom/ecom.h> |
25 #include <ecom/ecom.h> |
46 #include <QString> |
26 #include <QString> |
47 #include <QObject> |
27 #include <QObject> |
48 |
28 |
|
29 /*! |
|
30 Constructs plugin factory. |
|
31 */ |
49 CPluginFactory* CPluginFactory::NewL(int aUid) |
32 CPluginFactory* CPluginFactory::NewL(int aUid) |
50 { |
33 { |
51 TUid requestedUid(KNullUid); |
34 TUid requestedUid(KNullUid); |
52 requestedUid.iUid = aUid; |
35 requestedUid.iUid = aUid; |
53 return reinterpret_cast <CPluginFactory*>( |
36 return reinterpret_cast <CPluginFactory*>( |
54 REComSession::CreateImplementationL(requestedUid, |
37 REComSession::CreateImplementationL(requestedUid, |
55 _FOFF(CPluginFactory, |
38 _FOFF(CPluginFactory, |
56 iDtor_ID_Key))); |
39 iDtor_ID_Key))); |
57 } |
40 } |
58 |
41 |
|
42 /*! |
|
43 Destroys plugin factory. |
|
44 */ |
59 EXPORT_C CPluginFactory::~CPluginFactory() |
45 EXPORT_C CPluginFactory::~CPluginFactory() |
60 { |
46 { |
61 if (KNullUid != iDtor_ID_Key) { |
47 if (KNullUid != iDtor_ID_Key) { |
62 REComSession::DestroyedImplementation(iDtor_ID_Key); |
48 REComSession::DestroyedImplementation(iDtor_ID_Key); |
63 } |
49 } |
64 } |
50 } |
65 |
51 |
|
52 |
|
53 /*! |
|
54 Plugin factorizatoin method. |
|
55 */ |
66 QObject* CPluginFactory::createQtPlugin() |
56 QObject* CPluginFactory::createQtPlugin() |
67 { |
57 { |
68 QObject* retVal(NULL); |
58 QObject* retVal(NULL); |
69 if (KNullUid != iDtor_ID_Key) { |
59 if (KNullUid != iDtor_ID_Key) { |
70 retVal = constructPlugin(); |
60 retVal = constructPlugin(); |