windowing/windowserver/inc/Graphics/wsgraphicdrawerinternal.h
branchRCL_3
changeset 26 15986eb6c500
equal deleted inserted replaced
19:ac96196b945c 26:15986eb6c500
       
     1 // Copyright (c) 1994-2010 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 #ifndef GRAPHICDRAWER_INTERNAL_H
       
    17 #define GRAPHICDRAWER_INTERNAL_H
       
    18 
       
    19 class MWsAnimationScheduler: public MWsObjectProvider
       
    20 /** A system mechanism for customising the animation timer to a particular hardware variant or to a
       
    21 	particular external compositor e.g. an out-of-scene transition engine.
       
    22 	The default animation scheduler in WSERV does not understand device-dependant parameters e.g.
       
    23 	screen refresh rates
       
    24 	@internalComponent
       
    25 	@released
       
    26 */	{
       
    27 public:
       
    28 	/** Called to schedule an animation event for a screen to occur not before some point
       
    29 	A screen may be scheduled to animate several times without actually receiving an animation event from the scheduler
       
    30 	If the scheduler cannot honour the request e.g. device constraints, it ignores the request.
       
    31 	@param aScreen the screen to recieve the event
       
    32 	@param aWhen the point in time the event need not occur before
       
    33 	*/
       
    34 	virtual void ScheduleAnimation(MWsScreen& aScreen,const TTime& aWhen) = 0;
       
    35 	/** Called if a screen determines that it no longer needs to schedule any animation
       
    36 	@param aScreen the screen not needing to receive any animation events
       
    37 	*/
       
    38 	virtual void UnscheduleAnimation(MWsScreen& aScreen) = 0;
       
    39 	/** Called to schedule the redrawing of all screens containing this graphic.
       
    40 	The redrawing of affected screens can be deferred by the scheduler.
       
    41 	@param aId the ID of the graphic to be redrawn.  The graphic itself need not exist
       
    42 		(e.g. it has just been deleted, hence the need to redraw all potentially affected screens). */
       
    43 	virtual void Invalidate(const TGraphicDrawerId& aId) = 0;
       
    44 	/** Called when the Window Server receives a TRawEvent::EInactive  event, to signal power-saving */
       
    45 	virtual void OnInactive() = 0;
       
    46 	/** Called when the Window Server receives a TRawEvent::EActive event, to signal screen back on */
       
    47 	virtual void OnActive() = 0;
       
    48 
       
    49 	/** Called to schedule a redraw for a screen which is out of date
       
    50 	A screen may be scheduled to redraw several times without actually receiving aredraw event from the scheduler
       
    51 	If this request is ignored then the screen will be draw incorrectly untill a such a request is not ignored.
       
    52 	@param aScreen the screen to recieve the event
       
    53 	@param aWhen the point in time the event need not occur before
       
    54 	*/
       
    55 	virtual void ScheduleRedraw(MWsScreen& aScreen,const TTime& aWhen) = 0;
       
    56 	/** Called to force a previously scheduled redraw for a screen to happen immediately.
       
    57 	Used when we are about to loose our ability to perform the redraw correctly.
       
    58 	@param aScreen the screen to recieve the event
       
    59 	*/
       
    60 	virtual void DoRedrawNow(MWsScreen& aScreen) = 0;
       
    61 	
       
    62 	/** Interface to be implemented by callers of the asynchronous overload of 
       
    63 	DoRedrawNow, which takes a reference to this interface as argument to be able 
       
    64 	to give a callback once the screen update has been completed.
       
    65 	*/
       
    66 	class MScreenUpdateObserver 
       
    67 		{
       
    68 	public:
       
    69 		/** Callback when an asynchronous DoRedrawNow has been completed. */
       
    70 		virtual void ScreenUpdateComplete(TInt aResult) = 0;
       
    71 		};
       
    72 	
       
    73 	/** Called to force a previously scheduled redraw for a screen to happen immediately. 
       
    74 	@param aScreen the screen to recieve the event
       
    75 	@param aObserver reference which will receive a notification when the screen has been updated
       
    76 	*/
       
    77 	virtual void DoRedrawNow(MWsScreen& aScreen, MScreenUpdateObserver& aObserver) = 0;
       
    78 	
       
    79 	/** Callback to use if aObserver gets deleted before screen update takes place. */
       
    80 	virtual void ClearScreenUpdateObserver(const MScreenUpdateObserver& aObserver) = 0;
       
    81 
       
    82 protected:
       
    83 	IMPORT_C void Animate(MWsScreen& aScreen);
       
    84 	IMPORT_C void Animate(MWsScreen& aScreen, TRequestStatus* aFinished);
       
    85 	IMPORT_C void Redraw(MWsScreen& aScreen);
       
    86 	IMPORT_C TBool RedrawInvalid(MWsScreen& aScreen,const TArray<TGraphicDrawerId>& aInvalid);
       
    87 	};
       
    88 	
       
    89 #endif