contentstorage/cahandler/app/src/caapphandlerplugin.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 "caapphandler.h"
       
    25 #include "caapphandlerplugin.h"
       
    26 #include "cas60handleradapter.h"
       
    27 
       
    28 /*!
       
    29     \class CaAppHandlerPlugin
       
    30     \ingroup
       
    31     \brief Implementation of Qt SF plugin for application 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<CCaAppHandler> when descriptor interface name
       
    39     is "com.nokia.homescreen.ICommandHandler", NULL otherwise.
       
    40 */
       
    41 QObject *CaAppHandlerPlugin::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<CCaAppHandler>;
       
    51     } else {
       
    52         return 0;
       
    53     }
       
    54 }
       
    55 // TODO: uncomment when it will be used in plugin
       
    56 //Q_EXPORT_PLUGIN2(caapphandlerplugin, CaAppHandlerPlugin)
       
    57 
       
    58 
       
    59 /*!
       
    60     \class CaHandler
       
    61     \ingroup
       
    62     \brief Interface for command handlers
       
    63 */
       
    64 
       
    65 /*!
       
    66     \fn int CaHandler::execute(const CaEntry &entry, const QString &commandName) = 0
       
    67     \param entry Subject of the command.
       
    68     \param commandName The name of the command to execute.
       
    69     Returns 0 on success, error code otherwise.
       
    70     \sa e32err.h for error code descriptions.
       
    71 */
       
    72 
       
    73 /*!
       
    74     \class CaS60HandlerAdapter<typename Plugin>
       
    75     \ingroup
       
    76     \brief Adapter for S60 command handlers.
       
    77 
       
    78     Adapts S60 command handlers to CaHandler interface
       
    79 
       
    80     \sa CaHandler
       
    81 */
       
    82 
       
    83 /*!
       
    84     \fn int CaS60HandlerAdapter<typename Plugin>::execute(const CaEntry &entry, const QString &commandName) 
       
    85     \param entry Subject of the command.
       
    86     \param commandName The name of the command to execute.
       
    87     \return 0 on success, error code otherwise.
       
    88     \sa e32err.h for error code descriptions.
       
    89 */