connectivitylayer/isce/p2prouter_dll/inc/p2pif.h
changeset 0 63b37f68c1ce
child 9 8486d82aef45
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 2009 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 #ifndef __P2PIF_H__
       
    21 #define __P2PIF_H__
       
    22 
       
    23 // Includes
       
    24 #include <klib.h>           // For DBase
       
    25 #include <mp2pif.h>         // For MP2PIf
       
    26 
       
    27 // Forward declarations
       
    28 class DP2PKernelChannel;
       
    29 
       
    30 /**
       
    31 *  Implementation for P2P kernel interface.
       
    32 */
       
    33 NONSHARABLE_CLASS( DP2PIf ) : public DBase, public MP2PIf
       
    34 {
       
    35 
       
    36     public:
       
    37 
       
    38         /*
       
    39         * Constructor.
       
    40         * Throws fault if memory not available.
       
    41         */
       
    42         static DP2PIf* NewF();
       
    43 
       
    44         /*
       
    45         * Destructor.
       
    46         */
       
    47         ~DP2PIf();
       
    48 
       
    49         // From MP2PIf start
       
    50 
       
    51         /*
       
    52         * See comments from MP2PIf
       
    53         */
       
    54         TDes8& AllocateBlock( const TUint16 aSize );
       
    55 
       
    56         /*
       
    57         * See comments from MP2PIf
       
    58         */
       
    59         void Close();
       
    60 
       
    61         /*
       
    62         * See comments from MP2PIf
       
    63         */
       
    64         virtual void ConnectionLost( TInt& aStatus, const TDfc& aConnectionResetedCompletedDfc );
       
    65 
       
    66         /*
       
    67         * See comments from MP2PIf
       
    68         */
       
    69         virtual void ConnectionLostCancel();
       
    70 
       
    71         /*
       
    72         * See comments from MP2PIf
       
    73         */
       
    74         void DeallocateBlock( TDes8& aDataBlock );
       
    75 
       
    76         /*
       
    77         * See comments from MP2PIf
       
    78         */
       
    79         void Open( const TP2PProtocol aP2PProtocolId, TInt& aDfcStatus,TDfc& aOpenCompleteDfc );
       
    80 
       
    81         /*
       
    82         * See comments from MP2PIf
       
    83         */
       
    84         void OpenCancel();
       
    85 
       
    86         /*
       
    87         * See comments from MP2PIf
       
    88         */
       
    89         void Receive( TDes8*& aRxDataBlock, TInt& aStatus, const TDfc& aReceiveCompletedDfc );
       
    90 
       
    91         /*
       
    92         * See comments from MP2PIf
       
    93         */
       
    94         void ReceiveCancel();
       
    95 
       
    96         /*
       
    97         * See comments from MP2PIf
       
    98         */
       
    99         void Release();
       
   100 
       
   101         /*
       
   102         * See comments from MP2PIf
       
   103         */
       
   104         TInt Send( TDes8& aData );
       
   105 
       
   106         // From MP2PIf end
       
   107 
       
   108 // TODO other system presence
       
   109 
       
   110     private:
       
   111 
       
   112         /**
       
   113          * Private constructor.
       
   114          * One reason for this is class size BC.
       
   115          */
       
   116         DP2PIf();
       
   117 
       
   118     private:
       
   119 
       
   120         // Owned
       
   121         // Kernel channel dedicated for this.
       
   122         // Synchronization done in kernel channel.
       
   123         DP2PKernelChannel*  iKernelChannel;
       
   124 
       
   125     };
       
   126 
       
   127 #endif // __P2PIF_H__
       
   128 
       
   129 // End of File.
       
   130