connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/nowlannetworksavailablenotif.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 08:55:21 +0200
changeset 0 5a93021fdf25
child 1 40cb640ef159
permissions -rw-r--r--
Revision: 200949 Kit: 200951

/*
* Copyright (c) 2009 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 CNoWLANNetworksAvailableNotif.
*
*/


// INCLUDE FILES
#include "nowlannetworksavailablenotif.h"
#include "ActiveWLANNetworkUnavailableNote.h"
#include "ConnUiUtilsNotif.h"


// ================= MEMBER FUNCTIONS =======================

// ---------------------------------------------------------
// CNoWLANNetworksAvailableNotif::TNotifierInfo 
//                 CNoWLANNetworksAvailableNotif::RegisterL()
// ---------------------------------------------------------
//
CNoWLANNetworksAvailableNotif::TNotifierInfo 
                   CNoWLANNetworksAvailableNotif::RegisterL()
    {
    iInfo.iUid      = KUidNoWLANNetworksAvailableNote;
    iInfo.iPriority = ENotifierPriorityVHigh;
    iInfo.iChannel  = KUidNoWLANNetworksAvailableNote;

    return iInfo;
    }


// ---------------------------------------------------------
// void CNoWLANNetworksAvailableNotif::StartL()
// ---------------------------------------------------------
//
void CNoWLANNetworksAvailableNotif::StartL( const TDesC8& /*aBuffer*/, 
                                            TInt aReplySlot,
                                            const RMessagePtr2& aMessage )
    {
    if ( iActiveNote )
        {
        // Note is already active
        aMessage.Complete( KErrNone );
        return;
        }
    
    iReplySlot = aReplySlot;
    iMessage   = aMessage;
    iCancelled = EFalse;
            
    iActiveNote = new( ELeave ) CActiveWLANNetworkUnavailableNote( this );
        
    iActiveNote->LaunchWLANNetworkUnavailable( 
                   CActiveWLANNetworkUnavailableNote::EWlanNote2 );       
    }
    
// ---------------------------------------------------------
// void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus )
// ---------------------------------------------------------
//
void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus )
    {    
    delete iActiveNote;
    iActiveNote = NULL;
    
    iCancelled = ETrue;
    
    if ( !iMessage.IsNull() )
        {
        iMessage.Complete( aStatus );
        }
    Cancel();
    }    

// ---------------------------------------------------------
// CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL()
// ---------------------------------------------------------
//
CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL( 
                                        const TBool aResourceFileResponsible )
    {
    CNoWLANNetworksAvailableNotif* self = 
                            new( ELeave ) CNoWLANNetworksAvailableNotif();
    CleanupStack::PushL( self );
    self->ConstructL( KResourceFileName, aResourceFileResponsible );
    CleanupStack::Pop();

    return self;
    }
    

// ---------------------------------------------------------
// CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif()
// ---------------------------------------------------------
//
CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif() 
: CConnectionDialogsNotifBase(), 
  iActiveNote( NULL )
{    
}    

// ---------------------------------------------------------
// void CNoWLANNetworksAvailableNotif::Cancel()
// ---------------------------------------------------------
//
void CNoWLANNetworksAvailableNotif::Cancel()
    {
    if ( !iCancelled )
        {
        iCancelled = ETrue;
        
        if ( !iMessage.IsNull() )
            {
            iMessage.Complete( KErrCancel );
            }
        
        delete iActiveNote;
        iActiveNote = NULL;
        }
    }

// End of File