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