psmservices/psmserver/inc/client/psmsession.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2007 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:  PSM client-server session class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef PSMSESSION_H
       
    20 #define PSMSESSION_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <psmtypes.h>
       
    24 #include "psmclientserver.h"
       
    25 
       
    26 /**
       
    27  * Main session class for PSM server. This is only for PSM client's 
       
    28  * internal use. R-classes are hidden to actual clients.
       
    29  * 
       
    30  * @since S60 5.0
       
    31  */
       
    32 NONSHARABLE_CLASS ( RPsmServer ) : public RSessionBase
       
    33     {
       
    34     public:
       
    35         /**
       
    36          * Creates a session with a server.
       
    37          */
       
    38         TInt Connect();
       
    39 
       
    40         /**
       
    41          * Send message to server
       
    42          *
       
    43          * @param aRequest The function number identifying the request.
       
    44          * @param aArgs A set of up to arguments
       
    45          * @return KErrNone if connect succesfully, otherwise system wide error
       
    46          */
       
    47         TInt SendReceiveSync( TPsmServerRequest aRequest, const TIpcArgs& aArgs ) const;
       
    48 
       
    49         /**
       
    50          * Send asynchronous message to server
       
    51          *
       
    52          * @param aRequest The function number identifying the request.
       
    53          * @param aArgs A set of up to arguments
       
    54          * @param aStatus The request status object used to contain the completion status of the request.
       
    55          */
       
    56         void SendReceiveAsync( TPsmServerRequest aRequest, 
       
    57                                const TIpcArgs& aArgs, 
       
    58                                TRequestStatus& aStatus ) const;
       
    59 
       
    60     private:
       
    61 
       
    62         /**
       
    63          * Return server location
       
    64          *
       
    65          * @return location of server
       
    66          */
       
    67         TFullName ServerLocation() const;
       
    68 
       
    69         /**
       
    70          * Return version of server
       
    71          *
       
    72          * @return version of server
       
    73          */
       
    74         TVersion ServerVersion() const;
       
    75 
       
    76         /**
       
    77          * Starts server
       
    78          *
       
    79          * @return KErrNone if started succesfully, otherwise system wide error
       
    80          */
       
    81         TInt StartServer() const;
       
    82 
       
    83     };
       
    84 
       
    85 #endif // PSMSESSION_H