securitydialogs/secuidialognotifier/src/secuidialognotifier.cpp
changeset 59 881d92421467
child 63 989397f9511c
equal deleted inserted replaced
53:25dd1e8b2663 59:881d92421467
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Secui dialog notifier
       
    15 *
       
    16 */
       
    17 
       
    18 #include "secuidialognotifier.h"     // CSecuiDialogNotifier
       
    19 #include "secuidialogs.h"            // CSecuiDialogs
       
    20 #include "secuidialogstrace.h"       // TRACE macro
       
    21 
       
    22 
       
    23 // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // CSecuiDialogNotifier::~CSecuiDialogNotifier()
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 CSecuiDialogNotifier::~CSecuiDialogNotifier()
       
    30     {
       
    31     TRACE( "CSecuiDialogNotifier::~CSecuiDialogNotifier" );
       
    32     Cancel();
       
    33     }
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // CSecuiDialogNotifier::NewL()
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 CSecuiDialogNotifier* CSecuiDialogNotifier::NewL()
       
    40     {
       
    41 		TRACE( "CSecuiDialogNotifier::NewL, 1 =%d", 1 );
       
    42     CSecuiDialogNotifier* self = new( ELeave ) CSecuiDialogNotifier;
       
    43     CleanupStack::PushL( self );
       
    44     self->ConstructL();
       
    45     CleanupStack::Pop( self );
       
    46     return self;
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // CSecuiDialogNotifier::Release()
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 void CSecuiDialogNotifier::Release()
       
    54     {
       
    55     TRACE( "CSecuiDialogNotifier::Release" );
       
    56     delete this;
       
    57     }
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // CSecuiDialogNotifier::RegisterL()
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 CSecuiDialogNotifier::TNotifierInfo CSecuiDialogNotifier::RegisterL()
       
    64     {
       
    65 		TRACE( "CSecuiDialogNotifier::RegisterL, 1 =%d", 1 );
       
    66     return Info();
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CSecuiDialogNotifier::Info()
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 CSecuiDialogNotifier::TNotifierInfo CSecuiDialogNotifier::Info() const
       
    74     {
       
    75 		TRACE( "CSecuiDialogNotifier::Info, 1 =%d", 1 );
       
    76 
       
    77     TNotifierInfo info;
       
    78     static const TUid KUidSecuiDialogNotifier = { 0x10005988 };
       
    79     info.iUid = KUidSecuiDialogNotifier;
       
    80     const TUid KSecAuthChannel = {0x00000602};
       
    81     info.iChannel = KSecAuthChannel;
       
    82     info.iPriority = ENotifierPriorityAbsolute;
       
    83     return info;
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // CSecuiDialogNotifier::StartL()
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 void CSecuiDialogNotifier::StartL( const TDesC8& aBuffer, TInt aReplySlot,
       
    91         const RMessagePtr2& aMessage )
       
    92     {
       
    93     TRACE( "CSecuiDialogNotifier::StartL, begin" );
       
    94 
       
    95     TRAPD( err, DoStartL( aBuffer, aReplySlot, aMessage ) );
       
    96     TRACE( "CSecuiDialogNotifier::StartL, DoStartL err=%d", err );
       
    97     if( err )
       
    98         {
       
    99         if( iSecuiDialogs && !iIsSecuiDialogsDeleted )
       
   100             {
       
   101             TRACE( "CSecuiDialogNotifier::StartL, deleting iSecuiDialogs" );
       
   102             delete iSecuiDialogs;
       
   103             iSecuiDialogs = NULL;
       
   104             }
       
   105         if( !aMessage.IsNull() )
       
   106             {
       
   107             TRACE( "CSecuiDialogNotifier::StartL, completing message" );
       
   108             aMessage.Complete( err );
       
   109             }
       
   110         }
       
   111 
       
   112     TRACE( "CSecuiDialogNotifier::StartL, end" );
       
   113     }
       
   114 
       
   115 // ---------------------------------------------------------------------------
       
   116 // CSecuiDialogNotifier::StartL()
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 TPtrC8 CSecuiDialogNotifier::StartL( const TDesC8& /*aBuffer*/ )
       
   120     {
       
   121     return KNullDesC8();
       
   122     }
       
   123 
       
   124 // ---------------------------------------------------------------------------
       
   125 // CSecuiDialogNotifier::Cancel()
       
   126 // ---------------------------------------------------------------------------
       
   127 //
       
   128 void CSecuiDialogNotifier::Cancel()
       
   129     {
       
   130     TRACE( "CSecuiDialogNotifier::Cancel" );
       
   131     if( iSecuiDialogs && !iIsSecuiDialogsDeleted )
       
   132         {
       
   133         TRACE( "CSecuiDialogNotifier::Cancel, deleting iSecuiDialogs" );
       
   134         delete iSecuiDialogs;
       
   135         iSecuiDialogs = NULL;
       
   136         }
       
   137     }
       
   138 
       
   139 // ---------------------------------------------------------------------------
       
   140 // CSecuiDialogNotifier::UpdateL()
       
   141 // ---------------------------------------------------------------------------
       
   142 //
       
   143 TPtrC8 CSecuiDialogNotifier::UpdateL( const TDesC8& /*aBuffer*/ )
       
   144     {
       
   145     return KNullDesC8();
       
   146     }
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // CSecuiDialogNotifier::CSecuiDialogNotifier()
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 CSecuiDialogNotifier::CSecuiDialogNotifier()
       
   153     {
       
   154     TRACE( "CSecuiDialogNotifier::CSecuiDialogNotifier" );
       
   155     }
       
   156 
       
   157 // ---------------------------------------------------------------------------
       
   158 // CSecuiDialogNotifier::ConstructL()
       
   159 // ---------------------------------------------------------------------------
       
   160 //
       
   161 void CSecuiDialogNotifier::ConstructL()
       
   162     {
       
   163     }
       
   164 
       
   165 // ---------------------------------------------------------------------------
       
   166 // CSecuiDialogNotifier::DoStartL()
       
   167 // ---------------------------------------------------------------------------
       
   168 //
       
   169 void CSecuiDialogNotifier::DoStartL( const TDesC8& aBuffer, TInt aReplySlot,
       
   170         const RMessagePtr2& aMessage )
       
   171     {
       
   172 		TRACE( "CSecuiDialogNotifier::DoStartL, 1 =%d", 1 );
       
   173 
       
   174     iSecuiDialogs = CSecuiDialogs::NewL( iIsSecuiDialogsDeleted );
       
   175     iSecuiDialogs->StartLD( aBuffer, aReplySlot, aMessage );
       
   176     }
       
   177