examples/Graphics/WS/Ordinal/Base.h

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 
00017 
00018 #if !defined(__WSWINORD_H__)
00019 #define __WSWINORD_H__
00020 
00021 // Forward declarations
00022 class CWsRedrawer;
00023 class CWindow;
00024 
00025 
00027 //                                              Declaration of CWsClient
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 
00062 //                                              CWsRedrawer declaration
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 
00082 //                                                      CWindow declaration
00084 
00085 class CWindow : public CBase
00086         {
00087 public:
00088         CWindow(CWsClient* aClient);
00089         void ConstructL (const TRect& aRect, const TRgb& aColor, CWindow* aParent=0);
00090         ~CWindow();
00091         // access
00092         RWindow& Window(); // our own window
00093         CWindowGc* SystemGc(); // system graphics context
00094         CWsScreenDevice* Screen();
00095         CFont* Font();
00096         // drawing
00097         virtual void Draw(const TRect& aRect) = 0;
00098         virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0;
00099 protected:
00100         RWindow iWindow; // window server window
00101         TRect iRect; // window's extent
00102 private:
00103         CWsClient* iClient; // client including session and group
00104         CFont*  iFont;
00105         };
00106 
00107 
00108 #endif

Generated by  doxygen 1.6.2