securitysettings/cpeapuiplugins/cpeapsimakaui/src/cpeapsimakaplugin.cpp
changeset 26 9abfd4f00d37
child 34 ad1f037f1ac2
equal deleted inserted replaced
25:e03a3db4489e 26:9abfd4f00d37
       
     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 the License "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:  8 %
       
    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 // Order numbers
       
    42 static const int order_eapsim(60);
       
    43 static const int order_eapaka(70);
       
    44 
       
    45 Q_EXPORT_PLUGIN2(CpEapSimAkaPlugin, CpEapSimAkaPlugin)
       
    46 ;
       
    47 
       
    48 // ======== LOCAL FUNCTIONS ========
       
    49 
       
    50 // ======== MEMBER FUNCTIONS ========
       
    51 
       
    52 /*!
       
    53  * Constructor.
       
    54  */
       
    55 CpEapSimAkaPlugin::CpEapSimAkaPlugin() :
       
    56     mBearer(EapQtConfigInterface::EapBearerTypeWlan),
       
    57     mIapId(EapQtConfigInterface::IapIdUndefined)
       
    58 {
       
    59     // Nothing to be done
       
    60     qDebug("CpEapSimAkaPlugin created");
       
    61 }
       
    62 
       
    63 /*!
       
    64  * Destructor.
       
    65  */
       
    66 CpEapSimAkaPlugin::~CpEapSimAkaPlugin()
       
    67 {
       
    68     // Nothing to be done
       
    69     // UI instances are owned and deallocated by CP framework
       
    70     qDebug("CpEapSimAkaPlugin destroyed");
       
    71 }
       
    72 
       
    73 /*!
       
    74  * See CpEapPluginInterface::setSettingsReference()
       
    75  * 
       
    76  * @param bearer Bearer of the accessed settings
       
    77  * @param iapId ID of the accessed IAP
       
    78  */
       
    79 void CpEapSimAkaPlugin::setSettingsReference(const EapQtConfigInterface::EapBearerType bearer,
       
    80     const int iapId)
       
    81 {
       
    82     mBearer = bearer;
       
    83     mIapId = iapId;
       
    84 }
       
    85 
       
    86 /*!
       
    87  * See CpEapPluginInterface::pluginInfo()
       
    88  * 
       
    89  * @return Plugin info (EAP-SIM and EAP-AKA)
       
    90  */
       
    91 QList<EapQtPluginInfo> CpEapSimAkaPlugin::pluginInfo()
       
    92 {
       
    93     qDebug("CpEapSimAkaPlugin: provide plugin info");
       
    94     QList<EapQtPluginInfo> ret;
       
    95 
       
    96     ret.append(EapQtPluginInfo(EapQtPluginHandle::PluginEapSim,  
       
    97         EapUiStrings::EapSim, order_eapsim) );
       
    98     
       
    99     ret.append(EapQtPluginInfo(EapQtPluginHandle::PluginEapAka, 
       
   100         EapUiStrings::EapAka, order_eapaka) );
       
   101 
       
   102     return ret;
       
   103 }
       
   104 
       
   105 /*!
       
   106  * See CpEapPluginInterface::uiInstance()
       
   107  * 
       
   108  * Creates UI instance
       
   109  * 
       
   110  * @param outerHandle Plugin handle to outer EAP type.
       
   111  * @param plugin Plugin info
       
   112  * 
       
   113  * @return SIM/AKA UI instance
       
   114  */
       
   115 CpBaseSettingView* CpEapSimAkaPlugin::uiInstance(
       
   116     const EapQtPluginHandle& outerHandle,
       
   117     const EapQtPluginInfo &plugin)
       
   118 {
       
   119     qDebug("CpEapSimAkaPlugin: create UI instance");
       
   120 
       
   121     Q_ASSERT(mIapId != EapQtConfigInterface::IapIdUndefined);
       
   122 
       
   123     // instance is owned and deallocated by CP framework
       
   124     return new CpEapSimAkaUi(mBearer, mIapId, plugin, outerHandle);
       
   125 }