88
|
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>
|
92
|
22 |
|
88
|
23 |
#include "cahandlerloader.h"
|
|
24 |
#include "caapphandler.h"
|
|
25 |
#include "caapphandlerplugin.h"
|
92
|
26 |
#include "cas60apphandleradapter.h"
|
88
|
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") {
|
92
|
50 |
return new CaS60AppHandlerAdapter();
|
88
|
51 |
} else {
|
|
52 |
return 0;
|
|
53 |
}
|
|
54 |
}
|
92
|
55 |
Q_EXPORT_PLUGIN2(caapphandlerplugin, CaAppHandlerPlugin)
|
88
|
56 |
|
|
57 |
|
|
58 |
/*!
|
|
59 |
\class CaHandler
|
|
60 |
\ingroup
|
|
61 |
\brief Interface for command handlers
|
|
62 |
*/
|
|
63 |
|
|
64 |
/*!
|
|
65 |
\fn int CaHandler::execute(const CaEntry &entry, const QString &commandName) = 0
|
|
66 |
\param entry Subject of the command.
|
|
67 |
\param commandName The name of the command to execute.
|
|
68 |
Returns 0 on success, error code otherwise.
|
|
69 |
\sa e32err.h for error code descriptions.
|
|
70 |
*/
|
|
71 |
|
|
72 |
/*!
|
|
73 |
\class CaS60HandlerAdapter<typename Plugin>
|
|
74 |
\ingroup
|
|
75 |
\brief Adapter for S60 command handlers.
|
|
76 |
|
|
77 |
Adapts S60 command handlers to CaHandler interface
|
|
78 |
|
|
79 |
\sa CaHandler
|
|
80 |
*/
|
|
81 |
|
|
82 |
/*!
|
92
|
83 |
\fn int CaS60HandlerAdapter<typename Plugin>::execute(const CaEntry &entry, const QString &commandName)
|
88
|
84 |
\param entry Subject of the command.
|
|
85 |
\param commandName The name of the command to execute.
|
|
86 |
\return 0 on success, error code otherwise.
|
|
87 |
\sa e32err.h for error code descriptions.
|
|
88 |
*/
|