connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/nowlannetworksavailablenotif.cpp
changeset 0 5a93021fdf25
child 1 40cb640ef159
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Implementation of CNoWLANNetworksAvailableNotif.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "nowlannetworksavailablenotif.h"
       
    21 #include "ActiveWLANNetworkUnavailableNote.h"
       
    22 #include "ConnUiUtilsNotif.h"
       
    23 
       
    24 
       
    25 // ================= MEMBER FUNCTIONS =======================
       
    26 
       
    27 // ---------------------------------------------------------
       
    28 // CNoWLANNetworksAvailableNotif::TNotifierInfo 
       
    29 //                 CNoWLANNetworksAvailableNotif::RegisterL()
       
    30 // ---------------------------------------------------------
       
    31 //
       
    32 CNoWLANNetworksAvailableNotif::TNotifierInfo 
       
    33                    CNoWLANNetworksAvailableNotif::RegisterL()
       
    34     {
       
    35     iInfo.iUid      = KUidNoWLANNetworksAvailableNote;
       
    36     iInfo.iPriority = ENotifierPriorityVHigh;
       
    37     iInfo.iChannel  = KUidNoWLANNetworksAvailableNote;
       
    38 
       
    39     return iInfo;
       
    40     }
       
    41 
       
    42 
       
    43 // ---------------------------------------------------------
       
    44 // void CNoWLANNetworksAvailableNotif::StartL()
       
    45 // ---------------------------------------------------------
       
    46 //
       
    47 void CNoWLANNetworksAvailableNotif::StartL( const TDesC8& /*aBuffer*/, 
       
    48                                             TInt aReplySlot,
       
    49                                             const RMessagePtr2& aMessage )
       
    50     {
       
    51     if ( iActiveNote )
       
    52         {
       
    53         // Note is already active
       
    54         aMessage.Complete( KErrNone );
       
    55         return;
       
    56         }
       
    57     
       
    58     iReplySlot = aReplySlot;
       
    59     iMessage   = aMessage;
       
    60     iCancelled = EFalse;
       
    61             
       
    62     iActiveNote = new( ELeave ) CActiveWLANNetworkUnavailableNote( this );
       
    63         
       
    64     iActiveNote->LaunchWLANNetworkUnavailable( 
       
    65                    CActiveWLANNetworkUnavailableNote::EWlanNote2 );       
       
    66     }
       
    67     
       
    68 // ---------------------------------------------------------
       
    69 // void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus )
       
    70 // ---------------------------------------------------------
       
    71 //
       
    72 void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus )
       
    73     {    
       
    74     delete iActiveNote;
       
    75     iActiveNote = NULL;
       
    76     
       
    77     iCancelled = ETrue;
       
    78     
       
    79     if ( !iMessage.IsNull() )
       
    80         {
       
    81         iMessage.Complete( aStatus );
       
    82         }
       
    83     Cancel();
       
    84     }    
       
    85 
       
    86 // ---------------------------------------------------------
       
    87 // CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL()
       
    88 // ---------------------------------------------------------
       
    89 //
       
    90 CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL( 
       
    91                                         const TBool aResourceFileResponsible )
       
    92     {
       
    93     CNoWLANNetworksAvailableNotif* self = 
       
    94                             new( ELeave ) CNoWLANNetworksAvailableNotif();
       
    95     CleanupStack::PushL( self );
       
    96     self->ConstructL( KResourceFileName, aResourceFileResponsible );
       
    97     CleanupStack::Pop();
       
    98 
       
    99     return self;
       
   100     }
       
   101     
       
   102 
       
   103 // ---------------------------------------------------------
       
   104 // CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif()
       
   105 // ---------------------------------------------------------
       
   106 //
       
   107 CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif() 
       
   108 : CConnectionDialogsNotifBase(), 
       
   109   iActiveNote( NULL )
       
   110 {    
       
   111 }    
       
   112 
       
   113 // ---------------------------------------------------------
       
   114 // void CNoWLANNetworksAvailableNotif::Cancel()
       
   115 // ---------------------------------------------------------
       
   116 //
       
   117 void CNoWLANNetworksAvailableNotif::Cancel()
       
   118     {
       
   119     if ( !iCancelled )
       
   120         {
       
   121         iCancelled = ETrue;
       
   122         
       
   123         if ( !iMessage.IsNull() )
       
   124             {
       
   125             iMessage.Complete( KErrCancel );
       
   126             }
       
   127         
       
   128         delete iActiveNote;
       
   129         iActiveNote = NULL;
       
   130         }
       
   131     }
       
   132 
       
   133 // End of File