connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnectViaNoteNotif.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) 2006 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 CConnectViaNoteNotif.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "ConnectViaNoteNotif.h"
       
    21 #include "ConnectionUiUtilitiesCommon.h"
       
    22 #include "ActiveConnectViaNote.h"
       
    23 #include "ConnUiUtilsNotif.h"
       
    24 #include "ConnectionDialogsLogger.h"
       
    25 
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 // ---------------------------------------------------------
       
    30 // CConnectViaNoteNotif::TNotifierInfo CConnectViaNoteNotif::RegisterL()
       
    31 // ---------------------------------------------------------
       
    32 //
       
    33 CConnectViaNoteNotif::TNotifierInfo CConnectViaNoteNotif::RegisterL()
       
    34     {
       
    35     iInfo.iUid = KUidConnectViaNote;
       
    36     iInfo.iPriority = ENotifierPriorityHigh;
       
    37     iInfo.iChannel = KUidConnectViaNote;
       
    38 
       
    39     return iInfo;
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------
       
    43 // void CConnectViaNoteNotif::StartL
       
    44 // ---------------------------------------------------------
       
    45 //
       
    46 void CConnectViaNoteNotif::StartL( const TDesC8& aBuffer, 
       
    47                                     TInt aReplySlot,
       
    48                                     const RMessagePtr2& aMessage )
       
    49     {
       
    50     CLOG_ENTERFN( "CConnectViaNoteNotif::StartL" );  
       
    51 
       
    52     TPckgBuf<TConnUiUiDestConnMethodNoteId> input;
       
    53     input.Copy( aBuffer );
       
    54     TConnUiUiDestConnMethodNoteId info = input();
       
    55     
       
    56     iReplySlot = aReplySlot;
       
    57     iMessage = aMessage;
       
    58     iCancelled = EFalse;
       
    59 
       
    60     iActiveNote = new( ELeave ) CActiveConnectViaNote( this, info );
       
    61         
       
    62     iActiveNote->LaunchActiveConnectViaNote();       
       
    63     }
       
    64 
       
    65 // ---------------------------------------------------------
       
    66 // void CConnectViaNoteNotif::Cancel()
       
    67 // ---------------------------------------------------------
       
    68 //
       
    69 void CConnectViaNoteNotif::Cancel()
       
    70     {
       
    71     CLOG_ENTERFN( "CConnectViaNoteNotif::Cancel" );  
       
    72 
       
    73     if ( !iCancelled )
       
    74         {
       
    75         iCancelled = ETrue;
       
    76         if ( !iMessage.IsNull() )
       
    77             {   // No need to return an error code, we are just completing!
       
    78             CLOG_WRITEF( _L( "Completing CConnectViaNoteNotif with KErrNone" ) );
       
    79             iMessage.Complete( KErrNone );
       
    80             }
       
    81         
       
    82         delete iActiveNote;
       
    83         iActiveNote = NULL;
       
    84         }
       
    85 
       
    86     CLOG_LEAVEFN( "CConnectViaNoteNotif::Cancel" );  
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // void CConnectViaNoteNotif::CompleteL( TInt aStatus )
       
    91 // ---------------------------------------------------------
       
    92 //
       
    93 void CConnectViaNoteNotif::CompleteL( TInt aStatus )
       
    94     {    
       
    95     CLOG_ENTERFN( "CConnectViaNoteNotif::CompleteL" );  
       
    96     CLOG_WRITEF( _L( "aStatus: %d" ),  aStatus );
       
    97 
       
    98     delete iActiveNote;
       
    99     iActiveNote = NULL;
       
   100     iCancelled = ETrue;    
       
   101     if ( !iMessage.IsNull() )
       
   102         {
       
   103         CLOG_WRITEF( _L( "Completing CConnectViaNoteNotif with %d" ),  aStatus );
       
   104         iMessage.Complete( aStatus );
       
   105         }
       
   106     CLOG_LEAVEFN( "CConnectViaNoteNotif::CompleteL" );  
       
   107     }
       
   108 
       
   109 
       
   110 // ---------------------------------------------------------
       
   111 // CConnectViaNoteNotif* CConnectViaNoteNotif::NewL()
       
   112 // ---------------------------------------------------------
       
   113 //
       
   114 CConnectViaNoteNotif* CConnectViaNoteNotif::NewL( 
       
   115                                         const TBool aResourceFileResponsible )
       
   116     {
       
   117     CConnectViaNoteNotif* self = new ( ELeave ) CConnectViaNoteNotif();
       
   118     CleanupStack::PushL( self );
       
   119     self->ConstructL( KResourceFileName, aResourceFileResponsible );
       
   120     CleanupStack::Pop();
       
   121     return self;
       
   122     }
       
   123 
       
   124 
       
   125 // End of File