contextframework/cfw/src/cfserver/cfphasebase.cpp
changeset 0 2e3d3ce01487
child 15 312d2b433792
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2006-2008 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:  CFPhaseBase class implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "cfphasebase.h"
       
    20 #include "cftrace.h"
       
    21 
       
    22 #ifdef _DEBUG
       
    23 
       
    24 // Panic category
       
    25 _LIT( KPanicCat, "Ph.Base" );
       
    26 
       
    27 // Panic codes
       
    28 enum TPanicCode
       
    29     {
       
    30     ENoRequestToComplete
       
    31     };
       
    32 
       
    33 // Local panic function
       
    34 LOCAL_C void Panic( TInt aCode )
       
    35     {
       
    36     User::Panic( KPanicCat, aCode );
       
    37     }
       
    38 
       
    39 #endif
       
    40 
       
    41 CCFPhaseBase::~CCFPhaseBase()
       
    42     {
       
    43     FUNC_LOG;
       
    44     
       
    45     if( iStarterRequest )
       
    46         {
       
    47         Complete( KErrCancel );
       
    48         }
       
    49     }
       
    50 
       
    51 void CCFPhaseBase::ConstructL()
       
    52     {
       
    53     FUNC_LOG;
       
    54     }
       
    55 
       
    56 CCFPhaseBase::CCFPhaseBase( TCFPhaseId aId, MCFContextInterface& aCF ):
       
    57     iId( aId ),
       
    58     iCF( aCF )
       
    59     {
       
    60     FUNC_LOG;
       
    61     }
       
    62 
       
    63 // METHODS
       
    64 
       
    65 //-----------------------------------------------------------------------------
       
    66 // CCFPhaseBase::PhaseId
       
    67 //-----------------------------------------------------------------------------
       
    68 //
       
    69 TInt CCFPhaseBase::PhaseId() const
       
    70     {
       
    71     FUNC_LOG;
       
    72     
       
    73     return iId;
       
    74     }
       
    75 
       
    76 //-----------------------------------------------------------------------------
       
    77 // CCFPhaseBase::Complete
       
    78 //-----------------------------------------------------------------------------
       
    79 //
       
    80 void CCFPhaseBase::Complete( TInt aError )
       
    81     {
       
    82     FUNC_LOG;
       
    83     
       
    84     __ASSERT_DEBUG( iStarterRequest, Panic( ENoRequestToComplete ) );
       
    85     
       
    86     User::RequestComplete( iStarterRequest, aError );
       
    87     }
       
    88 
       
    89 //------------------------------------------------------------------------------
       
    90 // CCFPhaseBase::Cancel
       
    91 //------------------------------------------------------------------------------
       
    92 //
       
    93 void CCFPhaseBase::Cancel()
       
    94     {
       
    95     FUNC_LOG;
       
    96 
       
    97     __ASSERT_DEBUG( iStarterRequest, Panic( ENoRequestToComplete ) );
       
    98     
       
    99     User::RequestComplete( iStarterRequest, KErrCancel );
       
   100     }
       
   101 
       
   102 //-----------------------------------------------------------------------------
       
   103 // CCFPhaseBase::HandleEvent
       
   104 //-----------------------------------------------------------------------------
       
   105 //
       
   106 void CCFPhaseBase::HandleEvent( MCFStarterEventHandler::TCFStarterEvents /*aEvent*/ )
       
   107     {
       
   108 	  FUNC_LOG;
       
   109     }