contentstorage/caclient/s60/src/caqtsfhandlerloader.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 <QMap>
       
    19 #include <QScopedPointer>
       
    20 #include <QString>
       
    21 #include <qservice.h>
       
    22 #include <qstringlist.h>
       
    23 #include <qservicemanager.h>
       
    24 
       
    25 #include "cahandler.h"
       
    26 #include "caqtsfhandlerloader.h"
       
    27 #include "caclient_defines.h"
       
    28 #include "caapphandler.h"
       
    29 #include "caurlhandler.h"
       
    30 #include "catapphandler.h" 
       
    31 #include "cas60handleradapter.h"
       
    32 
       
    33 QTM_USE_NAMESPACE
       
    34 
       
    35 /*!
       
    36     \class CaQtSfHandlerLoader
       
    37     \ingroup 
       
    38     \brief Loads handlers implementation
       
    39 
       
    40     The purpose of the class is to find Qt SF plugins implementing command handlers.
       
    41     Temporarily because of issues with Qt SF this is replaced by immediate object
       
    42     creation.
       
    43     \sa CaHandlerLoader
       
    44 */
       
    45 
       
    46 /*!
       
    47     Loads handler implementations appropriate for the requested entry type name and command.
       
    48     
       
    49     The caller takes ownership of the returned pointer.
       
    50         
       
    51     \param entryTypeName Entry type name.
       
    52     \param commandName Name of the command to be handled.
       
    53     \return A pointer to handler serving the entry type and command if found, NULL otherwise.
       
    54 */
       
    55 CaHandler *CaQtSfHandlerLoader::loadHandler(const QString &entryTypeName,
       
    56         const QString &commandName)
       
    57 {
       
    58     Q_UNUSED(commandName);
       
    59 
       
    60     CaHandler *implementation(0);
       
    61 
       
    62     if (entryTypeName == APPLICATION_ENTRY_TYPE_NAME
       
    63         || entryTypeName == WIDGET_ENTRY_TYPE_NAME) {
       
    64         implementation = new CaS60HandlerAdapter<CCaAppHandler>;
       
    65     } else if (entryTypeName == URL_ENTRY_TYPE_NAME) {
       
    66         implementation = new CaS60HandlerAdapter<CCaUrlHandler>;
       
    67     } else if (entryTypeName == TEMPLATED_APPLICATION_ENTRY_TYPE_NAME) {
       
    68         implementation = new CaTappHandler;
       
    69     }
       
    70 
       
    71     return implementation;
       
    72 }
       
    73 
       
    74