connectivitylayer/isce/isaaccessextension_dll/inc/internalapi.h
changeset 0 63b37f68c1ce
child 5 8ccc39f9d787
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 MDATAMESSAGESTATUS_H
       
    21 #define MDATAMESSAGESTATUS_H
       
    22 
       
    23 class MDataMessageStatus
       
    24     {
       
    25 
       
    26    public:
       
    27 
       
    28     /*
       
    29     * Called when datamessage is delivered to client.
       
    30     * @param none
       
    31     * @return void
       
    32     */
       
    33     virtual void DataMessageDelivered() = 0;
       
    34 
       
    35     };
       
    36 
       
    37 #endif // MDATAMESSAGESTATUS_H
       
    38 
       
    39 
       
    40 #ifndef MIAD2CHANNEL_H
       
    41 #define MIAD2CHANNEL_H
       
    42 
       
    43 #include "iadinternaldefinitions.h"    // For TIADConnectionStatus
       
    44 //#include "mist2iadapi.h"  // For TIADConnectionStatus // 
       
    45 
       
    46 // abstract interface for both channels user & kernel 
       
    47 // called by extension, provided by extension
       
    48 class MIAD2ChannelApi // TODO: MDataRx2ChannelApi?
       
    49     {
       
    50     
       
    51     public:
       
    52 
       
    53     /*
       
    54     * Complete async request with given params.
       
    55     * @param TInt aRequest, request to complete.
       
    56     * @param TInt aStatusToComplete, status of the request to complete.
       
    57     * @return void
       
    58     */  
       
    59     virtual void CompleteChannelRequest( TInt aRequest, TInt aStatusToComplete ) = 0;
       
    60     
       
    61     /*
       
    62     * Info channel about the connection status.
       
    63     * @param TIADConnectionStatus aStatus, new connection status
       
    64     * @return void
       
    65     */
       
    66     virtual void NotifyConnectionStatus( TIADConnectionStatus aStatus ) = 0;
       
    67 
       
    68     /*
       
    69     * Info channel about the flowcontorl status.
       
    70     * @param TIADFlowControlStatus aStatus, new flow control status
       
    71     * @return void
       
    72     */    
       
    73     virtual void NotifyFlowCtrl( TIADFlowControlStatus aStatus) = 0;
       
    74 
       
    75     // When data message is written to user thread call
       
    76     // MDataMesssageStatus::DataMessageDelivered. It's responsibility is to
       
    77     // tell PEP that one data message e.g.a credit is used. PEP's should also
       
    78     // keep count of data messages added to channel to be abel to control the
       
    79     // legacy flowcontrol
       
    80 
       
    81     /*
       
    82     * Give channel a reference to received data message.
       
    83     * @param const TDesC8& aDataMessage
       
    84     * @return void
       
    85     */        
       
    86     virtual void ReceiveDataMsg( const TDesC8& aDataMessage ) = 0;
       
    87 
       
    88     /*
       
    89     * Give channel a reference to received message.
       
    90     * @param const TDesC8& aMessage
       
    91     * @return void
       
    92     */    
       
    93     virtual void ReceiveMsg( const TDesC8& aMessage ) = 0;
       
    94 
       
    95     /*
       
    96            * Register pep associated to this channel to listen data message deliveries.
       
    97     * @param MDataMessageStatus& aPep
       
    98     * @return void
       
    99     */    
       
   100     virtual void RegisterPep( MDataMessageStatus& aPep ) = 0;
       
   101 
       
   102     };
       
   103 
       
   104 #endif // MIAD2CHANNEL_H
       
   105 
       
   106 #ifndef MCHANNEL2IADAPI_H
       
   107 #define MCHANNEL2IADAPI_H
       
   108 
       
   109 // abstract inteface for LDD to access Extension services
       
   110 // *called by LDD
       
   111 // *provided from extension
       
   112 // *must take care of syncronization, LDD and kernel channels using this
       
   113 class MChannel2IADApi
       
   114     {
       
   115 
       
   116     public:
       
   117 
       
   118     /*
       
   119     * Allocate a block. Descriptors length is set to aSize, but MaxLength can
       
   120     * can be bigger, depends on memory block configurations.
       
   121     * @param const TUint16 aSize
       
   122     * @return TDes8&
       
   123     */      
       
   124     virtual TDes8& AllocateBlock( const TUint16 aSize ) = 0;
       
   125 
       
   126     virtual TDes8& AllocateDataBlock( const TUint16 aSize ) = 0;
       
   127 
       
   128     virtual void Close( const TUint16 aChannel ) = 0;
       
   129 
       
   130     virtual void DeAllocateBlock(TDes8& aBlock) = 0;
       
   131 
       
   132     virtual TInt GetConnectionStatus() = 0;
       
   133   
       
   134     virtual TInt GetFlowControlStatus() = 0;
       
   135 
       
   136     virtual TInt GetMaxDataSize() = 0;
       
   137 
       
   138     virtual void Open( const TUint16 aChannel, const TUint16 aRequest, MIAD2ChannelApi* aCallback ) = 0;
       
   139 
       
   140     virtual void Open( const TUint16 aChannel, const TUint16 aRequest, const TDesC8& aOpenInfo, MIAD2ChannelApi* aCallback ) = 0;
       
   141 
       
   142     virtual TInt OrderIndication( TDes8& anOrder, const TUint16 aCh, const TBool a32Bit = EFalse ) = 0;
       
   143 
       
   144     virtual TInt SendMessage( TDes8& aMessage, const TUint16 aCh ) = 0;
       
   145 
       
   146     /*
       
   147     * Sends an ISI indication message.
       
   148     * @param TDes8& aMessage, indication message
       
   149     * @param const TUint16 aCh, sender channels id.
       
   150     * @return TInt, KErrNone if send succesfull.
       
   151     */
       
   152     virtual TInt SendIndication( TDes8& aMessage, const TUint16 aCh ) = 0;
       
   153 
       
   154 #if (NCP_COMMON_SOS_VERSION_SUPPORT >= SOS_VERSION_95)
       
   155     virtual TInt Loan( const TUint16 aChannel, const TUint16 aRequest,
       
   156                        MIAD2ChannelApi* aCallback ) = 0;
       
   157 
       
   158     virtual TInt ReturnLoan( const TUint16 aChannel, const TUint16 aRequest,
       
   159                              MIAD2ChannelApi* aCallback ) = 0;
       
   160 #endif
       
   161 
       
   162     };
       
   163 
       
   164 #endif // MCHANNEL2IADAPI_H
       
   165