contextframework/cfw/src/cfserver/cfcontextsourcecmd.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 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:  CCFContextSourceCmd implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // SYSTEM INCLUDES
       
    20 #include <cfcontextsourcecommand.h>
       
    21 
       
    22 // USER INCLUDES
       
    23 #include "cfcontextsourcecmd.h"
       
    24 #include "cfcontextsourcecommandinterface.h"
       
    25 #include "cftrace.h"
       
    26 
       
    27 // ======== MEMBER FUNCTIONS ========
       
    28 
       
    29 // ---------------------------------------------------------------------------
       
    30 // C++ constructor.
       
    31 // ---------------------------------------------------------------------------
       
    32 //
       
    33 CCFContextSourceCmd::CCFContextSourceCmd(
       
    34     MCFContextSourceCommand& aSourceCommandHandler )
       
    35     :   iContextSourceCommandHandler( aSourceCommandHandler )
       
    36     {
       
    37     FUNC_LOG;
       
    38     }
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // Symbian 2nd phase constructor.
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 void CCFContextSourceCmd::ConstructL( const CCFContextSourceCommand& aCommand )
       
    45     {
       
    46     FUNC_LOG;
       
    47 
       
    48     iCommand = aCommand.CloneL(); // Make a copy of the command.
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // Symbian two phased constructor.
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 CCFContextSourceCmd* CCFContextSourceCmd::NewL(
       
    56     MCFContextSourceCommand& aSourceCommandHandler,
       
    57     const CCFContextSourceCommand& aCommand )
       
    58     {
       
    59     FUNC_LOG;
       
    60 
       
    61     CCFContextSourceCmd* self = CCFContextSourceCmd::NewLC(
       
    62             aSourceCommandHandler,
       
    63             aCommand );
       
    64     CleanupStack::Pop( self );
       
    65     return self;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // Symbian two phased constructor.
       
    70 // Leaves pointer in the cleanup stack.
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 CCFContextSourceCmd* CCFContextSourceCmd::NewLC(
       
    74     MCFContextSourceCommand& aSourceCommandHandler,
       
    75     const CCFContextSourceCommand& aCommand )
       
    76     {
       
    77     FUNC_LOG;
       
    78 
       
    79     CCFContextSourceCmd* self
       
    80         = new( ELeave ) CCFContextSourceCmd( aSourceCommandHandler );
       
    81     CleanupStack::PushL( self );
       
    82     self->ConstructL( aCommand );
       
    83     return self;
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // C++ destructor.
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 CCFContextSourceCmd::~CCFContextSourceCmd()
       
    91     {
       
    92     FUNC_LOG;
       
    93 
       
    94     delete iCommand;
       
    95     }
       
    96 
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // CCFContextSourceCmd::ExecuteL
       
   100 // ---------------------------------------------------------------------------
       
   101 //
       
   102 void CCFContextSourceCmd::ExecuteL()
       
   103     {
       
   104     FUNC_LOG;
       
   105 
       
   106     iContextSourceCommandHandler.HandleCommandL( *iCommand );
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // CCFContextSourceCmd::LogError
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 void CCFContextSourceCmd::LogError( TInt aError )
       
   114     {
       
   115     FUNC_LOG;
       
   116 
       
   117     if( aError != KErrNone )
       
   118         {
       
   119         ERROR( aError, "CCFContextSourceCmd::LogError - MCFContextSourceCommand::HandleCommandL() execution failed." );
       
   120         }
       
   121     }
       
   122 
       
   123 // End of file