imageeditor/plugins/DrawPlugin/inc/AnimationAO.h
author Simon Howkins <simonh@symbian.org>
Mon, 15 Nov 2010 12:21:35 +0000
changeset 24 f8a4151f4fe1
parent 12 18b321db4884
permissions -rw-r--r--
Added include to define the macros used
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     1
/*
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     2
 ============================================================================
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     3
 Name		: AnimationAO.h
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     4
 Author	  : 
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     5
 Version	 : 1.0
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     6
 Copyright   : Your copyright notice
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     7
 Description : CAnimationAO declaration
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     8
 ============================================================================
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     9
 */
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    10
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    11
#ifndef ANIMATIONAO_H
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    12
#define ANIMATIONAO_H
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    13
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    14
#include <e32base.h>	// For CActive, link against: euser.lib
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    15
#include <e32std.h>		// For RTimer, link against: euser.lib
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    16
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    17
class MAnimationObserver
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    18
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    19
public:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    20
	virtual void Notify() = 0;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    21
	~MAnimationObserver() {}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    22
protected:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    23
	MAnimationObserver() {}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    24
	};
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    25
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    26
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    27
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    28
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    29
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    30
class CAnimationAO : public CActive
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    31
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    32
public:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    33
	// Cancel and destroy
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    34
	~CAnimationAO();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    35
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    36
	// Two-phased constructor.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    37
	static CAnimationAO* NewL();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    38
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    39
	// Two-phased constructor.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    40
	static CAnimationAO* NewLC();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    41
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    42
public:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    43
	// New functions
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    44
	// Function for making the initial request
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    45
	void StartL(TTimeIntervalMicroSeconds32 aDelay);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    46
	void SetObserver(MAnimationObserver *aObserver);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    47
	
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    48
private:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    49
	// C++ constructor
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    50
	CAnimationAO();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    51
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    52
	// Second-phase constructor
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    53
	void ConstructL();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    54
	
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    55
	
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    56
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    57
private:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    58
	// From CActive
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    59
	// Handle completion
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    60
	void RunL();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    61
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    62
	// How to cancel me
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    63
	void DoCancel();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    64
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    65
	// Override to handle leaves from RunL(). Default implementation causes
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    66
	// the active scheduler to panic.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    67
	TInt RunError(TInt aError);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    68
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    69
private:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    70
	RTimer iTimer; // Provides async timing service
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    71
	MAnimationObserver *iObserver;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    72
	};
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    73
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    74
#endif // ANIMATIONAO_H