taskswitcherapp/tsserviceplugin/src/tsserviceplugin.cpp
changeset 35 f9ce957a272c
child 36 cdae8c6c3876
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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include "tsserviceplugin.h"
       
    19 
       
    20 #include <qserviceinterfacedescriptor.h>
       
    21 #include <qabstractsecuritysession.h>
       
    22 #include <qservicecontext.h>
       
    23 
       
    24 #include "tsitemprovider.h"
       
    25 #include "tsactivation.h"
       
    26 #include "tsdeactivation.h"
       
    27 #include "tspresentation.h"
       
    28 
       
    29 QObject *TsServicePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session)
       
    30 {
       
    31     Q_UNUSED(context);
       
    32     Q_UNUSED(session);
       
    33 
       
    34     if (descriptor.interfaceName() == "com.nokia.taskswitcher.itemprovider") {
       
    35         return new TsItemProvider(this);
       
    36     } else if (descriptor.interfaceName() == "com.nokia.taskswitcher.activation") {
       
    37         return new TsActivation(this);
       
    38     } else if (descriptor.interfaceName() == "com.nokia.taskswitcher.deactivation") {
       
    39         return new TsDeactivation(this);
       
    40     } else if (descriptor.interfaceName() == "com.nokia.taskswitcher.presentation") {
       
    41         return new TsPresentation(this);
       
    42     } else {
       
    43         return NULL;
       
    44     }
       
    45 }
       
    46 
       
    47 Q_EXPORT_PLUGIN2(tsserviceplugin, TsServicePlugin)