securitysettings/cpwlansecurityuiplugins/cpwpacmnui/src/cpwpacmnui.cpp
author hgs
Thu, 24 Jun 2010 11:23:08 +0300
changeset 34 ad1f037f1ac2
parent 26 9abfd4f00d37
permissions -rw-r--r--
201025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
34
hgs
parents: 26
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 *
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 * Initial Contributors:
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
 *
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
 * Contributors:
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
 *
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
 * Description: 
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 *    Control Panel QT UI for WPA/WPA2/802_Dot_1x configuration
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
 *
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
 */
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
/*
34
hgs
parents: 26
diff changeset
    20
 * %version: tr1cfwln#23 %
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
 */
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
// System includes
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <QStringList>
26
hgs
parents: 22
diff changeset
    25
#include <cpsettingformitemdata.h>
hgs
parents: 22
diff changeset
    26
#include <cpitemdatahelper.h>
hgs
parents: 22
diff changeset
    27
#include <cpbasesettingview.h>
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <cmconnectionmethod_shim.h>
26
hgs
parents: 22
diff changeset
    29
#include <eapqtplugininfo.h>
hgs
parents: 22
diff changeset
    30
#include <eapqtconfiginterface.h>
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
// User includes
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include "cpwpacmnui.h"
26
hgs
parents: 22
diff changeset
    34
#include "cpwpacmnui_p.h"
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
26
hgs
parents: 22
diff changeset
    36
// Trace Definition
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
#include "OstTraceDefinitions.h"
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
#ifdef OST_TRACE_COMPILER_IN_USE
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
#include "cpwpacmnuiTraces.h"
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
#endif
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
/*!
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
 \class CpWpaCmnUi
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
 \brief CpWpaCmnUi implements the common Ui for WPA/WPA2/802.1x/WPA2 only 
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
 Security Settings Control Panel Plugins,
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
 which will allow viewing/editing of WPA/WPA2/802.1x/WPA2 Security Settings.
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
 */
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
//Contructs Common Ui (WPA/WPA2/802.1x/WPA2only) object
26
hgs
parents: 22
diff changeset
    49
CpWpaCmnUi::CpWpaCmnUi(CMManagerShim::WlanSecMode securityMode, CpItemDataHelper &dataHelpper)
hgs
parents: 22
diff changeset
    50
    
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
{
26
hgs
parents: 22
diff changeset
    52
    d_ptr = new CpWpaCmnUiPrivate(securityMode,dataHelpper);
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
}
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
//Deletes objects owned by Common Ui
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
CpWpaCmnUi::~CpWpaCmnUi()
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
{
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
    //delete all dynamically allocated objects
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
    OstTraceFunctionEntry1(CPWPACMNUI_CPWPACMNUI_ENTRY,this);
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
26
hgs
parents: 22
diff changeset
    60
    delete d_ptr;
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
    
26
hgs
parents: 22
diff changeset
    62
   OstTraceFunctionExit1(CPWPACMNUI_CPWPACMNUI_EXIT,this);
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
}
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
// ======== MEMBER FUNCTIONS ========
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
/*!
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
 * Creates the Ui instance based on the security mode;WPAWPA2/802.1x/WPA2 only 
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
 * Owns the Ui instance
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
 * 
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
 * \param eapQtConfigInterface to list all eap plugins
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
 * \param mCmCM Connection MethoD Qt interface
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
 * 
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
 * \return Ui instance for the security mode set
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
 */
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
CpSettingFormItemData* CpWpaCmnUi::createUi(
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
        EapQtConfigInterface *eapQtConfigInterface,
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
        CmConnectionMethodShim *cmCM)
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
{
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
    OstTraceFunctionEntry1(CPWPACMNUI_CREATEUI_ENTRY,this);
26
hgs
parents: 22
diff changeset
    82
    OstTraceFunctionExit1(CPWPACMNUI_CREATEUI_EXIT,this);    
hgs
parents: 22
diff changeset
    83
    return d_ptr->createUi(eapQtConfigInterface,cmCM);
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
}
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
/*!
26
hgs
parents: 22
diff changeset
    88
   Validates current security settings. This function is called whenever
hgs
parents: 22
diff changeset
    89
   user tries to exit from the settings view. If the plugin determines
hgs
parents: 22
diff changeset
    90
   that some settings need editing before considered valid, it shall
hgs
parents: 22
diff changeset
    91
   return false. A dialog will be shown to the user indicating that
hgs
parents: 22
diff changeset
    92
   settings are still incomplete and asking if he/she wishes to exit
hgs
parents: 22
diff changeset
    93
   anyway.
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
26
hgs
parents: 22
diff changeset
    95
   \return True if security settings are valid, false if not.
hgs
parents: 22
diff changeset
    96
*/
hgs
parents: 22
diff changeset
    97
bool CpWpaCmnUi::validateSettings()
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
    {
26
hgs
parents: 22
diff changeset
    99
    return d_ptr->validateSettings();
22
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
    }
093cf0757204 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
26
hgs
parents: 22
diff changeset
   102
hgs
parents: 22
diff changeset
   103
hgs
parents: 22
diff changeset
   104
hgs
parents: 22
diff changeset
   105