diff -r 30e048a7b597 -r bad0cc58d154 securitysettings/cpeapuiplugins/cpeapsimakaui/src/cpeapsimakaplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/securitysettings/cpeapuiplugins/cpeapsimakaui/src/cpeapsimakaplugin.cpp Tue Aug 31 15:16:37 2010 +0300 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2010 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: + * Control Panel QT plugin for EAP-SIM and EAP-AKA + * method configuration + * + */ + +/* + * %version: 10 % + */ + +// System includes +#include + +// User includes +#include "cpeapsimakaplugin.h" +#include "cpeapsimakaui.h" +#include "eapuidefs.h" + +/*! + * \class CpEapSimAkaPlugin + * \brief Control Panel QT plugin for EAP-SIM and EAP-AKA method configuration. + */ + +// External function prototypes + +// Local constants + +Q_EXPORT_PLUGIN2(CpEapSimAkaPlugin, CpEapSimAkaPlugin); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + * Constructor. + */ +CpEapSimAkaPlugin::CpEapSimAkaPlugin() : + mBearer(EapQtConfigInterface::EapBearerTypeWlan), + mIapId(EapQtConfigInterface::IapIdUndefined) +{ + // Nothing to be done + qDebug("CpEapSimAkaPlugin created"); +} + +/*! + * Destructor. + */ +CpEapSimAkaPlugin::~CpEapSimAkaPlugin() +{ + // Nothing to be done + // UI instances are owned and deallocated by CP framework + qDebug("CpEapSimAkaPlugin destroyed"); +} + +/*! + * See CpEapPluginInterface::setSettingsReference() + * + * @param bearer Bearer of the accessed settings + * @param iapId ID of the accessed IAP + */ +void CpEapSimAkaPlugin::setSettingsReference(const EapQtConfigInterface::EapBearerType bearer, + const int iapId) +{ + mBearer = bearer; + mIapId = iapId; +} + +/*! + * See CpEapPluginInterface::pluginInfo() + * + * @return Plugin info (EAP-SIM and EAP-AKA) + */ +QList CpEapSimAkaPlugin::pluginInfo() +{ + qDebug("CpEapSimAkaPlugin: provide plugin info"); + QList ret; + + ret.append(EapQtPluginInfo( + EapQtPluginHandle::PluginEapSim, + EapQtUiConstants::StringEapSim, + EapQtUiConstants::OrderEapSim)); + + ret.append(EapQtPluginInfo( + EapQtPluginHandle::PluginEapAka, + EapQtUiConstants::StringEapAka, + EapQtUiConstants::OrderEapAka)); + + return ret; +} + +/*! + * See CpEapPluginInterface::uiInstance() + * + * Creates UI instance + * + * @param outerHandle Plugin handle to outer EAP type. + * @param plugin Plugin info + * + * @return SIM/AKA UI instance + */ +CpBaseSettingView* CpEapSimAkaPlugin::uiInstance( + const EapQtPluginHandle& outerHandle, + const EapQtPluginInfo &plugin) +{ + qDebug("CpEapSimAkaPlugin: create UI instance"); + + Q_ASSERT(mIapId != EapQtConfigInterface::IapIdUndefined); + + // instance is owned and deallocated by CP framework + return new CpEapSimAkaUi(mBearer, mIapId, plugin, outerHandle); +}