mpx/commonframework/common/src/mpxsession.cpp
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2006 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:  implementation of playback session
       
    15 *
       
    16 */
       
    17 
       
    18 #include <mpxsession.h>
       
    19 #include "mpxsessionretry.h"
       
    20 
       
    21 
       
    22 // ============================== CONSTRUCTOR =================================
       
    23 
       
    24 // ----------------------------------------------------------------------------
       
    25 // Constructor
       
    26 // ----------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C RMPXSession::RMPXSession()
       
    29     {
       
    30     iSessionRetry = new RMPXSessionRetry();
       
    31     }
       
    32 
       
    33 EXPORT_C RMPXSession::~RMPXSession()
       
    34     {
       
    35     delete iSessionRetry;
       
    36     }
       
    37 
       
    38 // ============================== MEMBER FUNCTIONS ============================
       
    39 
       
    40 // ----------------------------------------------------------------------------
       
    41 // Return the version info
       
    42 // ----------------------------------------------------------------------------
       
    43 //
       
    44 EXPORT_C TVersion RMPXSession::Version() const
       
    45     { 
       
    46     return iSessionRetry->Version();
       
    47     }
       
    48 
       
    49 // ----------------------------------------------------------------------------
       
    50 // Connect to server
       
    51 // ----------------------------------------------------------------------------
       
    52 //
       
    53 EXPORT_C TInt RMPXSession::Connect(const TDesC& aServer, 
       
    54                                    const TDesC& aImage, 
       
    55                                    const TVersion& aVersion)
       
    56     {
       
    57     return iSessionRetry->Connect(aServer, aImage, aVersion); 
       
    58     }
       
    59 
       
    60 // ----------------------------------------------------------------------------
       
    61 // Reconnect to server
       
    62 // ----------------------------------------------------------------------------
       
    63 //
       
    64 EXPORT_C TInt RMPXSession::Reconnect() const
       
    65     {
       
    66     return iSessionRetry->Reconnect();
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // Send a message
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C TInt RMPXSession::SendReceiveL(TInt aFunction) const
       
    74     {
       
    75     return iSessionRetry->SendReceiveL(aFunction);
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // Send a message
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 EXPORT_C TInt RMPXSession::SendReceiveL(TInt aFunction,
       
    83                                         const TIpcArgs& aArgs) const
       
    84     {
       
    85     return iSessionRetry->SendReceiveL(aFunction, aArgs);
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // Send a message
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 EXPORT_C void RMPXSession::SendReceive(TInt aFunction,
       
    93                                        TRequestStatus& aStatus) const
       
    94     {
       
    95     iSessionRetry->SendReceive(aFunction, aStatus);        
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // Send a message
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 EXPORT_C void RMPXSession::SendReceive(TInt aFunction,
       
   103                                        const TIpcArgs& aArgs,
       
   104                                        TRequestStatus& aStatus) const
       
   105     {
       
   106     iSessionRetry->SendReceive(aFunction, aArgs, aStatus);    
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // Close session.
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 EXPORT_C void RMPXSession::Close()
       
   114     {
       
   115     iSessionRetry->Close();
       
   116     }