contentstorage/cahandler/app/src/caapphandlerplugin.cpp
author hgs
Fri, 30 Apr 2010 15:22:08 +0300
changeset 93 82b66994846c
parent 92 782e3408c2ab
child 83 156f692b1687
permissions -rw-r--r--
201017
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
88
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 *
hgs
parents:
diff changeset
     9
 * Initial Contributors:
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
 *
hgs
parents:
diff changeset
    12
 * Contributors:
hgs
parents:
diff changeset
    13
 *
hgs
parents:
diff changeset
    14
 * Description:
hgs
parents:
diff changeset
    15
 *
hgs
parents:
diff changeset
    16
 */
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include <cadefs.h>
hgs
parents:
diff changeset
    19
#include <qserviceinterfacedescriptor.h>
hgs
parents:
diff changeset
    20
#include <qabstractsecuritysession.h>
hgs
parents:
diff changeset
    21
#include <qservicecontext.h>
92
hgs
parents: 88
diff changeset
    22
88
hgs
parents:
diff changeset
    23
#include "cahandlerloader.h"
hgs
parents:
diff changeset
    24
#include "caapphandler.h"
hgs
parents:
diff changeset
    25
#include "caapphandlerplugin.h"
92
hgs
parents: 88
diff changeset
    26
#include "cas60apphandleradapter.h"
88
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
/*!
hgs
parents:
diff changeset
    29
    \class CaAppHandlerPlugin
hgs
parents:
diff changeset
    30
    \ingroup
hgs
parents:
diff changeset
    31
    \brief Implementation of Qt SF plugin for application command handler.
hgs
parents:
diff changeset
    32
*/
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
/*!
hgs
parents:
diff changeset
    35
    \param descriptor Service descriptor.
hgs
parents:
diff changeset
    36
    \param context Ignored.
hgs
parents:
diff changeset
    37
    \param session Ignored.
hgs
parents:
diff changeset
    38
    \return An instance of the CaS60HandlerAdapter<CCaAppHandler> when descriptor interface name
hgs
parents:
diff changeset
    39
    is "com.nokia.homescreen.ICommandHandler", NULL otherwise.
hgs
parents:
diff changeset
    40
*/
hgs
parents:
diff changeset
    41
QObject *CaAppHandlerPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
hgs
parents:
diff changeset
    42
        QServiceContext *context,
hgs
parents:
diff changeset
    43
        QAbstractSecuritySession *session)
hgs
parents:
diff changeset
    44
{
hgs
parents:
diff changeset
    45
    Q_UNUSED(context);
hgs
parents:
diff changeset
    46
    Q_UNUSED(session);
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
    if (descriptor.interfaceName() ==
hgs
parents:
diff changeset
    49
            "com.nokia.homescreen.ICommandHandler") {
92
hgs
parents: 88
diff changeset
    50
        return new CaS60AppHandlerAdapter();
88
hgs
parents:
diff changeset
    51
    } else {
hgs
parents:
diff changeset
    52
        return 0;
hgs
parents:
diff changeset
    53
    }
hgs
parents:
diff changeset
    54
}
92
hgs
parents: 88
diff changeset
    55
Q_EXPORT_PLUGIN2(caapphandlerplugin, CaAppHandlerPlugin)
88
hgs
parents:
diff changeset
    56
hgs
parents:
diff changeset
    57
hgs
parents:
diff changeset
    58
/*!
hgs
parents:
diff changeset
    59
    \class CaHandler
hgs
parents:
diff changeset
    60
    \ingroup
hgs
parents:
diff changeset
    61
    \brief Interface for command handlers
hgs
parents:
diff changeset
    62
*/
hgs
parents:
diff changeset
    63
hgs
parents:
diff changeset
    64
/*!
hgs
parents:
diff changeset
    65
    \fn int CaHandler::execute(const CaEntry &entry, const QString &commandName) = 0
hgs
parents:
diff changeset
    66
    \param entry Subject of the command.
hgs
parents:
diff changeset
    67
    \param commandName The name of the command to execute.
hgs
parents:
diff changeset
    68
    Returns 0 on success, error code otherwise.
hgs
parents:
diff changeset
    69
    \sa e32err.h for error code descriptions.
hgs
parents:
diff changeset
    70
*/
hgs
parents:
diff changeset
    71
hgs
parents:
diff changeset
    72
/*!
hgs
parents:
diff changeset
    73
    \class CaS60HandlerAdapter<typename Plugin>
hgs
parents:
diff changeset
    74
    \ingroup
hgs
parents:
diff changeset
    75
    \brief Adapter for S60 command handlers.
hgs
parents:
diff changeset
    76
hgs
parents:
diff changeset
    77
    Adapts S60 command handlers to CaHandler interface
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
    \sa CaHandler
hgs
parents:
diff changeset
    80
*/
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
/*!
92
hgs
parents: 88
diff changeset
    83
    \fn int CaS60HandlerAdapter<typename Plugin>::execute(const CaEntry &entry, const QString &commandName)
88
hgs
parents:
diff changeset
    84
    \param entry Subject of the command.
hgs
parents:
diff changeset
    85
    \param commandName The name of the command to execute.
hgs
parents:
diff changeset
    86
    \return 0 on success, error code otherwise.
hgs
parents:
diff changeset
    87
    \sa e32err.h for error code descriptions.
hgs
parents:
diff changeset
    88
*/