windowing/windowserver/inc/Graphics/wsdrawablesourceprovider.h
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  @publishedPartner
       
    18  @prototype
       
    19 */
       
    20 
       
    21 #ifndef __WSDRAWABLESOURCEPROVIDER_H__
       
    22 #define __WSDRAWABLESOURCEPROVIDER_H__
       
    23 
       
    24 #include <graphics/sgresource.h>
       
    25 #include <graphics/wsgraphicdrawerinterface.h>
       
    26 
       
    27 /**
       
    28 Window server evokes this interface from rendering stage plugin every time client 
       
    29 requests resource drawing operations.
       
    30 
       
    31 @publishedPartner
       
    32 @prototype
       
    33  */
       
    34 class MWsDrawableSourceProvider : public MWsObjectProvider
       
    35 	{
       
    36 public:
       
    37 	DECLARE_WS_TYPE_ID(KMWsDrawableSourceProvider)
       
    38 public:
       
    39 	/**
       
    40 	 Create a source object for future drawing of the drawable resource with the specified ID.
       
    41 	 @param aDrawableId The ID of the drawable resource.
       
    42 	 @param aSource On output, a pointer to the new source object associated with the drawable resource,
       
    43 	                which must be passed in calls to DrawResource() and CloseDrawableSource().
       
    44 	      	        After the call to CloseDrawableSource() the source object is destroyed and this pointer becomes invalid.
       
    45 	      	        The type of the source object is defined by the implementation of MWsDrawableSourceProvider.
       
    46 	 @post If successful, a new source object is created and the associated drawable resource is ready to use.
       
    47 	 @return KErrNone if successful, otherwise one of the system-wide error codes.
       
    48 	 */
       
    49 	virtual TInt CreateDrawableSource(const TSgDrawableId& aDrawableId, TAny*& aSource) = 0;
       
    50 
       
    51 	/**
       
    52 	 Destroy a source object associated with a drawable resource.
       
    53 	 @param aSource A pointer to a source object created by a previous call to CreateDrawableSource().
       
    54 	 @post Drawing of the associated drawable resource is no longer possible.
       
    55 	 @return KErrNone if successful, otherwise one of the system-wide error codes.
       
    56 	 */
       
    57 	virtual void CloseDrawableSource(TAny* aSource) = 0;
       
    58 
       
    59 	/**
       
    60 	 Draw a graphics resource.
       
    61 	 @param aSource A pointer to the source object associated with the drawable resource.
       
    62 	 @param aPos Destination position for the top-left corner of the drawable resource.
       
    63 	 @param	aRotation Rotation to be applied to the drawable resource before it is drawn.
       
    64 	 @pre A source object must have been created for the drawable resource by a previous call to CreateDrawableSource().
       
    65 	 */
       
    66 	virtual void DrawResource(const TAny* aSource, const TPoint& aPos, CWindowGc::TGraphicsRotation aRotation = CWindowGc::EGraphicsRotationNone) = 0;
       
    67 
       
    68 	/**
       
    69 	 Draw a graphics resource.
       
    70 	 @param aSource A pointer to the source object associated with the drawable resource.
       
    71 	 @param aRect Destination rectangle. The drawable resource could be scaled if its size doesn't match the destination rectangle.
       
    72 	 @param	aRotation Rotation to be applied to the drawable resource before it is drawn.
       
    73 	 @pre A source object must have been created for the drawable resource by a previous call to CreateDrawableSource().
       
    74 	 */
       
    75 	virtual void DrawResource(const TAny* aSource, const TRect& aRect, CWindowGc::TGraphicsRotation aRotation = CWindowGc::EGraphicsRotationNone) = 0;
       
    76 
       
    77 	/**
       
    78 	 Draw a graphics resource.
       
    79 	 @param aSource A pointer to the source object associated with the drawable resource.
       
    80 	 @param aRectDest Destination rectangle. The drawable resource could be scaled if its size doesn't match the destination rectangle.
       
    81 	 @param aRectSrc A rectangle defining the piece of the drawable resource to be drawn, in the co-ordinate system of the drawable resource.
       
    82 	 @param	aRotation Rotation to be applied to the drawable resource before it is drawn.
       
    83 	 @pre A source object must have been created for the drawable resource by a previous call to CreateDrawableSource().
       
    84 	 */
       
    85 	virtual void DrawResource(const TAny* aSource, const TRect& aRectDest, const TRect& aRectSrc, CWindowGc::TGraphicsRotation aRotation = CWindowGc::EGraphicsRotationNone) = 0;
       
    86 
       
    87 	/**
       
    88 	 Draw a graphics resource.
       
    89 	 @param aSource A pointer to the source object associated with the drawable resource.
       
    90 	 @param aRect Destination rectangle. The drawable resource could be scaled if its size doesn't match the destination rectangle.
       
    91 	 @param	aParam Parameters specifying how to draw the drawable resource.
       
    92 	 @pre A source object must have been created for the drawable resource by a previous call to CreateDrawableSource().
       
    93 	 */
       
    94 	virtual void DrawResource(const TAny* aSource, const TRect& aRect, const TDesC8& aParam) = 0;
       
    95 	};
       
    96 
       
    97 #endif //__WSDRAWABLESOURCEPROVIDER_H__