obex/obexprotocol/obex/inc/obexnotifyhandlerbase.h
changeset 54 4dc88a4ac6f4
parent 52 866b4af7ffbe
child 57 f6055a57ae18
equal deleted inserted replaced
52:866b4af7ffbe 54:4dc88a4ac6f4
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef OBEXNOTIFYHANDLERBASE_H
       
    17 #define OBEXNOTIFYHANDLERBASE_H
       
    18 
       
    19 /**
       
    20 @file
       
    21 @released
       
    22 @internalComponent
       
    23 */
       
    24 
       
    25 #include <obex.h>
       
    26 #include <obex/internal/mobexnotifyextend.h>
       
    27 
       
    28 class CObexPacket;
       
    29 struct TObexConnectionInfo;
       
    30 /** Receives notifications from transport.
       
    31 
       
    32 This is provided as a way of retaining BC for the CObexClient and 
       
    33 CObexServer classes.
       
    34 
       
    35 This class implements the MObexNotifyExtend interface which is provided
       
    36 to the transport.  Functions can safely be added to MObexNotifyExtend to 
       
    37 allow the transport to provide additional notifications in future without
       
    38 altering the vtable for the published classes.  
       
    39 
       
    40 A CObex owns a CObexNotifyHandlerBase.  The CObexNotifyHandler base
       
    41 should not be instantiated directly, instead one of the derived classes
       
    42 should be used.  The derived class then knows the type of the CObex
       
    43 object created it, as the constructor will require an appropriately
       
    44 derived type.  This allows the non-virtual functions in the appropriate
       
    45 class to be called to handle notifications.
       
    46 
       
    47 Functions that are generic CObex functions, rather than functions that
       
    48 are handled differently by CObexClient and CObexServer, may be implemented
       
    49 in the base class.
       
    50 */
       
    51 NONSHARABLE_CLASS(CObexNotifyHandlerBase) : public CBase, public MObexNotifyExtend
       
    52 	{
       
    53 public:
       
    54 	virtual void Process(CObexPacket& aPacket);
       
    55 	virtual void Error(TInt aError);
       
    56 	virtual void TransportUp();	
       
    57 	virtual void TransportDown(TBool aForceTransportDeletion);
       
    58 	
       
    59 protected:
       
    60 	CObexNotifyHandlerBase(CObex& aObex);
       
    61 
       
    62 protected:
       
    63 	CObex& iObex;
       
    64 	};
       
    65 	
       
    66 #endif // OBEXNOTIFYHANDLERBASE_H