obex/obexprotocol/obex/inc/obexservernotifysyncwrapper.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 // All rights reserved.
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef OBEXSERVERNOTIFYSYNCWRAPPER_H
       
    19 #define OBEXSERVERNOTIFYSYNCWRAPPER_H
       
    20 
       
    21 
       
    22 /**
       
    23 @file
       
    24 @internalComponent
       
    25 */
       
    26 
       
    27 #include <e32base.h>
       
    28 
       
    29 #ifdef __FLOG_ACTIVE
       
    30 _LIT8(KSyncWrapper, "syncwrapper");
       
    31 
       
    32 #define WRAPPER_LOG(str) CObexLog::Write(KSyncWrapper, str)
       
    33 #else
       
    34 #define WRAPPER_LOG(str)
       
    35 #endif
       
    36 
       
    37 /**
       
    38 Implements a synchronous wrapper around the asynchronous notification API
       
    39 now used by the Obex server.  It therefore provides an SC and BC migration
       
    40 path for existing code.
       
    41 @see MObexServerNotify
       
    42 @see MObexServerNotifyAsync
       
    43 */
       
    44 NONSHARABLE_CLASS(CObexServerNotifySyncWrapper) : public CBase, public MObexServerNotifyAsync
       
    45 	{
       
    46 public:
       
    47 	static CObexServerNotifySyncWrapper* NewL(CObexServer& aOwner, CObexServerStateMachine& aStateMachine);
       
    48 	~CObexServerNotifySyncWrapper();
       
    49 	void SetNotifier(MObexServerNotify* aNotify);
       
    50 	
       
    51 private:
       
    52 	CObexServerNotifySyncWrapper(CObexServer& aOwner, CObexServerStateMachine& aStateMachine);
       
    53 
       
    54 private:
       
    55 	// From MObexServerNotifyAsync
       
    56 	void ErrorIndication(TInt aError);
       
    57 	void TransportUpIndication();
       
    58 	void TransportDownIndication();
       
    59 	void ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo);
       
    60 	void ObexDisconnectIndication(const TDesC8& aInfo);
       
    61 	void PutRequestIndication();
       
    62 	TInt PutPacketIndication();
       
    63 	void PutCompleteIndication();
       
    64 	void GetRequestIndication(CObexBaseObject* aRequiredObject);
       
    65 	TInt GetPacketIndication();
       
    66 	void GetCompleteIndication();
       
    67 	void SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo);
       
    68 	void AbortIndication();
       
    69 	void CancelIndicationCallback();
       
    70 
       
    71 private:
       
    72 	CObexServer& iOwner;
       
    73 	MObexServerNotify* iNotify;
       
    74 	TBool		iCallbackOutstanding;
       
    75 	CObexServerStateMachine& iStateMachine;
       
    76 	};
       
    77 
       
    78 #endif	// OBEXSERVERNOTIFYSYNCWRAPPER_H