homescreenapp/stateplugins/hshomescreenstateplugin/src/hshomescreenstateplugin.cpp
changeset 35 f9ce957a272c
child 51 4785f57bf3d4
equal deleted inserted replaced
5:c743ef5928ba 35:f9ce957a272c
       
     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:  Default state plugin.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <qserviceinterfacedescriptor.h>
       
    19 #include <qabstractsecuritysession.h>
       
    20 #include <qservicecontext.h>
       
    21 
       
    22 #include "hshomescreenstateplugin.h"
       
    23 #include "hsloadscenestate.h"
       
    24 #include "hsidlestate.h"
       
    25 
       
    26 #ifdef COVERAGE_MEASUREMENT
       
    27 #pragma CTC SKIP
       
    28 #endif //COVERAGE_MEASUREMENT
       
    29 
       
    30 /*!
       
    31     Creates a HsLoadSceneState or a HsIdleState if interface name in \a descriptor
       
    32 	is com.nokia.homescreen.state.<xxxxxState>.
       
    33 */
       
    34 QObject *HsHomeScreenStatePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
       
    35                                                 QServiceContext *context,
       
    36                                                 QAbstractSecuritySession *session)
       
    37 {
       
    38     Q_UNUSED(context);
       
    39     Q_UNUSED(session);
       
    40 
       
    41     if (descriptor.interfaceName() == QLatin1String("com.nokia.homescreen.state.HsLoadSceneState")) {
       
    42         return new HsLoadSceneState();
       
    43     } else if(descriptor.interfaceName() == QLatin1String("com.nokia.homescreen.state.HsIdleState")) {
       
    44         return new HsIdleState();
       
    45     } else {
       
    46         return 0;
       
    47     }
       
    48 }
       
    49 
       
    50 Q_EXPORT_PLUGIN2(hshomescreenstateplugin, HsHomeScreenStatePlugin)
       
    51 
       
    52 #ifdef COVERAGE_MEASUREMENT
       
    53 #pragma CTC ENDSKIP
       
    54 #endif //COVERAGE_MEASUREMENT