messagingappbase/obexmtms/btmtm/btserver/include/btsendop.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2001-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 // $Workfile: btsendop.h $
       
    15 // $Author: Stevep $
       
    16 // $Revision: 8 $
       
    17 // $Date: 25/03/02 8:56 $
       
    18 // 
       
    19 //
       
    20 
       
    21 #ifndef __BTSENDOP_H__
       
    22 #define __BTSENDOP_H__
       
    23 
       
    24 #include <obex.h>	//TObexBluetoothProtocolInfo
       
    25 #include <obexsendop.h>
       
    26 #include "../../../obexmtm/obexutil/include/ObexSdpUtils.h" //MObexSdpUtilsObserver
       
    27 
       
    28 //
       
    29 // CBtServerSendOperation 
       
    30 //
       
    31 
       
    32 class CBtServerSendOperation : public CObexServerSendOperation, public MObexSdpUtilsObserver
       
    33 /**
       
    34 class CBtServerSendOperation
       
    35 
       
    36 Bluetooth Send Operation:
       
    37 
       
    38 Thin implementation over the top of CObexSendOperation. Implements InitialiseObexClientL to initialise a Obex client
       
    39 using Bluetooth as the transport mechanism. Runs on the server side.
       
    40 
       
    41 @internalTechnology
       
    42 @released
       
    43 */
       
    44 	{
       
    45 public:
       
    46 
       
    47 	/**
       
    48 	 * Second phase constructor.
       
    49 	 *
       
    50 	 * @param aSendObj Reference to the object to send.
       
    51 	 * @param aBtProtocolInfo Protocol info to initialise the CObexCleint
       
    52 	 * @param aConnectTimeoutMicroSeconds Timeout period for Connect operation in microseconds.
       
    53  	 * @param aPutTimeoutMicroseconds Timeout period for Put operation in microseconds.
       
    54 	 * @param aConnectPassword Pointer to the password for Bluetooth validation.
       
    55 	 * @param aObserverRequestStatus Canonical TRequestStatus for control of active object.
       
    56 	 * @leave KErrXXX System-wide error codes
       
    57 	 */
       
    58 
       
    59 	static CBtServerSendOperation* NewL(CMsvServerEntry& aSendObj, const TObexBluetoothProtocolInfo& aBtProtocolInfo, TInt aConnectTimeoutMicroSeconds, TInt aPutTimeoutMicroseconds, const TDesC* aConnectPassword, TRequestStatus& aObserverRequestStatus);
       
    60 
       
    61 	/**
       
    62 	 * Destructor
       
    63 	 **/
       
    64 	virtual ~CBtServerSendOperation();
       
    65 
       
    66 public: // from CObexSendOperation
       
    67 
       
    68 	/**
       
    69 	 * Initialises the Obex client to use Bluetooth as the transport mechanism with the parameters as specified in the
       
    70 	 * constructor.
       
    71 	 *
       
    72 	 * @leave KErrXXX System-wide error codes 
       
    73 	 */
       
    74 
       
    75 	virtual void InitialiseObexClientL();
       
    76 	
       
    77 	/**
       
    78 	 * Fills in the iBtProtocolInfo structure with the results of the SDP Lookup.
       
    79 	 */	
       
    80 	virtual void SecondPhaseObexClientInitL();
       
    81 
       
    82 	/**
       
    83 	 * Operations to perform before attempting a connection.
       
    84 	 * As multiple connection attempts can be made, it is necessary for this
       
    85 	 * routine to ensure it can handle being called multiple times.
       
    86 	 */
       
    87 	virtual void PreConnectOperations();
       
    88 
       
    89 	/**
       
    90 	 * Operations to perform after attempting a connection.
       
    91 	 * As multiple connection attempts can be made, it is necessary for this
       
    92 	 * routine to ensure it can handle being called multiple times.
       
    93 	 */
       
    94 	virtual void PostConnectOperations();
       
    95 
       
    96 	/**
       
    97 	 * Operations to perform before attempting to send a set of objects.
       
    98 	 */
       
    99 	virtual void PreSendOperations();
       
   100 
       
   101 	/**
       
   102 	 * Operations to perform after attempting to send a set of objects.
       
   103 	 */
       
   104 	virtual void PostSendOperations();
       
   105 
       
   106 	/**
       
   107 	 * Cancel
       
   108 	 */	
       
   109 	void DoCancel();
       
   110 
       
   111 private:
       
   112 	
       
   113 	/**
       
   114 	 * Constructor.
       
   115 	 *
       
   116 	 * @param aSendObj Reference to the object to send.
       
   117 	 * @param aBtProtocolInfo Protocol info to initialise the CObexCleint
       
   118 	 * @param aConnectTimeoutMicroSeconds Timeout period for Connect operation in microseconds.
       
   119 	 * @param aPutTimeoutMicroseconds Timeout period for Put operation in microseconds.
       
   120 	 * @param aConnectPassword Pointer to the password for Bluetooth validation.
       
   121 	 * @param aObserverRequestStatus Canonical TRequestStatus for control of active object.
       
   122 	 */	
       
   123 
       
   124 	CBtServerSendOperation(CMsvServerEntry& aSendObj, const TObexBluetoothProtocolInfo& aBtProtocolInfo, TInt aConnectTimeoutMicroSeconds, TInt aPutTimeoutMicroSeconds, TRequestStatus& aObserverRequestStatus);
       
   125 	
       
   126 	/**
       
   127 	 * SDP Query result, parameters have the following meaning:
       
   128 	 *
       
   129 	 * @param aError If this is anything but KErrNone then the query has not completed correctly and all other parameters are meaningless.
       
   130 	 * @param aPortNumber - The RFCOMM port number that the remote device supports OBEX on
       
   131 	 * @param aObexObjectPushProfileSupported - ETrue if the remote device supports the Bluetooth OBEX Push Profile
       
   132 	 * @param aObexObjectPushProfileVersion - Version of Bluetooth OBEX Push Profile supported (only valid if aObexObjectPushProfileSupported == ETrue)
       
   133 	 * @param aSupportedFormats - Structure containing a list of the OBEX Object formats supported by the remote device
       
   134 	 */
       
   135 
       
   136 	virtual void RemoteBtObexQueryResult(TInt aError, 
       
   137 								 TInt aPortNumber, 
       
   138 								 TBool aObexObjectPushProfileSupported, 
       
   139 								 TInt aObexObjectPushProfileVersion, 
       
   140 								 TObexSupportedFormatsList aSupportedFormats);
       
   141 
       
   142 	/**
       
   143 	 * Allow the link to go into low power modes
       
   144 	 */
       
   145 	void AllowLowPowerModes();
       
   146 
       
   147 	/**
       
   148 	 * Prevent the link from going into low power modes
       
   149 	 */
       
   150 	void PreventLowPowerModes();
       
   151 
       
   152 private:
       
   153 	TObexBluetoothProtocolInfo iBtProtocolInfo;	//< Protocol info to initialise the CObexClient. Non-const because the CObexClient's NewL() takes a non-const reference
       
   154 	CObexSdpUtils *iSdpUtils; //< Used to perform SDP lookup query
       
   155 	TInt	iBTObexPortNumber; //< Bluetooth Obex port number
       
   156 	RSocketServ iSocketServ;
       
   157 	RBTPhysicalLinkAdapter iLinkAdapter;
       
   158 	TBool iPreventingLowPowerModes;
       
   159 	};
       
   160 
       
   161 #endif // __BTSENDOP_H__