messagingappbase/msgerrorwatcher/src/MsgErrorDisconnectDlg.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  
       
    15 *    CMsgErrorDisconnectDlg implementation file
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <DisconnectDlgClient.h>
       
    23 
       
    24 #include "MsgErrorDisconnectDlg.h"
       
    25 
       
    26 // LOCAL CONSTANTS AND MACROS
       
    27 
       
    28 // ---------------------------------------------------------
       
    29 // CMsgErrorDisconnectDlg::NewL
       
    30 //
       
    31 // Two-phased constructor.
       
    32 // ---------------------------------------------------------
       
    33 //
       
    34 CMsgErrorDisconnectDlg* CMsgErrorDisconnectDlg::NewL()
       
    35     {
       
    36     CMsgErrorDisconnectDlg* self = new ( ELeave ) CMsgErrorDisconnectDlg();
       
    37     CleanupStack::PushL( self );
       
    38     self->ConstructL();
       
    39     CleanupStack::Pop( self );
       
    40     return self;
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------
       
    44 // CMsgErrorDisconnectDlg::ConstructL
       
    45 //
       
    46 // Symbian OS default constructor can leave.
       
    47 // ---------------------------------------------------------
       
    48 //
       
    49 void CMsgErrorDisconnectDlg::ConstructL()
       
    50     {
       
    51     User::LeaveIfError( iDialogServer.Connect() );
       
    52     CActiveScheduler::Add( this );
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------
       
    56 // CMsgErrorDisconnectDlg::CMsgErrorDisconnectDlg
       
    57 //
       
    58 // C++ constructor can NOT contain any code, that
       
    59 // might leave.
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 CMsgErrorDisconnectDlg::CMsgErrorDisconnectDlg() 
       
    63     : CActive( CActive::EPriorityStandard )
       
    64     {
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------
       
    68 // CMsgErrorDisconnectDlg::~CMsgErrorDisconnectDlg
       
    69 //
       
    70 // Destructor
       
    71 // ---------------------------------------------------------
       
    72 //
       
    73 CMsgErrorDisconnectDlg::~CMsgErrorDisconnectDlg()
       
    74     {
       
    75     Cancel();
       
    76     iDialogServer.Close();
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------
       
    80 // CMsgErrorDisconnectDlg::RunL
       
    81 //
       
    82 // From active object framework
       
    83 // ---------------------------------------------------------
       
    84 //
       
    85 void CMsgErrorDisconnectDlg::RunL() 
       
    86     {
       
    87     //We're not really interested in what happened.
       
    88     //We are not informing MsgErrorWatcher that the dialog
       
    89     //      is dismissed and MsgErrorWatcher could then 
       
    90     //      delete this CMsgErrorDisconnectDlg.
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------
       
    94 // CMsgErrorDisconnectDlg::DoCancel
       
    95 //
       
    96 // From active object framework
       
    97 // ---------------------------------------------------------
       
    98 //
       
    99 void CMsgErrorDisconnectDlg::DoCancel()
       
   100     {
       
   101     iDialogServer.CancelDisconnectDlg();
       
   102     }
       
   103 
       
   104 // ---------------------------------------------------------
       
   105 // CMsgErrorDisconnectDlg::Start
       
   106 //
       
   107 // Starts the active object
       
   108 // ---------------------------------------------------------
       
   109 //
       
   110 void CMsgErrorDisconnectDlg::Start()
       
   111     {
       
   112     if ( !IsActive() ) 
       
   113         {
       
   114         iDialogServer.DisconnectDlg( iStatus );
       
   115         SetActive();
       
   116         }
       
   117     }
       
   118 
       
   119 
       
   120 // End of File