examples/Graphics/WS/PtBuffer/Base.h

00001 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // License: "Symbian Foundation License v1.0" to Symbian Foundation
00004 // members and "Symbian Foundation End User License Agreement v1.0"
00005 // to non-members at the URL
00006 // "http://www.symbianfoundation.org/legal/licencesv10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 
00017 #if !defined(__WINORD_H__)
00018 #define __WINORD_H__
00019 
00020 // Forward declarations
00021 class CWsRedrawer;
00022 class CWindow;
00023 
00024 
00026 //                                              Declaration of CWsClient
00028 
00029 class CWsClient : public CActive
00030         {
00031 public:
00032         void ConstructL();
00033         // destruct
00034         ~CWsClient();
00035         // main window
00036         virtual void ConstructMainWindowL();
00037         // terminate cleanly
00038         void Exit();
00039         // active object protocol
00040         void IssueRequest(); // request an event
00041         void DoCancel(); // cancel the request
00042         virtual void RunL() = 0; // handle completed request
00043         virtual void HandleKeyEventL (TKeyEvent& aKeyEvent) = 0;
00044 protected:
00045         //construct
00046         CWsClient();
00047         CWsScreenDevice* iScreen;
00048         CWsRedrawer* iRedrawer;
00049         RWsSession iWs;
00050         TWsEvent iWsEvent;
00051 private:
00052         RWindowGroup iGroup;
00053         CWindowGc* iGc;
00054         friend class CWsRedrawer; // needs to get at session
00055         friend class CWindow; // needs to get at session
00056         };
00057 
00058 
00059 
00061 //                                              CWsRedrawer declaration
00063 
00064 class CWsRedrawer : public CActive
00065         {
00066 public:
00067         // construct/destruct
00068         CWsRedrawer();
00069         void ConstructL(CWsClient* aClient);
00070         ~CWsRedrawer();
00071         // drawing
00072         void IssueRequest();
00073         void DoCancel();
00074         void RunL();
00075 protected:
00076                 CWsClient* iClient;
00077         };
00078 
00079 
00081 //                                                      CWindow declaration
00083 
00084 class CWindow : public CBase
00085         {
00086 protected:
00087         RWindow iWindow; // window server window
00088         TRect iRect; // window's extent
00089 public:
00090         enum {KPointerMoveBufferSize=32};
00091         CWindow(CWsClient* aClient);
00092         void ConstructL (const TRect& aRect, const TRgb& aColor, CWindow* aParent=0);
00093         ~CWindow();
00094         // access
00095         RWindow& Window(); // our own window
00096         CWindowGc* SystemGc(); // system graphics context
00097         CWsScreenDevice* Screen();
00098         // drawing
00099         virtual void Draw(const TRect& aRect) = 0;
00100         virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0;
00101         virtual void HandlePointerMoveBufferReady () = 0;
00102 private:
00103         CWsClient* iClient; // client including session and group
00104         };
00105 
00106 
00107 #endif

Generated by  doxygen 1.6.2