phonebookengines/cntactions/src/cntbrowseraction.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:29:23 +0300
changeset 40 b46a585f6909
child 61 d30183af6ca6
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

#include "cntbrowseraction.h"

#include <qcontacturl.h>
#include <qcontactfilters.h>

//Action class
CntBrowserAction::CntBrowserAction() : 
    CntAction("url")
{
}

CntBrowserAction::~CntBrowserAction()
{
}

QContactFilter CntBrowserAction::contactFilter(const QVariant& value) const
{
     Q_UNUSED(value);
     
    QContactDetailFilter urlFilter;
    urlFilter.setDetailDefinitionName(QContactUrl::DefinitionName); 
    
    return urlFilter;
}

bool CntBrowserAction::isDetailSupported(const QContactDetail &detail, const QContact &/*contact*/) const
{
    return (detail.definitionName() == QContactUrl::DefinitionName);
}

QList<QContactDetail> CntBrowserAction::supportedDetails(const QContact& contact) const
{
    return contact.details(QContactUrl::DefinitionName);
}

CntBrowserAction* CntBrowserAction::clone() const
{
     return new CntBrowserAction();
}

void CntBrowserAction::performAction()
{
    QVariant retValue;
    emitResult(GeneralError, retValue);
    
    /*
    QString service("com.nokia.services.telephony");
    QString type("dial(QString,int)");
    
    performNumberAction(service, type);
    */
}