sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #include "wsratelimitdrawer.h" sl@0: sl@0: //Constant message handle, which is used to send count value between client and plug-in sl@0: const TUint8 KCmdCount=0; sl@0: sl@0: /** sl@0: Creates new object of type CWsRateLimitGraphic based on existing plug-in id. sl@0: This interally constructs CWsGraphic object sl@0: @param TUid Test plug-in id sl@0: */ sl@0: EXPORT_C CWsRateLimitGraphic* CWsRateLimitGraphic::NewL(TUid aUid) sl@0: { sl@0: CWsRateLimitGraphic* self = new(ELeave) CWsRateLimitGraphic; sl@0: CleanupStack::PushL(self); sl@0: self->BaseConstructL(aUid,KRateLimitDrawerImplId,KNullDesC8()); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: Creates new object of type CWsRateLimitGraphic based on active screen number. sl@0: This interally constructs CWsGraphic object sl@0: */ sl@0: EXPORT_C CWsRateLimitGraphic* CWsRateLimitGraphic::NewL() sl@0: { sl@0: CWsRateLimitGraphic* self = new(ELeave) CWsRateLimitGraphic; sl@0: CleanupStack::PushL(self); sl@0: self->BaseConstructL(KRateLimitDrawerImplId,KNullDesC8()); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CWsRateLimitGraphic::~CWsRateLimitGraphic() sl@0: { sl@0: } sl@0: sl@0: CWsRateLimitGraphic::CWsRateLimitGraphic() sl@0: { sl@0: } sl@0: sl@0: void CWsRateLimitGraphic::HandleMessage(const TDesC8& aData) sl@0: { sl@0: if (aData.Size()>1) sl@0: { sl@0: Mem::Copy(iAnimData, aData.Ptr(),(aData.Size())); sl@0: } sl@0: } sl@0: sl@0: void CWsRateLimitGraphic::OnReplace() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: Query a message value from test plug-in. sl@0: @param TAnimData Drawing count for two animations. sl@0: */ sl@0: EXPORT_C TInt CWsRateLimitGraphic::QueryPluginForFrameRate(TAnimData& aAnimData) sl@0: { sl@0: TBuf8<1> cmd; sl@0: cmd.Append(KCmdCount); sl@0: SendMessage(cmd); sl@0: TInt err = Flush(); sl@0: if (err!=KErrNone) sl@0: return err; sl@0: iAnimData=&aAnimData; sl@0: return KErrNone; sl@0: }