contextframework/cfw/src/cfcontextsourcemanager/CFContextSourcePlugIn.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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:  CFContextSourcePlugIn implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <ecom/ecom.h>
       
    21 #include <cfcontextsourceplugin.h>
       
    22 #include <cfcontextinterface.h>
       
    23 #include <cfcontextsubscriptionlistener.h>
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27 #ifdef _DEBUG
       
    28 _LIT( KPanicCat, "CntxSrcPlugIn" );
       
    29 
       
    30 enum TPanicReason
       
    31     {
       
    32     ENoPanic,  // ENone - ENone caused a trouble when including w32std.h
       
    33     EInvalidInitParam,
       
    34     EInvalidContextManager,
       
    35     EInvalidFs
       
    36     };
       
    37     
       
    38 LOCAL_C void Panic( TPanicReason aReason )
       
    39     {
       
    40     User::Panic( KPanicCat, aReason );
       
    41     }
       
    42 #endif
       
    43 
       
    44 // MEMBER FUNCTIONS
       
    45 
       
    46 EXPORT_C CCFContextSourcePlugIn* CCFContextSourcePlugIn::NewL(
       
    47     const TUid& aImplementationUid,
       
    48     TContextSourceInitParams* aParams )
       
    49     {
       
    50     CCFContextSourcePlugIn* self =
       
    51         CCFContextSourcePlugIn::NewLC( aImplementationUid, aParams );
       
    52     CleanupStack::Pop( self );
       
    53     
       
    54     return self;
       
    55     }
       
    56 
       
    57 EXPORT_C CCFContextSourcePlugIn* CCFContextSourcePlugIn::NewLC(
       
    58     const TUid& aImplementationUid,
       
    59     TContextSourceInitParams* aParams )
       
    60     {
       
    61     __ASSERT_DEBUG( aParams, Panic( EInvalidInitParam ) );
       
    62 
       
    63     CCFContextSourcePlugIn* self =
       
    64         reinterpret_cast<CCFContextSourcePlugIn*>(
       
    65             REComSession::CreateImplementationL(
       
    66                 aImplementationUid,
       
    67                 _FOFF( CCFContextSourcePlugIn, iDtorKey ),
       
    68                 aParams ) );
       
    69 
       
    70     CleanupStack::PushL( self );
       
    71     
       
    72     return self;
       
    73     }
       
    74 
       
    75 EXPORT_C CCFContextSourcePlugIn::~CCFContextSourcePlugIn()
       
    76     {
       
    77     #ifndef _DEBUG
       
    78     REComSession::DestroyedImplementation( iDtorKey );
       
    79     #else
       
    80     if( iDtorKey != KNullUid )
       
    81         {
       
    82         REComSession::DestroyedImplementation( iDtorKey );
       
    83         }
       
    84     #endif    
       
    85     }
       
    86 
       
    87 EXPORT_C CCFContextSourcePlugIn::CCFContextSourcePlugIn(
       
    88     TContextSourceInitParams* aParams ):
       
    89     iCF( aParams->iCF )
       
    90     {
       
    91     }
       
    92     
       
    93 //-----------------------------------------------------------------------------
       
    94 // CCFContextSourcePlugIn::Extension
       
    95 //-----------------------------------------------------------------------------
       
    96 //
       
    97 EXPORT_C TAny* CCFContextSourcePlugIn::Extension(
       
    98     const TUid& /*aExtensionUid*/ ) const
       
    99     {
       
   100     return NULL;
       
   101     }
       
   102 
       
   103 // End of File