windowing/windowserver/test/t_ratelimiter/tratelimitdrawer/wsratelimitdrawer.cpp
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code
       
    20 */
       
    21 
       
    22 #include "wsratelimitdrawer.h"
       
    23 
       
    24 //Constant message handle, which is used to send count value between client and plug-in
       
    25 const TUint8 KCmdCount=0;
       
    26 
       
    27 /**
       
    28 Creates new object of type CWsRateLimitGraphic based on existing plug-in id.
       
    29 This interally constructs CWsGraphic object
       
    30 @param	TUid	Test plug-in id
       
    31 */
       
    32 EXPORT_C CWsRateLimitGraphic* CWsRateLimitGraphic::NewL(TUid aUid)
       
    33 	{
       
    34 	CWsRateLimitGraphic* self = new(ELeave) CWsRateLimitGraphic;
       
    35 	CleanupStack::PushL(self);
       
    36 	self->BaseConstructL(aUid,KRateLimitDrawerImplId,KNullDesC8());
       
    37 	CleanupStack::Pop(self);
       
    38 	return self;
       
    39 	}
       
    40 
       
    41 /**
       
    42 Creates new object of type CWsRateLimitGraphic based on active screen number.
       
    43 This interally constructs CWsGraphic object
       
    44 */
       
    45 EXPORT_C CWsRateLimitGraphic* CWsRateLimitGraphic::NewL()
       
    46 	{
       
    47 	CWsRateLimitGraphic* self = new(ELeave) CWsRateLimitGraphic;
       
    48 	CleanupStack::PushL(self);
       
    49 	self->BaseConstructL(KRateLimitDrawerImplId,KNullDesC8());
       
    50 	CleanupStack::Pop(self);
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 EXPORT_C CWsRateLimitGraphic::~CWsRateLimitGraphic()
       
    55 	{
       
    56 	}
       
    57 
       
    58 CWsRateLimitGraphic::CWsRateLimitGraphic()
       
    59 	{
       
    60 	}
       
    61 
       
    62 void CWsRateLimitGraphic::HandleMessage(const TDesC8& aData)
       
    63 	{
       
    64 	if (aData.Size()>1)
       
    65 		{
       
    66 		Mem::Copy(iAnimData, aData.Ptr(),(aData.Size()));
       
    67 		}
       
    68 	}
       
    69 
       
    70 void CWsRateLimitGraphic::OnReplace()
       
    71 	{
       
    72 	}
       
    73 
       
    74 /**
       
    75 Query a message value from test plug-in.
       
    76 @param	TAnimData	Drawing count for two animations.
       
    77 */
       
    78 EXPORT_C TInt CWsRateLimitGraphic::QueryPluginForFrameRate(TAnimData& aAnimData)
       
    79 	{
       
    80 	TBuf8<1> cmd;
       
    81 	cmd.Append(KCmdCount);
       
    82 	SendMessage(cmd);
       
    83 	TInt err = Flush();
       
    84 	if (err!=KErrNone)
       
    85 		return err;
       
    86 	iAnimData=&aAnimData;
       
    87 	return KErrNone;
       
    88 	}