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