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