windowing/windowserver/tlisten/listener.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2006-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  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code
       
    20 */
       
    21 
       
    22 #ifndef __LISTENER_H__
       
    23 #define __LISTENER_H__
       
    24 
       
    25 #include <bitstd.h>
       
    26 #include "Graphics/WSGRAPHICDRAWER.H"
       
    27 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
       
    28 
       
    29 class CFbsBitmap;
       
    30 class CFbsBitmapDevice;
       
    31 class CFbsBitGc;
       
    32 class MWsGraphicDrawerContext;
       
    33 #ifdef __WINS__
       
    34 class CDebugOsbWin;
       
    35 #endif
       
    36 
       
    37 const TInt KNotifyRemoveSelf = 0;
       
    38 const TInt KNotifyRemoveThenAddSelf = 1;
       
    39 const TInt KNotifyAddSelf = 2;
       
    40 const TInt KNotifyRemoveOther = 3;
       
    41 const TInt KNotifyRemoveThenAddOther = 4;
       
    42 const TInt KNotifyAddOther = 5;
       
    43 const TInt KNotifyRemoveSelfAndOther = 6;
       
    44 const TInt KNotifyDoNothing = 7;
       
    45 const TInt KNotifyDisable = 8;
       
    46 
       
    47 NONSHARABLE_CLASS(CWsEventListener): public CWsGraphicDrawer, public MWsEventHandler
       
    48 	{
       
    49 public:
       
    50 	enum {EImplUid = 0x10281fb7};	
       
    51 		
       
    52 public:		
       
    53 	static CWsEventListener* NewL();
       
    54 	virtual ~CWsEventListener();
       
    55 
       
    56 	// override CWsGraphicDrawer
       
    57 	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
       
    58 	virtual void HandleMessage(const TDesC8& aData);
       
    59 	// override MWsEventHandler
       
    60 	virtual void DoHandleEvent(const TWservCrEvent& aEvent);
       
    61 private:
       
    62 	// override CWsGraphicDrawer
       
    63 	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
       
    64 
       
    65 	void OnScreenSizeModeChanged(TInt aMode);
       
    66 	void OnWindowVisibilityChanged(const RRegion* aRegion);
       
    67 	TRgb CurrentColor();
       
    68 	void SendInfo();
       
    69 	void OnWindowGroupChanged(TInt aScreenNumber, TInt aWindowGroupId);
       
    70 private:
       
    71 	MWsGraphicDrawerContext* iDrawerContext;
       
    72 	CFbsBitmap* iBit;
       
    73 	CFbsBitmapDevice* iDev;
       
    74 	CFbsBitGc* iGc;
       
    75 #ifdef __WINS__	
       
    76 	CDebugOsbWin* iWin;
       
    77 	TBool iDisableWin;	
       
    78 #endif
       
    79 	TBool iEnabled;
       
    80 	TBool iReady;
       
    81 	TSize iSize;
       
    82 	TDisplayMode iDisplayMode;
       
    83 	MWsScreen* iScreen;
       
    84 	TInt iColorIdx;
       
    85 	TInt iSaveNumRect;
       
    86 	TRect iSaveRect;
       
    87 	TInt iWindowGroupId;	
       
    88 	};
       
    89 
       
    90 NONSHARABLE_CLASS(CWsEventNotifier): public CWsGraphicDrawer, public MWsEventHandler
       
    91 	{
       
    92 public:
       
    93 	enum {	EImplUid1 = 0x102754c4,
       
    94 			EImplUid2 = 0x102754c6};
       
    95 		
       
    96 public:		
       
    97 	static CWsEventNotifier* NewL();
       
    98 	virtual ~CWsEventNotifier();
       
    99 
       
   100 	// override CWsGraphicDrawer
       
   101 	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
       
   102 	virtual void HandleMessage(const TDesC8& aData);
       
   103 	// override MWsEventHandler
       
   104 	virtual void DoHandleEvent(const TWservCrEvent& aEvent);
       
   105 private:
       
   106 	// override CWsGraphicDrawer
       
   107 	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
       
   108 	void TestGraphicDrawerEnvironment();
       
   109 private:
       
   110 	TBool iReady;
       
   111 	TInt iHandleMethod;
       
   112 	TGraphicDrawerId iAnotherPluginID;
       
   113 	CWsGraphicDrawer* iAnotherPlugin;
       
   114 	TBool iTestGraphicDrawerEnvironment;
       
   115 	MWsGraphicDrawerEnvironment* iEnv;
       
   116 	};
       
   117 
       
   118 #endif