messagingfw/msgtest/targetautomation/TechviewStart/Starter.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15     
       
    16 #if !defined (__STARTER_H__)
       
    17 #define __STARTER_H__
       
    18 
       
    19 #include <eiksrvc.h>
       
    20 #include <apgcli.h>
       
    21 #include <bautils.h>
       
    22 
       
    23 class CThreadWatcher;
       
    24 class CStarter: public CActive
       
    25 	{
       
    26 	public:
       
    27 		static CStarter* NewL();
       
    28 		~CStarter();
       
    29 		void DoCancel();
       
    30 		void RunL();
       
    31 		void Start();
       
    32 		void Done(TBool aSuccess);
       
    33 		void RestartMonitoredThreadL(TInt appType, TThreadId& aThreadId, TDesC& aExeFileName, TUint32 aAppUid, TBool aViewless);
       
    34 	protected: //from CActive
       
    35 	 	virtual TInt RunError(TInt aError);
       
    36 	private:
       
    37 		void ConstructL();
       
    38 		CStarter();
       
    39 	private:
       
    40 		void StartSplashScreenL();
       
    41 		void Connect();
       
    42 		void LaunchNextStartupAppL();
       
    43 		void LaunchNextExtrasL();
       
    44 		void RequestNotify();
       
    45 	private:
       
    46 
       
    47 		enum
       
    48 			{
       
    49 			ESplashScreen,
       
    50 			EStarting,
       
    51 			EConnected,
       
    52 			EStart,
       
    53 			EWait,
       
    54 			EStartExtras,
       
    55 			ESplashScreenEnd
       
    56 			} iStage;
       
    57 
       
    58 		RSemaphore iSema;
       
    59 		REikAppUiSession iAppUiSession;	// session to the appui session
       
    60 		
       
    61 		RApaLsSession iLsSess;			// session to the app arc server
       
    62 		RFs iFsSession;					// file server seesion
       
    63 		RResourceFile iResourceFile;	// resource file describing the startup 
       
    64 
       
    65 		HBufC8*	iExtrasList;		// list of the applications to be launched
       
    66 		TResourceReader iExtrasListReader;	// object encapsulation the application list
       
    67 		TInt iExtrasCount;		// count of application remaining to be launched
       
    68 		
       
    69 		HBufC8*	iStartupList;		// list of the applications to be launched
       
    70 		TResourceReader iStartupListReader;	// object encapsulation the application list
       
    71 		TInt iStartupCount;		// count of application remaining to be launched
       
    72 
       
    73 		RArray<TPtrC> iCmdLineArgs;	// Command line args to be freed at clean-up time
       
    74 
       
    75 		HBufC* iSplashExe;				// full path to the splash screen program
       
    76 
       
    77 #if defined(__WINS__)
       
    78 		RLibrary iLib;
       
    79 		RThread iSplash;
       
    80 #else
       
    81 		RProcess iSplash;
       
    82 #endif
       
    83 		TBool	iSplashStarted;			//
       
    84 		TSglQue<CThreadWatcher> *iQueHeader;	// linked list of thread watchers
       
    85 		TInt iNrSemaphore;
       
    86 		TInt iWaiting;
       
    87 		TUid iApplicationInFocus; //app in focus when startup is done
       
    88 	};
       
    89 #endif