videofeeds/clientapi/inc/RIptvClientSession.h
branchRCL_3
changeset 23 befca0ec475f
parent 0 96612d01cf9f
equal deleted inserted replaced
22:839377eedc2b 23:befca0ec475f
       
     1 /*
       
     2 * Copyright (c) 2005-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 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __RIPTVCLIENTSESSION_H__
       
    23 #define __RIPTVCLIENTSESSION_H__
       
    24 
       
    25 // INCLUDE FILES
       
    26 #include <e32base.h>
       
    27 #include <badesca.h>
       
    28 #include "IptvEngineUids.h"
       
    29 
       
    30 // CONSTANTS
       
    31 // Number of message slots to reserve for this client server session.
       
    32 
       
    33 const TUid KIptvEngineServerUid3 = { IPTV_SERVER_UID };
       
    34 
       
    35 #ifdef __WINS__
       
    36 static const TUint KServerMinHeapSize =  0x1000;  //  4K
       
    37 static const TUint KServerMaxHeapSize = 0x10000;  // 64K
       
    38 #endif
       
    39 
       
    40 class MIptvStreamObject;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 /**
       
    44  *  Provides the client-side interface to the server session.
       
    45  */
       
    46 class RIptvClientSession : public RSessionBase
       
    47     {
       
    48     public:
       
    49 
       
    50         /**
       
    51         * Constructs the object.
       
    52         */
       
    53         IMPORT_C RIptvClientSession();
       
    54 
       
    55         /*!
       
    56         *Destructor
       
    57         */
       
    58         IMPORT_C ~RIptvClientSession();
       
    59 
       
    60         /**
       
    61         * Connects to the server and creates a session.
       
    62         * Retries 10 times.
       
    63         * @return System wide error code.
       
    64         */
       
    65         IMPORT_C TInt Connect();
       
    66 
       
    67         /**
       
    68         * Gets the version number.
       
    69         * @return The version.
       
    70         */
       
    71         IMPORT_C TVersion Version() const;
       
    72 
       
    73         /**
       
    74         * Checks if session handle is null.
       
    75         *
       
    76         * @return ETrue if handle is null.
       
    77         */
       
    78         TBool IsNull() const;
       
    79 
       
    80         /**
       
    81         * Sends message to IPTV Engine server.
       
    82         * @param aMsgId ID of the message to send.
       
    83         * @param aMsg descriptor where both client and server write data.
       
    84         * @param aStatus The TRequestStatus object to be used for async comms.
       
    85         */
       
    86         IMPORT_C void SendRequest(TUint8 aMsgId,
       
    87                                   TDes8& aMsg,
       
    88                                   TRequestStatus& aStatus);
       
    89 
       
    90         IMPORT_C TInt SendRequest(TUint8 aMsgId,
       
    91                                   TDes8& aMsg);
       
    92 
       
    93         /**
       
    94         * Sends message to IPTV Engine server.
       
    95         * @param aMsgId ID of the message to send.
       
    96         * @param aStatus The TRequestStatus object to be used for async comms.
       
    97         */
       
    98         IMPORT_C void SendRequest(TUint8 aMsgId,
       
    99                                   TRequestStatus& aStatus);
       
   100 		
       
   101         /**
       
   102          * Send message to Iptv Engine Server synchronously.
       
   103          */
       
   104         IMPORT_C TInt SendRequest(TUint8 aMsgId) const;
       
   105 
       
   106         /**
       
   107         * Sends message to IPTV Engine server synchronously.
       
   108         * @param aMsgId ID of the message to send.
       
   109         * @param aArgs Message arguments. 
       
   110         * @return KErrNone if ok, otherwise system-wide error codes.
       
   111         */
       
   112         TInt SendRequest( TUint8 aMsgId, TIpcArgs& aArgs ) const;
       
   113 
       
   114     private:
       
   115     
       
   116         /**
       
   117          * Tries connection to the IPTV server once.
       
   118          */    
       
   119         TInt TryConnect();
       
   120 
       
   121 
       
   122     private:
       
   123     
       
   124 		/**
       
   125          * iIpcMessage Heap object to reserve memory for IPC messaging.
       
   126          */
       
   127         HBufC8* iIpcMessage;
       
   128         
       
   129        /**
       
   130         * iIpcMessagePtr Points to iIpcMessage heap object. This _must_ be a member variable.
       
   131         */
       
   132         TPtr8   iIpcMessagePtr;
       
   133 
       
   134 		
       
   135     };
       
   136 
       
   137 
       
   138 #endif // __RIPTVCLIENTSESSION_H__
       
   139 
       
   140 
       
   141 // End of File