multimediacommsengine/tsrc/testdriver/testclient/watcher/src/CTcAppLauncher.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 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:  See class definition below.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CTCAPPLAUNCHER_H__
       
    19 #define __CTCAPPLAUNCHER_H__
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 //  CLASS DEFINITION
       
    25 /**
       
    26  * CTcAppLauncher is used to relaunch terminated applications.
       
    27  * It is also able to dismiss any error note dialogs from the UI.
       
    28  */
       
    29 class CTcAppLauncher
       
    30     : public CActive
       
    31     {
       
    32     public: // Constructors and destructor
       
    33 
       
    34 		/**
       
    35 		 * Static constructor. Leaves pointer to cleanup stack.
       
    36 		 *
       
    37 		 * @param aAppName Full application dll name - for relaunching.
       
    38 		 * @param aDismissDialog ETrue if there is an error dialog that should
       
    39 		 *						 be dismissed.
       
    40 		 * @param aOwner Reference to the owner array.
       
    41 		 * @return An initialised instance of this class.
       
    42 		 */
       
    43 		static CTcAppLauncher* NewLC( const TDesC& aAppName,
       
    44 									  TBool aDismissDialog,
       
    45 									  CArrayPtr< CTcAppLauncher >& aOwner );
       
    46 
       
    47 		/// Destructor
       
    48 		~CTcAppLauncher();
       
    49 
       
    50     private: // Constructors
       
    51 
       
    52 		/**
       
    53 		 * Constructor.
       
    54 		 *
       
    55 		 * @param aAppName Full application dll name - for relaunching.
       
    56 		 * @param aDismissDialog ETrue if there is an error dialog that should
       
    57 		 *						 be dismissed.
       
    58 		 * @param aOwner Reference to the owner array.
       
    59 		 */
       
    60         CTcAppLauncher( const TDesC& aAppName,
       
    61 					    TBool aDismissDialog,
       
    62 						CArrayPtr< CTcAppLauncher >& aOwner );
       
    63 
       
    64 		/// Default constructor. Not implemented.
       
    65 		CTcAppLauncher();
       
    66 
       
    67 		/// 2nd phase constructor.
       
    68         void ConstructL();
       
    69 
       
    70 	protected: // from CActive
       
    71 
       
    72 		void DoCancel();
       
    73 		void RunL();
       
    74 
       
    75 	private: // Data
       
    76 
       
    77 		/// Launch timer. Owned.
       
    78 		RTimer iTimer;
       
    79 
       
    80 		/// Client application name and path. Owned.
       
    81 		TFileName iAppName;
       
    82 
       
    83 		/// Reference to the owner array.
       
    84 		CArrayPtr< CTcAppLauncher >& iOwner;
       
    85 
       
    86 		/// ETrue if there is an error dialog that should be dismissed.
       
    87 		TBool iDismissDialog;
       
    88 
       
    89     };
       
    90 
       
    91 #endif // __CTCAPPLAUNCHER_H__