commsfwsupport/commselements/StartServer/include/StartProcess.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2003-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 // THIS API IS INTERNAL TO NETWORKING AND IS SUBJECT TO CHANGE AND NOT FOR EXTERNAL USE
       
    15 // RStartProcess Client side header
       
    16 // Declares the R class to start a process,
       
    17 // the class covers EPOC platform & emulator diferences
       
    18 // 
       
    19 //
       
    20 
       
    21 /**
       
    22  @file 
       
    23  @internalTechnology
       
    24 */
       
    25 
       
    26 #ifndef __CS_STARTSERVER_H__
       
    27 #define __CS_STARTSERVER_H__
       
    28 
       
    29 #include <e32base.h>
       
    30 
       
    31 const TUint KMaxFileNameLength = 55;
       
    32 
       
    33 /**
       
    34  Starts a process and synchronise with it.
       
    35  
       
    36  The process must support synchronisation via Randezvous
       
    37  @internalTechnology
       
    38 **/
       
    39 class RStartProcess
       
    40 	{
       
    41 public:
       
    42    	IMPORT_C TInt Start(const TDesC& aName, TRequestStatus& aStatus);
       
    43    	IMPORT_C TInt Start(const TDesC& aName);
       
    44    	IMPORT_C void Cancel();
       
    45    	TDesC& Name();
       
    46    	TInt ErrorCode() const;
       
    47 
       
    48 private:
       
    49    	TBufC<KMaxFileNameLength> iName;
       
    50       TInt iErrorCode;
       
    51 
       
    52 
       
    53    	RProcess iProcess;
       
    54 
       
    55 private:
       
    56    	TInt StartProcess();
       
    57 
       
    58 
       
    59    	static TInt StartProcessThreadFn(TAny* aStartProcess);
       
    60    	TInt WaitForCompletion();
       
    61 	};
       
    62 
       
    63 
       
    64 inline TInt RStartProcess::ErrorCode() const
       
    65    {
       
    66       return iErrorCode;
       
    67    }
       
    68 
       
    69 inline TDesC& RStartProcess::Name()
       
    70 	{
       
    71    	return iName;
       
    72 	}
       
    73 
       
    74 #endif
       
    75