startupservices/SplashScreen/inc/SplashScreen.h
changeset 0 2e3d3ce01487
child 29 6a787171e1de
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Client Window class for Splash Screen displayer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SPLASHSCREEN_H
       
    20 #define SPLASHSCREEN_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32property.h>
       
    24 
       
    25 // CLASS DECLARATION
       
    26 
       
    27 /**
       
    28 *  Forward declarations
       
    29 *
       
    30 *  @lib SplashScreen.lib
       
    31 *  @since Series 60 1.0
       
    32 */
       
    33 class CWsRedrawer;
       
    34 class CWindow;
       
    35 
       
    36 class CMainWindow;
       
    37 class CCdlEngineRef;
       
    38 class CTimeout : public CTimer
       
    39 	{
       
    40 public:
       
    41 	CTimeout();
       
    42 	void ConstructL(CMainWindow* aWindow);
       
    43 	void RunL();
       
    44 	void SetMainWindow(CMainWindow* aWindow);
       
    45 //protected:
       
    46 //	TCallBack iCallBack;
       
    47 private:
       
    48 	CMainWindow* iWindow;
       
    49 	};
       
    50 
       
    51 /**
       
    52 *  Base class for all windows
       
    53 *
       
    54 *  @lib SplashScreen.lib
       
    55 *  @since Series 60 1.0
       
    56 */
       
    57 class CWsClient : public CActive
       
    58 	{
       
    59 	protected:
       
    60 		//construct
       
    61 		CWsClient();
       
    62 		CWsScreenDevice* iScreen;
       
    63 		CWsRedrawer* iRedrawer;
       
    64 		RWsSession iWs;
       
    65 		TWsEvent iWsEvent;
       
    66 		CCdlEngineRef* iCdlEngRef;
       
    67 	public:
       
    68 		void ConstructL();
       
    69 		// destruct
       
    70 		~CWsClient();
       
    71 		// main window
       
    72 		virtual void ConstructMainWindowL();
       
    73 		// terminate cleanly
       
    74 		void Exit();
       
    75 		// active object protocol
       
    76 		void IssueRequest(); // request an event
       
    77 		void DoCancel(); // cancel the request
       
    78 		virtual void RunL() = 0; // handle completed request
       
    79 		virtual void HandleKeyEventL (TKeyEvent& aKeyEvent) = 0;
       
    80 
       
    81 		RWindowGroup Group() {return iGroup;};
       
    82 
       
    83         TInt            iPSRemoveSplashState;
       
    84 
       
    85     protected:
       
    86         TInt iLastScreenMode;
       
    87 
       
    88     private:
       
    89 		RWindowGroup    iGroup;
       
    90 		CWindowGc*      iGc;
       
    91 		friend class    CWsRedrawer; // needs to get at session
       
    92 		friend class    CWindow; // needs to get at session
       
    93         RProperty       iProperty;
       
    94 
       
    95 	};
       
    96 
       
    97 
       
    98 /**
       
    99 *  CWsRedrawer declaration
       
   100 *
       
   101 *  @lib SplashScreen.lib
       
   102 *  @since Series 60 1.0
       
   103 */
       
   104 class CWsRedrawer : public CActive
       
   105 	{
       
   106 	public:
       
   107 		// construct/destruct
       
   108 		CWsRedrawer();
       
   109 		void ConstructL(CWsClient* aClient);
       
   110 		~CWsRedrawer();
       
   111 		// drawing
       
   112 		void IssueRequest();
       
   113 		void DoCancel();
       
   114 		void RunL();
       
   115 	protected:
       
   116 		CWsClient* iClient;
       
   117 	private:
       
   118 		//	CWsClient* iClient;
       
   119 	};
       
   120 
       
   121 /**
       
   122 *  CWindow declaration
       
   123 *
       
   124 *  @lib SplashScreen.lib
       
   125 *  @since Series 60 1.0
       
   126 */
       
   127 class CWindow : public CBase
       
   128 	{
       
   129 	protected:
       
   130 		RWindow iWindow; // window server window
       
   131 		TRect iRect; // rectangle re owning window
       
   132 	public:
       
   133 		CWindow(CWsClient* aClient);
       
   134 		void ConstructL (const TRect& aRect, CWindow* aParent=0);
       
   135 		~CWindow();
       
   136 		// access
       
   137 		RWindow& Window(); // our own window
       
   138 		CWindowGc* SystemGc(); // system graphics context
       
   139 		// drawing
       
   140 		virtual void Draw(const TRect& aRect) = 0;
       
   141 		virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0;
       
   142 
       
   143 		CWsClient* Client() {return iClient;};
       
   144 	private:
       
   145 		CWsClient* iClient; // client including session and group
       
   146 	};
       
   147 
       
   148 /**
       
   149 *  Derived window classes
       
   150 *
       
   151 *  @lib SplashScreen.lib
       
   152 *  @since Series 60 1.0
       
   153 */
       
   154 class CMainWindow : public CWindow
       
   155 	{
       
   156 	public:
       
   157 		CMainWindow (CWsClient* aClient);
       
   158 		~CMainWindow ();
       
   159 		void Draw (const TRect& aRect);
       
   160 		void HandlePointerEvent (TPointerEvent& aPointerEvent);
       
   161 		void ConstructL (const TRect& aRect, CWindow* aParent=0);
       
   162 	private:
       
   163 		CFbsBitmap *iBitmap;
       
   164 		
       
   165 	};
       
   166 
       
   167 /**
       
   168 *  Derived client class
       
   169 *
       
   170 *  @lib SplashScreen.lib
       
   171 *  @since Series 60 1.0
       
   172 */
       
   173 class CSplashWsClient : public CWsClient
       
   174 	{
       
   175 	public:
       
   176 		// constructor
       
   177 		CSplashWsClient ();
       
   178 		void ConstructMainWindowL();
       
   179 		~CSplashWsClient ();
       
   180 		void RunL ();
       
   181 		void HandleKeyEventL (TKeyEvent& aKeyEvent);
       
   182 	private:
       
   183 		CMainWindow* iMainWindow;	// main window
       
   184 		CTimeout* iTimeout;			// auto dismiss timer
       
   185 	};
       
   186 
       
   187 #endif //SPLASHSCREEN_H
       
   188