contextframework/cfw/src/cfserver/cfphasedevicestarting.cpp
changeset 0 2e3d3ce01487
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:  CFPhaseDeviceStarting class implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "cfphasedevicestarting.h"
       
    20 #include "CFContextObjectImpl.h"
       
    21 #include "cfcontextinterface.h"
       
    22 #include "cfwcontextdef.h"
       
    23 #include "cftrace.h"
       
    24 
       
    25 CCFPhaseDeviceStarting* CCFPhaseDeviceStarting::NewL(
       
    26     MCFContextInterface& aCF )
       
    27     {
       
    28     FUNC_LOG;
       
    29     
       
    30     CCFPhaseDeviceStarting* self = CCFPhaseDeviceStarting::NewLC( aCF );
       
    31     CleanupStack::Pop( self );
       
    32     
       
    33     return self;
       
    34     }
       
    35 
       
    36 CCFPhaseDeviceStarting* CCFPhaseDeviceStarting::NewLC(
       
    37     MCFContextInterface& aCF )
       
    38     {
       
    39     FUNC_LOG;
       
    40     
       
    41     CCFPhaseDeviceStarting* self = new( ELeave ) CCFPhaseDeviceStarting( aCF );
       
    42     CleanupStack::PushL( self );
       
    43     self->ConstructL();
       
    44     
       
    45     return self;
       
    46     }
       
    47 
       
    48 CCFPhaseDeviceStarting::~CCFPhaseDeviceStarting()
       
    49     {
       
    50     FUNC_LOG;
       
    51     }
       
    52 
       
    53 void CCFPhaseDeviceStarting::ConstructL()
       
    54     {
       
    55     FUNC_LOG;
       
    56     }
       
    57 
       
    58 CCFPhaseDeviceStarting::CCFPhaseDeviceStarting(
       
    59     MCFContextInterface& aCF ):
       
    60     CCFPhaseBase( CCFPhaseBase::ECFDeviceStarting, aCF )
       
    61     {
       
    62     FUNC_LOG;
       
    63     }
       
    64 
       
    65 // METHODS
       
    66 
       
    67 //-----------------------------------------------------------------------------
       
    68 // CCFPhaseDeviceStarting::ExecuteL
       
    69 //-----------------------------------------------------------------------------
       
    70 //
       
    71 void CCFPhaseDeviceStarting::ExecuteL( TRequestStatus* aStatus )
       
    72     {
       
    73     FUNC_LOG;
       
    74     
       
    75     // Publish context that Context Framework is initializing
       
    76     CCFContextObject* context = CCFContextObject::NewLC( KCfwSource,
       
    77         KCfwSourceStatus,
       
    78         TPtrC( KCfwSourceStatusValues[EStatusInitializing] ) );
       
    79     RThread thread;
       
    80     TInt err = iCF.PublishContext( *context, thread );
       
    81     ERROR_3( err, "Failed to publish context: [%S: %S: %S]",
       
    82          &context->Source(),
       
    83          &context->Type(),
       
    84          &context->Value() );
       
    85     
       
    86     // Clean up
       
    87     thread.Close();
       
    88     CleanupStack::PopAndDestroy( context );
       
    89     
       
    90     // Complete phase immediately
       
    91     iStarterRequest = aStatus;
       
    92     Complete( KErrNone );
       
    93     }
       
    94 
       
    95 //-----------------------------------------------------------------------------
       
    96 // CCFPhaseDeviceStarting::NextPhase
       
    97 //-----------------------------------------------------------------------------
       
    98 //
       
    99 CCFPhaseBase::TCFPhaseId CCFPhaseDeviceStarting::NextPhase() const
       
   100     {
       
   101     FUNC_LOG;
       
   102     
       
   103     return CCFPhaseBase::ECFDeviceStarted;
       
   104     }