phoneclientserver/phoneclient/Src/ExtCallWrapper/CPhCltDialer.cpp
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     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:  Dialer class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "cphcltdialer.h" 
       
    22 #include    "cphcltdialerdlg.h" 
       
    23 
       
    24 
       
    25 
       
    26 // ============================ MEMBER FUNCTIONS ===============================
       
    27 
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CPhCltDialer::NewL
       
    31 // Two-phased constructor.
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 EXPORT_C CPhCltDialer* CPhCltDialer::NewL()
       
    35     {
       
    36     CPhCltDialer* self = 
       
    37         new ( ELeave ) CPhCltDialer;
       
    38     
       
    39     CleanupStack::PushL( self );
       
    40     self->ConstructL();
       
    41     CleanupStack::Pop();
       
    42 
       
    43     return self;
       
    44     }
       
    45 
       
    46 
       
    47 // Destructor
       
    48 CPhCltDialer::~CPhCltDialer()
       
    49     {
       
    50     if ( iDestroyed )
       
    51         {
       
    52         *iDestroyed = ETrue;
       
    53         iDestroyed = NULL;
       
    54         }
       
    55 
       
    56     delete iDialDlg;
       
    57     }
       
    58 
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CPhCltDialer::DialData
       
    62 //
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 EXPORT_C TPhCltExtPhoneDialData& 
       
    66     CPhCltDialer::DialData()
       
    67     {
       
    68     return iDialDlg->DialData();
       
    69     }
       
    70 
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CPhCltDialer::ExecuteLD
       
    74 //
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 EXPORT_C void CPhCltDialer::ExecuteLD()
       
    78     {
       
    79     TBool destroyed = EFalse;
       
    80     iDestroyed = &destroyed;
       
    81 
       
    82     CleanupStack::PushL( this );
       
    83     CleanupStack::PushL( TCleanupItem( DoClear, this ) );
       
    84 
       
    85     iDialDlg->ExecuteDialLD();
       
    86 
       
    87     if ( !destroyed )
       
    88         {
       
    89         CleanupStack::PopAndDestroy(); // DoClear
       
    90         CleanupStack::PopAndDestroy( this );
       
    91         }
       
    92     else
       
    93         {
       
    94         // Already deleted
       
    95         CleanupStack::Pop();
       
    96         CleanupStack::Pop( this );
       
    97         }
       
    98     }
       
    99 
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CPhCltDialer::CPhCltDialer
       
   103 // C++ default constructor can NOT contain any code, that
       
   104 // might leave.
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 CPhCltDialer::CPhCltDialer()
       
   108     {
       
   109     }
       
   110 
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // CPhCltDialer::ConstructL
       
   114 // Symbian 2nd phase constructor can leave.
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 void CPhCltDialer::ConstructL()
       
   118     {
       
   119     iDialDlg = new ( ELeave ) CPhCltDialerDlg;
       
   120     }
       
   121 
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CPhCltDialer::DoClear
       
   125 //
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 void CPhCltDialer::DoClear( TAny* aAny )
       
   129     {
       
   130     CPhCltDialer* dialer =
       
   131         reinterpret_cast< CPhCltDialer* >( aAny );
       
   132 
       
   133     dialer->iDestroyed = NULL;
       
   134     dialer->iDialDlg = NULL;
       
   135     }
       
   136 
       
   137 
       
   138 //  End of File