brandingserver/BSClient/bsprocessstarter.h
author hgs
Sun, 11 Apr 2010 15:33:49 +0530
changeset 31 9dbc70490d9a
permissions -rw-r--r--
201014
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  bsprocessstarter.h
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef __PROCESSSTARTER_H__
hgs
parents:
diff changeset
    19
#define __PROCESSSTARTER_H__
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
#include <e32std.h>
hgs
parents:
diff changeset
    22
class TProcessStartupParam;
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
/**
hgs
parents:
diff changeset
    27
 * Generic process starter.
hgs
parents:
diff changeset
    28
 */
hgs
parents:
diff changeset
    29
class BSProcessStarter
hgs
parents:
diff changeset
    30
    {
hgs
parents:
diff changeset
    31
    public:     // New methods
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
        static void FullExePathForClienLocation(
hgs
parents:
diff changeset
    34
                        const TDesC& aExeName,
hgs
parents:
diff changeset
    35
                        TFileName& aFullExePath );
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
        static TInt StartInstance(
hgs
parents:
diff changeset
    38
                        const TDesC& aFullExePath,
hgs
parents:
diff changeset
    39
                        const TDesC& aCommand,
hgs
parents:
diff changeset
    40
                        const TArray< TProcessStartupParam >* aParams );
hgs
parents:
diff changeset
    41
hgs
parents:
diff changeset
    42
        static TInt ConnectToServer(
hgs
parents:
diff changeset
    43
                        const TDesC& aFullExePath,
hgs
parents:
diff changeset
    44
                        const TDesC& aCommand,
hgs
parents:
diff changeset
    45
                        const TArray< TProcessStartupParam >* aParams,
hgs
parents:
diff changeset
    46
                        RSessionBase& aSessionToConnect,
hgs
parents:
diff changeset
    47
                        const TDesC& aServerName,
hgs
parents:
diff changeset
    48
                        const TVersion& aClientVersion,
hgs
parents:
diff changeset
    49
                        TInt aAsyncMessageSlots );
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
    private:    // Helpers
hgs
parents:
diff changeset
    54
        static TInt DoStartInstance(
hgs
parents:
diff changeset
    55
                        const TDesC& aFullExePath,
hgs
parents:
diff changeset
    56
                        const TDesC& aCommand,
hgs
parents:
diff changeset
    57
                        const TArray< TProcessStartupParam >* aParams );
hgs
parents:
diff changeset
    58
hgs
parents:
diff changeset
    59
        static TInt ApplyParameters(
hgs
parents:
diff changeset
    60
                        const TArray< TProcessStartupParam >* aParams,
hgs
parents:
diff changeset
    61
                        RProcess& aProcess );
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
    };
hgs
parents:
diff changeset
    64
hgs
parents:
diff changeset
    65
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
hgs
parents:
diff changeset
    68
/**
hgs
parents:
diff changeset
    69
 * Generic process startup parameters.
hgs
parents:
diff changeset
    70
 */
hgs
parents:
diff changeset
    71
class TProcessStartupParam
hgs
parents:
diff changeset
    72
    {
hgs
parents:
diff changeset
    73
    public:
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
        TProcessStartupParam();
hgs
parents:
diff changeset
    76
        void Set( TInt aSlot, const RHandleBase& aHandle );
hgs
parents:
diff changeset
    77
        void Set( TInt aSlot, const RSubSessionBase& aSubSession );
hgs
parents:
diff changeset
    78
        void Set( TInt aSlot, const TDesC16& aDes );
hgs
parents:
diff changeset
    79
        void Set( TInt aSlot, const TDesC8& aDes );
hgs
parents:
diff changeset
    80
        void Set( TInt aSlot, TInt aInt );
hgs
parents:
diff changeset
    81
        TInt ApplyParam( RProcess& aProcess ) const;
hgs
parents:
diff changeset
    82
hgs
parents:
diff changeset
    83
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
    private: //data
hgs
parents:
diff changeset
    86
hgs
parents:
diff changeset
    87
        enum TParamType{ EUnknown, EHandle, ESubSession,
hgs
parents:
diff changeset
    88
                         EDes16, EDes8, EInt };
hgs
parents:
diff changeset
    89
hgs
parents:
diff changeset
    90
        TParamType iType;
hgs
parents:
diff changeset
    91
        TInt iSlot;
hgs
parents:
diff changeset
    92
        const RHandleBase* iHandle;
hgs
parents:
diff changeset
    93
        const RSubSessionBase* iSubSession;
hgs
parents:
diff changeset
    94
        TPtrC16 iDes16;
hgs
parents:
diff changeset
    95
        TPtrC8 iDes8;
hgs
parents:
diff changeset
    96
        TInt iInt;
hgs
parents:
diff changeset
    97
    };
hgs
parents:
diff changeset
    98
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100
#endif      //  __PROCESSSTARTER_H__
hgs
parents:
diff changeset
   101
hgs
parents:
diff changeset
   102
hgs
parents:
diff changeset
   103
//END OF FILE
hgs
parents:
diff changeset
   104
hgs
parents:
diff changeset
   105