connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/nowlannetworksavailablenotif.cpp
changeset 20 9c97ad6591ae
parent 18 fcbbe021d614
child 21 b8e8e15e80f2
child 23 7ec726f93df1
child 28 860702281757
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
     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 // INCLUDE FILES
       
    19 #include "ConnectionDialogsUidDefs.h"
       
    20 #include "nowlannetworksavailablenotif.h"
       
    21 #include "nowlansdiscreetpopup.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 = CNoWlansDiscreetPopup::NewL( this );
       
    63         
       
    64     iActiveNote->StartL();       
       
    65     }
       
    66     
       
    67 // ---------------------------------------------------------
       
    68 // void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus )
       
    69 // ---------------------------------------------------------
       
    70 //
       
    71 void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus )
       
    72     {
       
    73     iCancelled = ETrue;
       
    74     
       
    75     if ( !iMessage.IsNull() )
       
    76         {
       
    77         iMessage.Complete( aStatus );
       
    78         }
       
    79     }    
       
    80 
       
    81 // ---------------------------------------------------------
       
    82 // CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL()
       
    83 // ---------------------------------------------------------
       
    84 //
       
    85 CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL( 
       
    86                                         const TBool aResourceFileResponsible )
       
    87     {
       
    88     CNoWLANNetworksAvailableNotif* self = 
       
    89                             new( ELeave ) CNoWLANNetworksAvailableNotif();
       
    90     CleanupStack::PushL( self );
       
    91     self->ConstructL( KResourceFileName, aResourceFileResponsible );
       
    92     CleanupStack::Pop();
       
    93 
       
    94     return self;
       
    95     }
       
    96     
       
    97 
       
    98 // ---------------------------------------------------------
       
    99 // CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif()
       
   100 // ---------------------------------------------------------
       
   101 //
       
   102 CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif() 
       
   103 : CConnectionDialogsNotifBase(), 
       
   104   iActiveNote( NULL )
       
   105 {    
       
   106 }    
       
   107 
       
   108 // ---------------------------------------------------------
       
   109 // void CNoWLANNetworksAvailableNotif::Cancel()
       
   110 // ---------------------------------------------------------
       
   111 //
       
   112 void CNoWLANNetworksAvailableNotif::Cancel()
       
   113     {
       
   114     if ( !iCancelled )
       
   115         {
       
   116         iCancelled = ETrue;
       
   117         
       
   118         if ( !iMessage.IsNull() )
       
   119             {
       
   120             iMessage.Complete( KErrCancel );
       
   121             }
       
   122         }
       
   123     
       
   124     if ( iActiveNote )
       
   125         {
       
   126         delete iActiveNote;
       
   127         iActiveNote = NULL;
       
   128         }
       
   129     }
       
   130 
       
   131 // End of File