libraries/qr3/inc/NotifierProxy.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // NotifierProxy.h
       
     2 // 
       
     3 // Copyright (c) 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 #include <e32base.h>
       
    13 #include <fshell/memoryaccess.h>
       
    14 #include <W32STD.H>
       
    15 
       
    16 class CRedrawer;
       
    17 class CLine;
       
    18 class CPanicDialogWatcher;
       
    19 
       
    20 NONSHARABLE_CLASS(CNotifierProxyServer) : public CServer2
       
    21 	{
       
    22 public:
       
    23 	CNotifierProxyServer();
       
    24 	void ConstructL();
       
    25 	~CNotifierProxyServer();
       
    26 
       
    27 	void InfoPrint(const TDesC& aText, TUint aClientId);
       
    28 	void DoWservInitiatedRedraw(const TRect& aRect);
       
    29 	RWsSession& WsSession();
       
    30 
       
    31 protected:
       
    32 	CSession2* NewSessionL(const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const;
       
    33 
       
    34 private:
       
    35 	void SetupWindowL();
       
    36 	void DisplayAndStartTimer();
       
    37 	static TInt StaticTick(TAny* aSelf);
       
    38 	void Tick();
       
    39 	void RecalculateWindow();
       
    40 	TRect BoxForLine(TInt aLineIndex);
       
    41 
       
    42 private:
       
    43 	RMemoryAccess iMemAccess;
       
    44 	TBool iProxying;
       
    45 	//RBuf iInfoPrintText;
       
    46 	CPeriodic* iPeriodic;
       
    47 	CFont* iFont;
       
    48 	RPointerArray<CLine> iText;
       
    49 	CPanicDialogWatcher* iUndertaker;
       
    50 	//
       
    51 	RWsSession iWs;
       
    52 	RWindowGroup iWg;
       
    53 	RWindow iWin;
       
    54 	CWsScreenDevice* iScreenDevice;
       
    55 	CWindowGc* iGc;
       
    56 	CRedrawer* iRedrawer;
       
    57 	};
       
    58 
       
    59 class RRealNotifier : public RNotifier
       
    60 	{
       
    61 public:
       
    62 	TInt Connect();
       
    63 	};
       
    64 
       
    65 NONSHARABLE_CLASS(CNotifierProxySession) : public CSession2
       
    66 	{
       
    67 public:
       
    68 	void ConstructL();
       
    69 
       
    70 protected:
       
    71 	void ServiceL(const RMessage2 &aMessage);
       
    72 	void Disconnect(const RMessage2 &aMessage);
       
    73 
       
    74 private:
       
    75 	CNotifierProxyServer& Server();
       
    76 	const CNotifierProxyServer& Server() const;
       
    77 
       
    78 private:
       
    79 	RRealNotifier iRealNotifier;
       
    80 	};
       
    81 
       
    82 NONSHARABLE_CLASS(CAsyncWaiter) : public CActive
       
    83 	{
       
    84 public:
       
    85 	CAsyncWaiter(RRealNotifier& aRealNotifier, const RMessage2& aMessage);
       
    86 	~CAsyncWaiter();
       
    87 	void ForwardMessageL();
       
    88 
       
    89 protected:
       
    90 	void RunL();
       
    91 	void DoCancel();
       
    92 
       
    93 private:
       
    94 	RRealNotifier& iRealNotifier;
       
    95 	const RMessage2 iMsg;
       
    96 	RBuf8 iBuf;
       
    97 	RBuf16 iWideBuf;
       
    98 	RBuf8 iResponseBuf;
       
    99 	TPtrC iTempPtrs[4];
       
   100 	};
       
   101 
       
   102 NONSHARABLE_CLASS(CRedrawer) : public CActive
       
   103 	{
       
   104 public:
       
   105 	CRedrawer(CNotifierProxyServer& aServer);
       
   106 	void Go();
       
   107 	~CRedrawer();
       
   108 
       
   109 private:
       
   110 	void RunL();
       
   111 	void DoCancel();
       
   112 
       
   113 private:
       
   114 	CNotifierProxyServer& iServer;
       
   115 	};
       
   116 
       
   117 NONSHARABLE_CLASS(CLine) : public CBase
       
   118 	{
       
   119 public:
       
   120 	CLine(const TDesC& aText, TUint aClientId);
       
   121 
       
   122 	TBuf<100> iText;
       
   123 	TUint iClientId;
       
   124 	//TTime iTimeOfPrint;
       
   125 	};
       
   126 
       
   127 NONSHARABLE_CLASS(CPanicDialogWatcher) : public CActive
       
   128 	{
       
   129 public:
       
   130 	CPanicDialogWatcher(CNotifierProxyServer& aServer);
       
   131 	void ConstructL();
       
   132 	~CPanicDialogWatcher();
       
   133 protected:
       
   134 	void RunL();
       
   135 	void DoCancel();
       
   136 
       
   137 private:
       
   138 	RUndertaker iUndertaker;
       
   139 	CNotifierProxyServer& iServer;
       
   140 	TInt iThreadHandle;
       
   141 	TFullName iTempName;
       
   142 	//TExitCategoryName iTempCategory;
       
   143 	};