syncmlfw/common/transport/inc/nsmltransport.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2003 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:  SyncML transport interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSML_TRANSPORT_H__
       
    20 #define __NSML_TRANSPORT_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 ///#include "Extbtsearcherobserver.h"
       
    24 #include "bttypes.h"
       
    25 
       
    26 class MExtBTSearcherObserver;
       
    27 
       
    28 _LIT(KSmlHTTPClientLibName, "nsmlhttp.dll");
       
    29 
       
    30 _LIT(KSmlObexClientLibName, "nsmlobexclient.dll");
       
    31 _LIT(KSmlObexServerBindingLibName, "nsmlobexserverbinding.dll");
       
    32 _LIT(KSmlObexUsbClientLibName, "nsmlobexusbclient.dll");
       
    33 
       
    34 
       
    35 const TInt KSmlTransBindingUidValue = 0x101F6DE4;
       
    36 const TUid KSmlTransBindingUid = {KSmlTransBindingUidValue};
       
    37 
       
    38 
       
    39 enum TNSmlObexTransport
       
    40 {
       
    41 	EObexBt,
       
    42 	EObexUsb,
       
    43 	EObexIr
       
    44 };
       
    45 
       
    46 
       
    47 class CNSmlHTTP;
       
    48 class CNsmlObexClient;
       
    49 class CNSmlObexServerBinding;
       
    50 
       
    51 // Reserved to maintain binary compability 
       
    52 class CNSmlFutureReservation;
       
    53 
       
    54 
       
    55 //============================================================
       
    56 // CNSmlTransport declaration
       
    57 //============================================================
       
    58 class CNSmlTransport : public CBase 
       
    59     {
       
    60     public:
       
    61 		IMPORT_C static CNSmlTransport* NewL();
       
    62 		IMPORT_C static CNSmlTransport* NewLC();
       
    63 		IMPORT_C CNSmlTransport();
       
    64 		IMPORT_C ~CNSmlTransport();
       
    65 		IMPORT_C void ConstructL();
       
    66 		IMPORT_C void ConnectL( TUid aMediumType, TBool aServerAlerted, CArrayFixFlat<TUint32>* aIAPIdArray, TDesC8& aURI, TDesC8& aMimeType, TRequestStatus &aStatus, TDesC8& aHTTPusername, TDesC8& aHTTPpassword, TInt aHTTPauthused ); 
       
    67 		IMPORT_C void Disconnect();
       
    68 		IMPORT_C void Send( TDesC8& aStartPtr, TBool /*aFinalPacket*/, TRequestStatus &aStatus );
       
    69 		IMPORT_C void Receive( TPtr8& aStartPtr, TRequestStatus &aStatus );
       
    70 		IMPORT_C void ChangeTargetURIL( TDesC8& aURI );
       
    71 		IMPORT_C void SetBTConnInfo( const TBTDevAddr aBTDevAddr, const TUUID aUid );
       
    72 		IMPORT_C void SetExtObserver( MExtBTSearcherObserver* aExtObserver );
       
    73 
       
    74 	private:
       
    75 		void Connect( CArrayFixFlat<TUint32>* aIAPIdArray, TDesC8& aURI, TDesC8& aMimeType, TRequestStatus &aStatus, TDesC8& aHTTPusername, TDesC8& aHTTPpassword, TInt aHTTPauthused ); 
       
    76 		void Connect( TNSmlObexTransport aTransport,TBool aServerAlerted, TDesC8& aMimeType, TRequestStatus &aStatus );
       
    77         static TBool IsInOfflineModeL(); // 1.2 CHANGES: Offline mode
       
    78 		void LoadObexDllL();
       
    79 		void LoadHTTPDllL();
       
    80 		void LoadObexServerBindingDllL();
       
    81 
       
    82 	public:
       
    83 		CNSmlObexServerBinding* iObexServerBinding;
       
    84 		CNsmlObexClient* iObexBinding;
       
    85 		CNSmlHTTP* iHTTPBinding;
       
    86 		TRequestStatus* iAgentStatus;
       
    87 
       
    88 	private:
       
    89 		TBool iObex;
       
    90 		TBool iObexServer;
       
    91 		RLibrary iObexServerBindingLib;
       
    92 		RLibrary iObexLibrary;
       
    93 		RLibrary iHTTPLibrary;
       
    94 		TUid iCurrMedium;
       
    95 		// Bluetooth specific members
       
    96 		TBTDevAddr iBTDevAddr;
       
    97 		TUUID iServiceUid;
       
    98 		MExtBTSearcherObserver* iBTObserver;
       
    99 		// Reserved to maintain binary compability
       
   100 		CNSmlFutureReservation* iReserved;
       
   101 		TBool iWLANBearer;
       
   102 		
       
   103     };
       
   104 
       
   105 
       
   106 #endif // __NSML_TRANSPORT_H__