00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #if !defined(__WSBACKED_H__)
00019 #define __WSBACKED_H__
00020
00021
00022 class CWsRedrawer;
00023 class CWindow;
00024 class CBackedUpWindow;
00025
00027
00029
00030 class CWsClient : public CActive
00031 {
00032 protected:
00033
00034 CWsClient();
00035 CWsScreenDevice* iScreen;
00036 CWsRedrawer* iRedrawer;
00037 RWsSession iWs;
00038 TWsEvent iWsEvent;
00039 public:
00040 void ConstructL();
00041
00042 ~CWsClient();
00043
00044 virtual void ConstructMainWindowL();
00045
00046 void Exit();
00047
00048 void IssueRequest();
00049 void DoCancel();
00050 virtual void RunL() = 0;
00051 virtual void HandleKeyEventL (TKeyEvent& aKeyEvent) = 0;
00052 private:
00053 RWindowGroup iGroup;
00054 CWindowGc* iGc;
00055 friend class CWsRedrawer;
00056 friend class CWindow;
00057 friend class CBackedUpWindow;
00058 };
00059
00060
00061
00063
00065
00066 class CWsRedrawer : public CActive
00067 {
00068 public:
00069
00070 CWsRedrawer();
00071 void ConstructL(CWsClient* aClient);
00072 ~CWsRedrawer();
00073
00074 void IssueRequest();
00075 void DoCancel();
00076 void RunL();
00077 protected:
00078 CWsClient* iClient;
00079 };
00080
00081
00083
00085
00086 class CWindow : public CBase
00087 {
00088 public:
00089 enum {KPointerMoveBufferSize=32};
00090 CWindow(CWsClient* aClient);
00091 void ConstructL (const TRect& aRect, const TRgb& aColor, CBackedUpWindow* aParent=0);
00092 ~CWindow();
00093
00094 RWindow& Window();
00095 CWindowGc* SystemGc();
00096 CWsScreenDevice* Screen();
00097 CFont* Font();
00098
00099 virtual void Draw(const TRect& aRect) = 0;
00100 virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0;
00101 virtual void HandlePointerMoveBufferReady () = 0;
00102 protected:
00103 RWindow iWindow;
00104 TRect iRect;
00105 private:
00106 CWsClient* iClient;
00107 CFont* iFont;
00108 };
00109
00110 class CBackedUpWindow : public CBase
00111 {
00112 public:
00113 enum {KPointerMoveBufferSize=32};
00114 CBackedUpWindow(CWsClient* aClient);
00115 void ConstructL (const TRect& aRect, CWindow* aParent=0);
00116 ~CBackedUpWindow();
00117
00118 RBackedUpWindow& Window();
00119 CWindowGc* SystemGc();
00120 CWsScreenDevice* Screen();
00121 CFont* Font();
00122
00123 virtual void Draw(const TRect& aRect) = 0;
00124 virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0;
00125 virtual void HandlePointerMoveBufferReady () = 0;
00126 protected:
00127 RBackedUpWindow iWindow;
00128 TRect iRect;
00129 private:
00130 CWsClient* iClient;
00131 CFont* iFont;
00132 };
00133
00134 #endif