contentstorage/cahandler/inc/cas60handleradapter.h
changeset 61 8e5041d13c84
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 #ifndef CA_S60_HANDLER_ADAPTER_H
       
    19 #define CA_S60_HANDLER_ADAPTER_H
       
    20 
       
    21 #include <e32des8.h>
       
    22 #include <cadefs.h>
       
    23 #include <caentry.h>
       
    24 #include <QScopedPointer>
       
    25 #include <QString>
       
    26 #include <utf.h>
       
    27 #include <XQConversions>
       
    28 
       
    29 #include "cainnerentry.h"
       
    30 #include "cahandler.h"
       
    31 #include "caobjectadapter.h"
       
    32 
       
    33 template <typename Plugin>
       
    34 class CaS60HandlerAdapter: public CaHandler
       
    35 {
       
    36 public:
       
    37     int execute(const CaEntry &entry, const QString &commandName) {
       
    38 
       
    39         QScopedPointer<HBufC8> commandNameDesc8(XQConversions::qStringToS60Desc8(commandName));
       
    40         QScopedPointer<CCaInnerEntry> innerEntry(NULL);
       
    41 
       
    42         TRAPD(result,
       
    43              innerEntry.reset(CCaInnerEntry::NewL());
       
    44              CaObjectAdapter::convertL(entry, *innerEntry);
       
    45 
       
    46              static QScopedPointer<Plugin> plugin(Plugin::NewL());
       
    47              plugin->HandleCommandL(*innerEntry, commandNameDesc8->Des());
       
    48             );
       
    49 
       
    50         return result;
       
    51     }
       
    52 };
       
    53 
       
    54 
       
    55 #endif