brandingserver/BSClient/bsprocessstarter.h
changeset 31 9dbc70490d9a
equal deleted inserted replaced
30:1fa9b890f29c 31:9dbc70490d9a
       
     1 /*
       
     2 * Copyright (c) 2009 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 the License "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:  bsprocessstarter.h
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __PROCESSSTARTER_H__
       
    19 #define __PROCESSSTARTER_H__
       
    20 
       
    21 #include <e32std.h>
       
    22 class TProcessStartupParam;
       
    23 
       
    24 
       
    25 
       
    26 /**
       
    27  * Generic process starter.
       
    28  */
       
    29 class BSProcessStarter
       
    30     {
       
    31     public:     // New methods
       
    32 
       
    33         static void FullExePathForClienLocation(
       
    34                         const TDesC& aExeName,
       
    35                         TFileName& aFullExePath );
       
    36 
       
    37         static TInt StartInstance(
       
    38                         const TDesC& aFullExePath,
       
    39                         const TDesC& aCommand,
       
    40                         const TArray< TProcessStartupParam >* aParams );
       
    41 
       
    42         static TInt ConnectToServer(
       
    43                         const TDesC& aFullExePath,
       
    44                         const TDesC& aCommand,
       
    45                         const TArray< TProcessStartupParam >* aParams,
       
    46                         RSessionBase& aSessionToConnect,
       
    47                         const TDesC& aServerName,
       
    48                         const TVersion& aClientVersion,
       
    49                         TInt aAsyncMessageSlots );
       
    50 
       
    51 
       
    52 
       
    53     private:    // Helpers
       
    54         static TInt DoStartInstance(
       
    55                         const TDesC& aFullExePath,
       
    56                         const TDesC& aCommand,
       
    57                         const TArray< TProcessStartupParam >* aParams );
       
    58 
       
    59         static TInt ApplyParameters(
       
    60                         const TArray< TProcessStartupParam >* aParams,
       
    61                         RProcess& aProcess );
       
    62 
       
    63     };
       
    64 
       
    65 
       
    66 
       
    67 
       
    68 /**
       
    69  * Generic process startup parameters.
       
    70  */
       
    71 class TProcessStartupParam
       
    72     {
       
    73     public:
       
    74 
       
    75         TProcessStartupParam();
       
    76         void Set( TInt aSlot, const RHandleBase& aHandle );
       
    77         void Set( TInt aSlot, const RSubSessionBase& aSubSession );
       
    78         void Set( TInt aSlot, const TDesC16& aDes );
       
    79         void Set( TInt aSlot, const TDesC8& aDes );
       
    80         void Set( TInt aSlot, TInt aInt );
       
    81         TInt ApplyParam( RProcess& aProcess ) const;
       
    82 
       
    83 
       
    84 
       
    85     private: //data
       
    86 
       
    87         enum TParamType{ EUnknown, EHandle, ESubSession,
       
    88                          EDes16, EDes8, EInt };
       
    89 
       
    90         TParamType iType;
       
    91         TInt iSlot;
       
    92         const RHandleBase* iHandle;
       
    93         const RSubSessionBase* iSubSession;
       
    94         TPtrC16 iDes16;
       
    95         TPtrC8 iDes8;
       
    96         TInt iInt;
       
    97     };
       
    98 
       
    99 
       
   100 #endif      //  __PROCESSSTARTER_H__
       
   101 
       
   102 
       
   103 //END OF FILE
       
   104 
       
   105