| sl@0 |      1 | // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
 | 
| sl@0 |      2 | // All rights reserved.
 | 
| sl@0 |      3 | // This component and the accompanying materials are made available
 | 
| sl@0 |      4 | // under the terms of "Eclipse Public License v1.0"
 | 
| sl@0 |      5 | // which accompanies this distribution, and is available
 | 
| sl@0 |      6 | // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 | 
| sl@0 |      7 | //
 | 
| sl@0 |      8 | // Initial Contributors:
 | 
| sl@0 |      9 | // Nokia Corporation - initial contribution.
 | 
| sl@0 |     10 | //
 | 
| sl@0 |     11 | // Contributors:
 | 
| sl@0 |     12 | //
 | 
| sl@0 |     13 | // Description:
 | 
| sl@0 |     14 | //
 | 
| sl@0 |     15 | 
 | 
| sl@0 |     16 | #ifndef __WSGRAPHICMSGBUF_H__
 | 
| sl@0 |     17 | #define __WSGRAPHICMSGBUF_H__
 | 
| sl@0 |     18 | 
 | 
| sl@0 |     19 | #include <e32std.h>
 | 
| sl@0 |     20 | 
 | 
| sl@0 |     21 | class TWsGraphicMsgBufParser
 | 
| sl@0 |     22 | /** Utility class for parsing incoming data associated with individual draw commands
 | 
| sl@0 |     23 | @see CWindowGc::DrawWsGraphic
 | 
| sl@0 |     24 | @see RWsGraphicMsgBuf
 | 
| sl@0 |     25 | @publishedPartner
 | 
| sl@0 |     26 | @released
 | 
| sl@0 |     27 | */	{
 | 
| sl@0 |     28 | public:
 | 
| sl@0 |     29 | 	IMPORT_C TWsGraphicMsgBufParser(const TDesC8& aData);
 | 
| sl@0 |     30 | 	IMPORT_C TInt Verify() const;
 | 
| sl@0 |     31 | 	IMPORT_C TInt Count() const;
 | 
| sl@0 |     32 | 	IMPORT_C TUid Uid(TInt aIndex) const;
 | 
| sl@0 |     33 | 	IMPORT_C TPtrC8 Data(TInt aIndex) const;
 | 
| sl@0 |     34 | 	IMPORT_C TInt Find(TUid aUid,TInt aStartingFrom = 0) const;
 | 
| sl@0 |     35 | 	IMPORT_C TBool LoadFixed(TUid aUid,TAny* aMsg,TInt aMsgSize,TInt aStartingFrom = 0) const;
 | 
| sl@0 |     36 | protected:
 | 
| sl@0 |     37 | 	TInt IntAt(TInt aOfs) const;
 | 
| sl@0 |     38 | protected:
 | 
| sl@0 |     39 | 	const TDesC8& iData;
 | 
| sl@0 |     40 | 	};
 | 
| sl@0 |     41 | 
 | 
| sl@0 |     42 | class TWsGraphicMsgAnimation
 | 
| sl@0 |     43 | /** Utility class for parsing incoming TWsGraphicAnimation messages
 | 
| sl@0 |     44 | @see CWindowGc::DrawWsGraphic
 | 
| sl@0 |     45 | @see RWsGraphicMsgBuf
 | 
| sl@0 |     46 | @publishedPartner
 | 
| sl@0 |     47 | @released
 | 
| sl@0 |     48 | */	{
 | 
| sl@0 |     49 | public:
 | 
| sl@0 |     50 | 	IMPORT_C TWsGraphicMsgAnimation();
 | 
| sl@0 |     51 | 	IMPORT_C TInt Load(const TWsGraphicMsgBufParser& aData);
 | 
| sl@0 |     52 | 	IMPORT_C TInt Load(const TWsGraphicMsgBufParser& aData,TInt aIndex);
 | 
| sl@0 |     53 | 	IMPORT_C TTimeIntervalMicroSeconds AnimationTime(const TTime& aNow,const TTimeIntervalMicroSeconds& aAnimationLength) const;
 | 
| sl@0 |     54 | 	IMPORT_C TBool IsPlaying(const TTime& aNow,const TTimeIntervalMicroSeconds& aAnimationLength) const;
 | 
| sl@0 |     55 | private:
 | 
| sl@0 |     56 | 	enum
 | 
| sl@0 |     57 | 		{
 | 
| sl@0 |     58 | 		// animation state in lowest nibble
 | 
| sl@0 |     59 | 		EStopped	= 0x00,
 | 
| sl@0 |     60 | 		EPlaying	= 0x01,
 | 
| sl@0 |     61 | 		EStopping	= 0x02,
 | 
| sl@0 |     62 | 		EPaused		= 0x03,
 | 
| sl@0 |     63 | 		EStateMask	= 0x0F,
 | 
| sl@0 |     64 | 		// other flags above
 | 
| sl@0 |     65 | 		ELoop		= 0x10
 | 
| sl@0 |     66 | 		};
 | 
| sl@0 |     67 | 	TUint iFlags;
 | 
| sl@0 |     68 | 	TTime iPlay;
 | 
| sl@0 |     69 | 	TTime iPauseOrStopping;
 | 
| sl@0 |     70 | 	};
 | 
| sl@0 |     71 | 
 | 
| sl@0 |     72 | #endif //__WSGRAPHICMSGBUF_H__
 |