contentstorage/cahandler/url/src/caurlhandlerplugin.cpp
changeset 61 8e5041d13c84
child 66 32469d7d46ff
equal deleted inserted replaced
60:f62f87b200ec 61:8e5041d13c84
       
     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 <cadefs.h>
       
    19 #include <qserviceinterfacedescriptor.h>
       
    20 #include <qabstractsecuritysession.h>
       
    21 #include <qservicecontext.h>
       
    22 #include "cahandlerloader.h"
       
    23 
       
    24 #include "caurlhandlerplugin.h"
       
    25 #include "cas60handleradapter.h"
       
    26 #include "caurlhandler.h"
       
    27 
       
    28 /*!
       
    29     \class CaUrlHandlerPlugin
       
    30     \ingroup
       
    31     \brief Implementation of Qt SF plugin for url command handler.
       
    32 */
       
    33 
       
    34 /*!
       
    35     \param descriptor Service descriptor.
       
    36     \param context Ignored.
       
    37     \param session Ignored.
       
    38     \return An instance of the CaS60HandlerAdapter<CCaUrlHandler> when descriptor interface name
       
    39     is "com.nokia.homescreen.ICommandHandler", NULL otherwise.
       
    40 */
       
    41 QObject *CaUrlHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
       
    42         QServiceContext *context,
       
    43         QAbstractSecuritySession *session)
       
    44 {
       
    45     Q_UNUSED(context);
       
    46     Q_UNUSED(session);
       
    47 
       
    48     if (descriptor.interfaceName() ==
       
    49             "com.nokia.homescreen.ICommandHandler") {
       
    50         return new CaS60HandlerAdapter<CCaUrlHandler>;
       
    51     } else {
       
    52         return 0;
       
    53     }
       
    54 }
       
    55 // TODO: uncomment when it will be a plugin
       
    56 //Q_EXPORT_PLUGIN2(caurlhandlerplugin, CaUrlHandlerPlugin)