wlanutilities/wlansniffer/aiplugin/src/wsfactivewrappers.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 16:55:05 +0300
branchRCL_3
changeset 20 a9524956f6b5
parent 12 981afc7d3841
permissions -rw-r--r--
Revision: 201023 Kit: 2010125

/*
 * Copyright (c) 2007-2008 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:  Implementation of CWsfActiveWrappers.
 *
 */



// INCLUDE FILES
#include "wsflogger.h"
#include "wsfactivewrappers.h"
#include "wsfwlanlistactivewrapper.h"
#include "wsfrefreshscanactivewrapper.h"
#include "wsfdisconnectactivewrapper.h"
#include "wsfconnectactivewrapper.h"
#include "wsflaunchaihelperactivewrapper.h"


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::CWsfActiveWrappers
// ----------------------------------------------------------------------------
//
CWsfActiveWrappers::CWsfActiveWrappers()
    {
    // No implementation required
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::~CWsfActiveWrappers
// ----------------------------------------------------------------------------
//
CWsfActiveWrappers::~CWsfActiveWrappers()
    {
    delete iWLANListActiveWrapper;
    delete iRefreshScanActiveWrapper;
    delete iDisconnectActiveWrapper;
    delete iConnectActiveWrapper;
    delete iLaunchAiHelperActiveWrapper;
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::NewLC
// ----------------------------------------------------------------------------
//
CWsfActiveWrappers* CWsfActiveWrappers::NewLC( CWsfModel* aModel,
        TWsfAiController &aController )
    {
    LOG_ENTERFN( "CWsfActiveWrappers::NewLC" );
    CWsfActiveWrappers* self = new ( ELeave ) CWsfActiveWrappers();
    CleanupStack::PushL( self );
    self->ConstructL( aModel, aController );
    return self;
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::NewL
// ----------------------------------------------------------------------------
//
CWsfActiveWrappers* CWsfActiveWrappers::NewL( CWsfModel* aModel,
        TWsfAiController &aController )
    {
    LOG_ENTERFN( "CWsfActiveWrappers::NewL" );
    CWsfActiveWrappers* self = CWsfActiveWrappers::NewLC( aModel, aController );
    CleanupStack::Pop(); // self;
    return self;
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::ConstructL
// ----------------------------------------------------------------------------
//
void CWsfActiveWrappers::ConstructL( CWsfModel* aModel,
        TWsfAiController &aController )
    {
    LOG_ENTERFN( "CWsfActiveWrappers::ConstructL" );
    iWLANListActiveWrapper = CWsfWLANListActiveWrapper::NewL( aModel, 
                                                              aController );
    
    iRefreshScanActiveWrapper = CWsfRefreshScanActiveWrapper::NewL( aModel );
    
    iDisconnectActiveWrapper = CWsfDisconnectActiveWrapper::NewL( aModel );
    
    iConnectActiveWrapper = CWsfConnectActiveWrapper::NewL( aModel );
    
    iLaunchAiHelperActiveWrapper = CWsfLaunchAiHelperActiveWrapper::NewL( 
                                                          aModel, aController );
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::Disconnect
// ----------------------------------------------------------------------------
//
void CWsfActiveWrappers::Disconnect()
    {
    LOG_ENTERFN( "CWsfActiveWrappers::Disconnect" );
    iDisconnectActiveWrapper->Start();
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::Connect
// ----------------------------------------------------------------------------
//
void CWsfActiveWrappers::Connect( TUint aIapID, TBool aConnectOnly, 
                                  TWsfIapPersistence aPersistence )
    {
    LOG_ENTERFN( "CWsfActiveWrappers::Connect" );
    iConnectActiveWrapper->Start( aIapID, aConnectOnly, aPersistence );
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::RefreshScan
// ----------------------------------------------------------------------------
//
void CWsfActiveWrappers::RefreshScan()
    {
    LOG_ENTERFN( "CWsfActiveWrappers::RefreshScan" );
    iRefreshScanActiveWrapper->Start();
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::RefreshWLANList
// ----------------------------------------------------------------------------
//
void CWsfActiveWrappers::RefreshWLANList( TBool aStarUp )
    {
    LOG_ENTERFN( "CWsfActiveWrappers::RefreshWLANList" );
    iWLANListActiveWrapper->Start( aStarUp );
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::LaunchHelperApplicationL
// ----------------------------------------------------------------------------
//
void CWsfActiveWrappers::LaunchHelperApplicationL( TWsfWlanInfo& aInfo, 
                                                   TBool aConnectOnly,
                                                   TBool aTestAccessPoint )
    {
    LOG_ENTERFN( "CWsfActiveWrappers::LaunchHelperApplicationL" );
    iLaunchAiHelperActiveWrapper->Start( aInfo, aConnectOnly, aTestAccessPoint );
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::GetWLANList
// ----------------------------------------------------------------------------
//
CWsfWlanInfoArray* CWsfActiveWrappers::GetWLANList()
    {
    LOG_ENTERFN( "CWsfActiveWrappers::GetWLANList" );
    return iWLANListActiveWrapper->GetWlanList();
    }


// ----------------------------------------------------------------------------
// CWsfActiveWrappers::GetConnectedWLANNetwork
// ----------------------------------------------------------------------------
//
TWsfWlanInfo CWsfActiveWrappers::GetConnectedWLANNetwork()
    {
    LOG_ENTERFN( "CWsfActiveWrappers::GetConnectedWLANNetwork" );
    return iWLANListActiveWrapper->GetConnectedWLANNetwork();
    }