os/persistentdata/featuremgmt/featuremgr/test/helper/test_plugins/src/invalidplugin.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/featuremgmt/featuremgr/test/helper/test_plugins/src/invalidplugin.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,110 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +
1.21 +#include "invalidplugin.h"
1.22 +#include <featmgr/featureinfoplugin.h>
1.23 +#include "featmgrdebug.h"
1.24 +#include "efm_test_consts.h"
1.25 +#include <ecom/implementationproxy.h>
1.26 +#include <e32property.h>
1.27 +
1.28 +// Map the interface implementation UIDs to implementation factory functions
1.29 +const TImplementationProxy ImplementationTable[] =
1.30 + {
1.31 + IMPLEMENTATION_PROXY_ENTRY(0x10283708, CFeatMgrInvalidPlugin::NewL),
1.32 + };
1.33 +
1.34 +// Exported proxy for instantiation method resolution.
1.35 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
1.36 + {
1.37 + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
1.38 + return ImplementationTable;
1.39 + }
1.40 +
1.41 +CFeatMgrInvalidPlugin* CFeatMgrInvalidPlugin::NewL()
1.42 + {
1.43 + CFeatMgrInvalidPlugin* self = new(ELeave) CFeatMgrInvalidPlugin();
1.44 + CleanupStack::PushL(self);
1.45 + self->ConstructL();
1.46 + CleanupStack::Pop(self);
1.47 + return self;
1.48 + }
1.49 +
1.50 +CFeatMgrInvalidPlugin::~CFeatMgrInvalidPlugin()
1.51 + {
1.52 + }
1.53 +
1.54 +CFeatMgrInvalidPlugin::CFeatMgrInvalidPlugin()
1.55 + {
1.56 + }
1.57 +
1.58 +void CFeatMgrInvalidPlugin::ProcessCommandL( const FeatureInfoCommand::TFeatureInfoCmd aCommandId,
1.59 + const TUint8 aTransId,
1.60 + TDesC8& /*aData*/ )
1.61 + {
1.62 + INFO_LOG2( "FeatMgrPlugin: Processing command: 0x%x, TransId: 0x%x",
1.63 + aCommandId, aTransId );
1.64 +
1.65 + switch ( aCommandId )
1.66 + {
1.67 + case FeatureInfoCommand::ELoadFeatureInfoCmdId:
1.68 + {
1.69 + INFO_LOG( "FeatMgrPlugin: Processed ELoadFeatureInfoCmdId" );
1.70 + User::Leave(KErrNotSupported);
1.71 + }
1.72 + break;
1.73 + case FeatureInfoCommand::ELoadEnhancedFeatureInfoCmdId:
1.74 + {
1.75 + INFO_LOG( "FeatMgrPlugin: Processed ELoadEnhancedFeatureInfoCmdId" );
1.76 + User::Leave(KErrNotSupported);
1.77 + }
1.78 + break;
1.79 + default:
1.80 + {
1.81 + INFO_LOG1( "FeatMgrPlugin: Unknown Command: 0x%x", aCommandId );
1.82 + User::Leave(KErrNotSupported);
1.83 + }
1.84 + break;
1.85 + }
1.86 +
1.87 + TInt retval(KErrNone);
1.88 + TInt timeout( 50 ); // microseconds
1.89 +
1.90 + // create new timer
1.91 +
1.92 +
1.93 + if ( iTimer && !iTimer->IsActive() )
1.94 + {
1.95 + delete iTimer;
1.96 + iTimer = NULL;
1.97 + }
1.98 +
1.99 + iTimer = CPluginTimer::NewL(timeout, *iResponseCallback, aCommandId, aTransId, retval,this);
1.100 + }
1.101 +
1.102 +
1.103 +void CFeatMgrInvalidPlugin::ConstructL()
1.104 + {
1.105 + }
1.106 +
1.107 +void CFeatMgrInvalidPlugin::GenericTimerFiredL(
1.108 + MFeatureInfoPluginCallback& /*aService*/,
1.109 + FeatureInfoCommand::TFeatureInfoCmd /*aCommandId*/,
1.110 + TUint8 /*aTransId*/,
1.111 + TInt /*aRetVal*/)
1.112 + {
1.113 + }