epoc32/include/animationmixins.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 // Copyright (c) 2004-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __ANIMATIONMIXINS_H__
    17 #define __ANIMATIONMIXINS_H__
    18 
    19 #include <e32base.h>
    20 
    21 /** Interface from a data provider to an animation
    22 
    23 An animation which has a data provider receives information from it via this
    24 interface.
    25 
    26 You do not need to derive an implementation from this class unless you are
    27 writing a new animation type.
    28 
    29 @publishedAll 
    30 @released
    31 @see CAnimationDataProvider
    32 @see CAnimation
    33 @see CAnimator*/
    34 class MAnimationDataProviderObserver
    35 	{
    36 public:
    37 	/** Receives an event from a data provider.
    38 	@param aEvent The event code.
    39 	@param aData Any data associated with the event. Can be NULL.
    40 	@param aDataSize The size in bytes of the item pointed to by aData.*/
    41 	virtual void DataProviderEventL(TInt aEvent, TAny* aData, TInt aDataSize) = 0;
    42 protected:
    43 	IMPORT_C virtual void MAnimationDataProviderObserver_Reserved1();
    44 	IMPORT_C virtual void MAnimationDataProviderObserver_Reserved2();
    45 	};
    46 
    47 class CAnimationTicker;
    48 
    49 /** Interface used by an animator to during the rendering process.
    50 
    51 A class implementing this interface is provided to an animator by an animation.
    52 It may or may not be the animation itself.
    53 
    54 You do not need to derive an implementation from this class unless you are
    55 writing a new animation type.
    56 
    57 @publishedAll 
    58 @released
    59 @see CAnimator*/
    60 class MAnimationDrawer
    61 	{
    62 public:
    63 	/** Called by the animator when it needs to draw a new frame */
    64 	virtual void AnimatorDraw() = 0;
    65 	/** Called by the animator when it is ready to begin running. 
    66 	@param aSize The size of the smallest bounding rectangle that will be required to render the animation */
    67 	virtual void AnimatorInitialisedL(const TSize& aSize) = 0;
    68 	/** Called by the animator when it is no longer ready, usually in
    69 	response to TAnimationEvent::EAnimationDataChanged */
    70 	virtual void AnimatorResetL() = 0;
    71 	/** Called by the animator plugin loading routine to determine the type
    72 	of data for which an animator is required.
    73 	@return An 8 bit descriptor containing the data type.*/
    74 	virtual const TPtrC8 AnimatorDataType() const = 0;
    75 	/** Called by the animator to obtain an AnimatorTicker, to which it will
    76 	add itself whenever it is running.
    77 	@return A reference to a CAnimationTicker.*/
    78 	virtual CAnimationTicker& AnimatorTicker() = 0;
    79 private:
    80 	IMPORT_C virtual void MAnimationDrawer_Reserved1();
    81 	IMPORT_C virtual void MAnimationDrawer_Reserved2();
    82 	};
    83 
    84 class CAnimation;
    85 
    86 /** Interface used by an animation to report events to the client application.
    87 
    88 An animation can inform the client application of particular events through this
    89 mechanism.  Only errors are reported in this way in v9.1, but more events may
    90 be added in future.
    91 
    92 Use of this interface by the client application is optional.
    93 
    94 @publishedAll 
    95 @released
    96 @see CAnimation*/
    97 class MAnimationObserver
    98 	{
    99 public:
   100 	/** Represents generic events which can be sent to the observer. */
   101 	enum TEvent
   102 		{
   103 		/** Indicates that an error has occurred in the data provider.
   104 		For events of this type, aData is a pointer to a TInt error code. */
   105 		EDataProviderError,
   106 		/** Indicates that the animator initialised (and therefore knows it's size) */
   107 		EAnimationInitialized=0x01,
   108 		/** Any user defined animations introducing new events should use
   109 		values greater than EReserved */
   110 		EReserved=0xFFFF,
   111 		};
   112 public:
   113 	/** Receives events from an animation.
   114 	
   115 	The receiver is not required to take any action atall in response to this
   116 	call.  The receiver should not delete the animation whilst responding
   117 	to this call.
   118 	
   119 	@param aSender A reference to the animation which sent the event.
   120 	@param aEvent The event code.
   121 	@param aData An event specific data item.*/
   122 	virtual void AnimationEvent(CAnimation& aSender, TInt aEvent, TAny* aData) = 0;
   123 protected:
   124 	IMPORT_C virtual void MAnimationObserver_Reserved1();
   125 	IMPORT_C virtual void MAnimationObserver_Reserved2();
   126 	};
   127 
   128 /** Interface used for receiving animation ticks.
   129 
   130 Animators receive regular ticks, during which they perform any required processing.
   131 
   132 You do not need to derive an implementation from this class unless you are writing
   133 a new animator type.
   134 
   135 @publishedAll 
   136 @released
   137 @see CAnimator
   138 @see CAnimationTicker*/
   139 class MAnimationTickee
   140 	{
   141 public:
   142 	/** This function is called regularly by any ticker to which the tickee
   143 	has been added */
   144 	virtual void Tick() = 0;
   145 protected:
   146 	IMPORT_C virtual void MAnimationTickee_Reserved1();
   147 	IMPORT_C virtual void MAnimationTickee_Reserved2();
   148 	};
   149 
   150 /** Internal interface used by the ICL data loader to communicate with the
   151 ICL data provider. Not intended for user derivation.
   152 @internalComponent*/
   153 class MICLAnimationDataLoaderObserver
   154 	{
   155 public:
   156 	enum TDataLoaderEvent
   157 		{
   158 		EImagePartialConvert,
   159 		EImageConvertComplete,
   160 		};
   161 public:	
   162 	IMPORT_C virtual void DataLoaderEventL(TDataLoaderEvent aMessage, TInt aError) = 0;
   163 	};
   164 
   165 #endif //__ANIMATIONMIXINS_H__