examples/Graphics/WS/transparent/transparent.h

Go to the documentation of this file.
00001 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // Contains the CTransparentApplication, CTransparentDocument, CTransparentAppUi, CWait,
00015 // CEventHandler and CTransparentDocument classes.
00016 //
00017 
00018 
00019 
00023 #ifndef __TRANSPARENT_H__
00024 #define __TRANSPARENT_H__
00025 
00026 #include <coeccntx.h>
00027 
00028 #include <eikenv.h>
00029 #include <eikappui.h>
00030 #include <eikapp.h>
00031 #include <eikdoc.h>
00032 #include <eikmenup.h>
00033 #include <eikstart.h>
00034 #include <f32file.h>
00035 #include <w32std.h>
00036 #include <e32std.h>
00037 #include <eikon.hrh>
00038 
00039 #include <transparent.rsg>
00040 #include "transparent.hrh"
00041 
00042 _LIT(KEventButton1Pressed, "Event received for mouse button 1 being pressed");
00043 _LIT(KEventButton2Pressed, "Event received for press of middle button of a 3 button mouse");
00044 _LIT(KEventButton3Pressed, "Event received for last mouse button press");
00045 
00046 const TInt KDelay=1000000;
00047 class CEventHandler;
00048 class CTransparentAppUi;
00049 
00054 class CTransparentApplication : public CEikApplication
00055         {
00056 private:
00057         CApaDocument* CreateDocumentL();
00058         TUid AppDllUid() const;
00059         };
00060 
00064 class CTransparentUtil : public CCoeControl
00065         {
00066 public:
00067         static CTransparentUtil* NewL();
00068         static TBool Flag();
00069         CTransparentUtil();
00070         ~CTransparentUtil();
00071         void ConstructL();
00072 
00073         void ClearWindow(RWsSession& aSession, RWindow& aWindow, CWindowGc* aGc, TRgb aColor);
00074         void DrawWindow(RWindow& aWindow, TRgb aColor1, TRgb aColor2, TRect aRect, const TDesC& aText);
00075         void DrawWindowRegion(RWindow& aWindow, TRgb aColor1, TRgb aColor2,TRect aChopRect, TRect aRect, const TDesC& aText, const TPoint& aPoint);
00076         
00077         void TransparencyVarianceL();
00078         void TransparentRegionL();
00079 
00080         TBool DoChangeTransparencyL();
00081         TBool DoSetTransparentRegion();
00082 
00083 private:
00084         CPeriodic* iPeriodicObject;
00085         CEventHandler* iEventHandler;
00086         RWindowGroup iGroup;
00087         RWindow iBackgndWindow;
00088         RWindow iForegndWindowTrans;
00089 
00090         RWindow iFgndWinTransRegion;
00091         RWsSession iWs;
00092         CWsScreenDevice* iScr;
00093         CWindowGc* iGc;
00094 
00095         TSize iSize;
00096         TInt iAlphaValue;
00097         TInt iXOffset;
00098         TInt iYOffset;
00099         CFbsBitmapDevice* iBitmapDevice;
00100         CFbsBitGc* iBitmapGc;
00101         TInt iPos;
00102         TInt iColor;
00103         TBool iBoolVisible; 
00104 public:
00105         TRegionFix<2> iRegion;
00106         };
00107 
00111 class CTransparentAppUi : public CEikAppUi
00112         {
00113 public:
00114         void ConstructL();
00115         ~CTransparentAppUi();
00116 
00117 private:
00118         void HandleCommandL(TInt aCommand);
00119 
00120 private:
00121         CTransparentUtil* iUtil;
00122         };
00123 
00127 class CTransparentDocument : public CEikDocument
00128         {
00129 public:
00130         static CTransparentDocument* NewL(CEikApplication& aApp);
00131         CTransparentDocument(CEikApplication& aApp);
00132         void ConstructL();
00133 private:
00134         CEikAppUi* CreateAppUiL();
00135         };
00136 
00140 class CEventHandler: public CActive
00141         {
00142     public:
00143         static CEventHandler* NewL(RWsSession& aWs);
00144         virtual ~CEventHandler();
00145         void HandlePointerEvent(TPointerEvent& aPointerEvent);
00146         void InfoMessage(const TDesC& aMsg);
00147         void IssueRequest();
00148     private:
00149         CEventHandler(RWsSession& aWs);
00150         void ConstructL();
00151         void RunL();
00152         void DoCancel();
00153 
00154     private:
00155         TWsEvent iWsEvent;
00156         RWsSession& iWs;
00157         };
00158 #endif // __TRANSPARENT_H__
00159 

Generated by  doxygen 1.6.2