presadap12/impsplugin/inc/mimpspluginpuredatahandler.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     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:  Pure data handler abstract interface
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MIMPSPUREDATAHANDLER_H__
       
    19 #define __MIMPSPUREDATAHANDLER_H__
       
    20 
       
    21 
       
    22 //  INCLUDES
       
    23 #include <E32Std.h>
       
    24 
       
    25 // DATA TYPES
       
    26 
       
    27 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 /**
       
    34  *  Pure data handler for network session
       
    35  *
       
    36  *  It is used to send requests to the network
       
    37  *  server and to retrieve its responses
       
    38  *
       
    39  *  @since 3.0
       
    40  */
       
    41 class MImpsPureDataHandler
       
    42     {
       
    43 
       
    44     public: //
       
    45 
       
    46         /**
       
    47         *  Get Transfer buffer for out going message
       
    48         *
       
    49         *  @since 3.0
       
    50         *  @return writable data buffer
       
    51         */
       
    52         virtual TPtr8 TransferBufferL() = 0;
       
    53 
       
    54         /**
       
    55          *  Sends data from the transfer buffer to the network
       
    56          *  Completion code is signaled in TRequestStatus complete
       
    57          *
       
    58          *  @since 3.0
       
    59          *  @param aStatus TRequestStatus to signal completion
       
    60          *  @return unique code of the transaction. Same code is
       
    61          *          used, when client wants to get response to this
       
    62          *          message
       
    63          */
       
    64         virtual TInt SendDataL( TRequestStatus& aStatus ) = 0;
       
    65 
       
    66         /**
       
    67          *  Gets response for the message of given operation id
       
    68          *
       
    69          *  @since 3.0
       
    70          *  @param aTransId transaction Id generated by the send operation
       
    71          *  @return buffer with the response to the transaction
       
    72          *          ownership of the buffer is passed to the user of function
       
    73          */
       
    74         virtual HBufC8* ResponseL( TInt aTransId ) = 0;
       
    75 
       
    76         /**
       
    77          *  Cancel sendin operation of given transaction id
       
    78          *
       
    79          *  @since 3.0
       
    80          *
       
    81          *  @param aTransId transaction id of operation to be canceled
       
    82          */
       
    83         virtual void CancelSending( TInt aTransId ) = 0;
       
    84 
       
    85         /**
       
    86          *  Listen Incoming data
       
    87          *  Function returns number of incoming data buffer which
       
    88          *  are queued on the client side and can be picked
       
    89          *  when incoming data are picked by the listener, transaction
       
    90          *  is is 0. Buffer of incoming data is FIFO
       
    91          *
       
    92          *  @since 3.0
       
    93          *  @param request status to signal new data
       
    94          *  @return number of the incoming data buffers
       
    95          *      which are already ready to be picked by the listener
       
    96          */
       
    97         virtual TInt ListenIncomingData( TRequestStatus& aStatus ) = 0;
       
    98 
       
    99         /**
       
   100          *  Cancel incoming data listening
       
   101          *
       
   102          *  @since 3.0
       
   103          *  @param
       
   104          *  @return
       
   105          */
       
   106         virtual void CancelListening() = 0;
       
   107 
       
   108     protected:  //Destructor
       
   109 
       
   110         /**
       
   111          *  Virtual inline destructor.
       
   112          *  Protected destructor to prohibits deletion trough interface.
       
   113          */
       
   114         virtual ~MImpsPureDataHandler() {};
       
   115     };
       
   116 
       
   117 
       
   118 #endif      //  __MIMPSPUREDATAHANDLER_H__
       
   119 
       
   120 //  End of File
       
   121 
       
   122 
       
   123