|
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: Mocked runtime plugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <qserviceinterfacedescriptor.h> |
|
19 #include <qabstractsecuritysession.h> |
|
20 #include <qservicecontext.h> |
|
21 |
|
22 #include "mockstateplugins.h" |
|
23 #include "mockloadscenestate.h" |
|
24 #include "mockidlestate.h" |
|
25 #include "mockapplibrarystate.h" |
|
26 #include "mockmenuworkerstate.h" |
|
27 #include "mockrootstate.h" |
|
28 #include "mockbackuprestorestate.h" |
|
29 |
|
30 QObject *MockStatePlugins::createInstance(const QServiceInterfaceDescriptor &descriptor, |
|
31 QServiceContext *context, |
|
32 QAbstractSecuritySession *session) |
|
33 { |
|
34 Q_UNUSED(context); |
|
35 Q_UNUSED(session); |
|
36 |
|
37 if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsLoadSceneState") { |
|
38 return new MockLoadSceneState(); |
|
39 } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsIdleState") { |
|
40 return new MockIdleState(); |
|
41 } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsAppLibraryState") { |
|
42 return new MockAppLibraryState(); |
|
43 } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsMenuWorkerState") { |
|
44 return new MockMenuWorkerState(); |
|
45 } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsRootState") { |
|
46 return new MockRootState(); |
|
47 } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsBackupRestoreState") { |
|
48 return new MockBackupRestoreState(); |
|
49 } else { |
|
50 return 0; |
|
51 } |
|
52 } |
|
53 |
|
54 Q_EXPORT_PLUGIN2(mockstateplugins, MockStatePlugins) |