windowing/windowserver/nga/SERVER/drawresource.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 #ifndef __DRAWRESOURCE_H__
       
    18 #define __DRAWRESOURCE_H__
       
    19 
       
    20 #include "OBJECT.H"
       
    21 #include <graphics/wsgraphicscontext.h>
       
    22 #include <graphics/wsdrawablesourceprovider.h>
       
    23 
       
    24 
       
    25 
       
    26 /**
       
    27 The class represents RWsDrawableSource on the server side. 
       
    28 It maintains a reference count. Drawing commands will be redirected to the resource drawing 
       
    29 interface retrieved from the graphics context.
       
    30 
       
    31 @internalComponent
       
    32 @see RWsDrawableSource
       
    33 */
       
    34 class CWsDrawableSource : public CWsObject
       
    35 	{
       
    36 public:
       
    37 	CWsDrawableSource(CWsClient *aOwner);
       
    38 	void ConstructL(const TWsClCmdCreateDrawableSource &aParams);
       
    39 	void CommandL(TInt aOpcode, const TAny *aCmdData);
       
    40 	void DrawResource(MWsGraphicsContext *aGc, const TPoint& aPos, CWindowGc::TGraphicsRotation aRotation) const;
       
    41 	void DrawResource(MWsGraphicsContext *aGc, const TRect& aRect, CWindowGc::TGraphicsRotation aRotation) const;
       
    42 	void DrawResource(MWsGraphicsContext *aGc, const TRect& aRectDest, const TRect& aRectSrc, CWindowGc::TGraphicsRotation aRotation) const;
       
    43 	void DrawResource(MWsGraphicsContext *aGc, const TRect& aRect, const TDesC8& aDes) const;
       
    44 	void CloseObject();
       
    45 	void IncRefCount();
       
    46 	void DecRefCount();
       
    47 private:
       
    48 	~CWsDrawableSource();
       
    49 private:
       
    50 	enum // Flags
       
    51 		{
       
    52 		EWsClientHandleClosed = 0x00000001 // Set if the associated RWsDrawableSource handle has been closed
       
    53 		};
       
    54 private:
       
    55 	TInt iRefCount;
       
    56 	TUint32 iFlags;
       
    57 	TAny* iDrawableSource; // to be used by plug-ins
       
    58 	MWsDrawableSourceProvider* iDrawResource; // doesn't own
       
    59 	};
       
    60 
       
    61 
       
    62 #endif