bluetoothengine/bthid/bthidserver/inc/socketobserver.h
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Declares main application class.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SOCKETOBSERVER_H__
       
    20 #define __SOCKETOBSERVER_H__
       
    21 
       
    22 /*!
       
    23  This class specifies the socket observer interface
       
    24  Used in conjunction with CSocketReader & CSocketWriter classes
       
    25  */
       
    26 class MSocketObserver
       
    27     {
       
    28 public:
       
    29     /*!
       
    30      Report a communication error.
       
    31      @param aSocketID socket being observed.
       
    32      @param aConnectionLost True if the error is a failure to read.
       
    33      @param aErrorCode associated error code.
       
    34      */
       
    35     virtual void HandleSocketError(TUint aSocketID, TBool aConnectionLost,
       
    36             TInt aErrorCode) = 0;
       
    37 
       
    38     /*!
       
    39      Data has been received on the socket and read into a buffer.
       
    40      @param aSocketID socket being observed.
       
    41      @param aBuffer the data buffer.
       
    42      @result ETrue to continue reading.
       
    43      @result EFalse to stop reading.
       
    44      */
       
    45     virtual TBool
       
    46             HandleDataReceived(TUint aSocketID, const TDesC8& aBuffer) = 0;
       
    47 
       
    48     /*!
       
    49      Data has been sent on the socket.
       
    50      @param aSocketID socket being observed
       
    51      */
       
    52     virtual void HandleWriteComplete(TUint aSocketID) = 0;
       
    53 
       
    54     };
       
    55 
       
    56 #endif // __SOCKETOBSERVER_H__