securitysettings/cpeapuiplugins/cpeapsimakaui/src/cpeapsimakaplugin.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     1 /*
       
     2  * Copyright (c) 2010 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  *   Control Panel QT plugin for EAP-SIM and EAP-AKA 
       
    16  *   method configuration
       
    17  *
       
    18  */
       
    19 
       
    20 /*
       
    21  * %version:  10 %
       
    22  */
       
    23 
       
    24 // System includes
       
    25 #include <eapqtpluginhandle.h>
       
    26 
       
    27 // User includes
       
    28 #include "cpeapsimakaplugin.h"
       
    29 #include "cpeapsimakaui.h"
       
    30 #include "eapuidefs.h"
       
    31 
       
    32 /*!
       
    33  * \class CpEapSimAkaPlugin
       
    34  * \brief Control Panel QT plugin for EAP-SIM and EAP-AKA method configuration. 
       
    35  */
       
    36 
       
    37 // External function prototypes
       
    38 
       
    39 // Local constants
       
    40 
       
    41 Q_EXPORT_PLUGIN2(CpEapSimAkaPlugin, CpEapSimAkaPlugin);
       
    42 
       
    43 // ======== LOCAL FUNCTIONS ========
       
    44 
       
    45 // ======== MEMBER FUNCTIONS ========
       
    46 
       
    47 /*!
       
    48  * Constructor.
       
    49  */
       
    50 CpEapSimAkaPlugin::CpEapSimAkaPlugin() :
       
    51     mBearer(EapQtConfigInterface::EapBearerTypeWlan),
       
    52     mIapId(EapQtConfigInterface::IapIdUndefined)
       
    53 {
       
    54     // Nothing to be done
       
    55     qDebug("CpEapSimAkaPlugin created");
       
    56 }
       
    57 
       
    58 /*!
       
    59  * Destructor.
       
    60  */
       
    61 CpEapSimAkaPlugin::~CpEapSimAkaPlugin()
       
    62 {
       
    63     // Nothing to be done
       
    64     // UI instances are owned and deallocated by CP framework
       
    65     qDebug("CpEapSimAkaPlugin destroyed");
       
    66 }
       
    67 
       
    68 /*!
       
    69  * See CpEapPluginInterface::setSettingsReference()
       
    70  * 
       
    71  * @param bearer Bearer of the accessed settings
       
    72  * @param iapId ID of the accessed IAP
       
    73  */
       
    74 void CpEapSimAkaPlugin::setSettingsReference(const EapQtConfigInterface::EapBearerType bearer,
       
    75     const int iapId)
       
    76 {
       
    77     mBearer = bearer;
       
    78     mIapId = iapId;
       
    79 }
       
    80 
       
    81 /*!
       
    82  * See CpEapPluginInterface::pluginInfo()
       
    83  * 
       
    84  * @return Plugin info (EAP-SIM and EAP-AKA)
       
    85  */
       
    86 QList<EapQtPluginInfo> CpEapSimAkaPlugin::pluginInfo()
       
    87 {
       
    88     qDebug("CpEapSimAkaPlugin: provide plugin info");
       
    89     QList<EapQtPluginInfo> ret;
       
    90 
       
    91     ret.append(EapQtPluginInfo(
       
    92         EapQtPluginHandle::PluginEapSim,
       
    93         EapQtUiConstants::StringEapSim,
       
    94         EapQtUiConstants::OrderEapSim));
       
    95 
       
    96     ret.append(EapQtPluginInfo(
       
    97         EapQtPluginHandle::PluginEapAka,
       
    98         EapQtUiConstants::StringEapAka,
       
    99         EapQtUiConstants::OrderEapAka));
       
   100 
       
   101     return ret;
       
   102 }
       
   103 
       
   104 /*!
       
   105  * See CpEapPluginInterface::uiInstance()
       
   106  * 
       
   107  * Creates UI instance
       
   108  * 
       
   109  * @param outerHandle Plugin handle to outer EAP type.
       
   110  * @param plugin Plugin info
       
   111  * 
       
   112  * @return SIM/AKA UI instance
       
   113  */
       
   114 CpBaseSettingView* CpEapSimAkaPlugin::uiInstance(
       
   115     const EapQtPluginHandle& outerHandle,
       
   116     const EapQtPluginInfo &plugin)
       
   117 {
       
   118     qDebug("CpEapSimAkaPlugin: create UI instance");
       
   119 
       
   120     Q_ASSERT(mIapId != EapQtConfigInterface::IapIdUndefined);
       
   121 
       
   122     // instance is owned and deallocated by CP framework
       
   123     return new CpEapSimAkaUi(mBearer, mIapId, plugin, outerHandle);
       
   124 }