videofeeds/clientapi/inc/CIptvClientBase.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 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:    Base class of iptv client objects*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CIPTVCLIENTBASE_H
       
    21 #define CIPTVCLIENTBASE_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 #include "RIptvClientSession.h"
       
    26 
       
    27 class MIptvStreamObject;
       
    28 class MIptvEvent;
       
    29 
       
    30 /**
       
    31  * Iptv client objects base class.
       
    32  *
       
    33  * @lib IptvEngineClient.dll
       
    34  */
       
    35 class CIptvClientBase : public CActive
       
    36     {
       
    37 
       
    38 public:
       
    39 
       
    40     /**
       
    41      * Destructor.
       
    42      */
       
    43     virtual ~CIptvClientBase();
       
    44 
       
    45     /**
       
    46      * Sends message to IPTV Engine server synchronously.
       
    47      * @param aMsgId ID of the message to send.
       
    48      * @param aReqStreamObject Object to send.
       
    49      * @param aRespStreamObject Response object from server.
       
    50      * @param aIpcMsgSize if 0, aReqStreamObject.CountExtrenalizeSize() is used
       
    51      *                   to allocate memory for ipc msg.
       
    52      * @return TInt Set by server.
       
    53      */
       
    54     TInt SendRequestL(
       
    55         TUint16 aMsgId,
       
    56         MIptvStreamObject& aReqStreamObject,
       
    57         MIptvStreamObject& aRespStreamObject,
       
    58         TInt aIpcMsgSize );
       
    59 
       
    60     /**
       
    61      * Sends message to IPTV Engine server synchronously.
       
    62      * @param aMsgId ID of the message to send.
       
    63      * @param aRespStreamObject Response object from server.
       
    64      * @param aIpcMsgSize ipc message size to allocated.
       
    65      * @return TInt Set by server.
       
    66      */
       
    67     TInt SendRequestL(
       
    68         TUint16 aMsgId,
       
    69         MIptvStreamObject& aRespStreamObject,
       
    70         TInt aIpcMsgSize );
       
    71 
       
    72     /**
       
    73      * Sends message to IPTV Engine server synchronously.
       
    74      * @param aMsgId ID of the message to send.
       
    75      * @param aReqStreamObject Object to send.
       
    76      * @return TInt Set by server.
       
    77      */
       
    78     TInt SendRequestL(
       
    79         TUint16 aMsgId,
       
    80         MIptvStreamObject& aReqStreamObject );
       
    81 
       
    82     /**
       
    83      * Send request to server.
       
    84      *
       
    85      * @param aMessage Message to send.
       
    86      * @param aUintParam   Message parameter, TUint32.
       
    87      * @return KErrNone or one of system wide error codes.
       
    88      */
       
    89     TInt SendRequestL(
       
    90         TInt aMessage,
       
    91         const TDesC& aMsg );
       
    92 
       
    93     /**
       
    94      * From MIptvEventListenerObserver.
       
    95      * @param aEvent
       
    96      */
       
    97     virtual void HandleEvent( MIptvEvent& aEvent ) = 0;
       
    98 
       
    99 protected: //called from derived classes constructor
       
   100 
       
   101     /**
       
   102      * C++ default constructor.
       
   103      */
       
   104     CIptvClientBase();
       
   105 
       
   106 private:
       
   107 
       
   108     /**
       
   109      * From CActive, handles an active object’s request completion event
       
   110      */
       
   111     void RunL();
       
   112 
       
   113     /**
       
   114      * From CActive, implements cancellation of an outstanding request.
       
   115      * This function is called as part of the active object’s Cancel().
       
   116      */
       
   117     void DoCancel();
       
   118 
       
   119 public:     // Data
       
   120 
       
   121     RIptvClientSession        iSession;
       
   122 
       
   123     };
       
   124 
       
   125 #endif // CIPTVCLIENTBASE_H