00001 // Copyright (c) 2005-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 // 00015 00016 #if !defined(__SimpleWindowServerApp_H__) 00017 #define __SimpleWindowServerApp_H__ 00018 00019 // Forward declarations 00020 class CWsRedrawer; 00021 class CWindow; 00022 00023 00027 00028 // Base class for all windows 00029 00030 class CWsClient : public CActive 00031 { 00032 public: 00033 void ConstructL(); 00034 // destruct 00035 ~CWsClient(); 00036 // main window 00037 virtual void ConstructMainWindowL(); 00038 // terminate cleanly 00039 void Exit(); 00040 // active object protocol 00041 void IssueRequest(); // request an event 00042 void DoCancel(); // cancel the request 00043 virtual void RunL() = 0; // handle completed request 00044 virtual void HandleKeyEventL (TKeyEvent& aKeyEvent) = 0; 00045 protected: 00046 //construct 00047 CWsClient(); 00048 CWsScreenDevice* iScreen; 00049 CWsRedrawer* iRedrawer; 00050 RWsSession iWs; 00051 TWsEvent iWsEvent; 00052 private: 00053 RWindowGroup iGroup; 00054 CWindowGc* iGc; 00055 friend class CWsRedrawer; // needs to get at session 00056 friend class CWindow; // needs to get at session 00057 }; 00058 00059 00060 00064 00065 class CWsRedrawer : public CActive 00066 { 00067 public: 00068 // construct/destruct 00069 CWsRedrawer(); 00070 void ConstructL(CWsClient* aClient); 00071 ~CWsRedrawer(); 00072 // drawing 00073 void IssueRequest(); 00074 void DoCancel(); 00075 void RunL(); 00076 protected: 00077 CWsClient* iClient; 00078 }; 00079 00080 00084 00085 class CWindow : public CBase 00086 { 00087 public: 00088 CWindow(CWsClient* aClient); 00089 void ConstructL (const TRect& aRect, CWindow* aParent=0); 00090 ~CWindow(); 00091 // access 00092 RWindow& Window(); // our own window 00093 CWindowGc* SystemGc(); // system graphics context 00094 // drawing 00095 virtual void Draw(const TRect& aRect) = 0; 00096 virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0; 00097 protected: 00098 RWindow iWindow; // window server window 00099 TRect iRect; // rectangle re owning window 00100 private: 00101 CWsClient* iClient; // client including session and group 00102 }; 00103 00104 #endif
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.