examples/Graphics/WS/Scroll/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 #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 public:
00087         enum {KPointerMoveBufferSize=32};
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